[PATCH 2/2] Use get_dive to populate divelistview with dives

Tomaz Canabrava tcanabrava at kde.org
Fri Apr 19 10:11:12 PDT 2013


Ups,
it seems that my last e-mail was just to one person instead going into the
list,
Amit send the code to populate the dive-list to the mainwindow, I`m working
on reworking his model a bit so the mainwindow doesn`t needs to know about
how to deal the model.
already talked to him about it and he said `go for it`.

Tomaz


2013/4/18 Dirk Hohndel <dirk at hohndel.org>

> Dirk Hohndel <dirk at hohndel.org> writes:
>
> > amit.k.chaudhuri at gmail.com writes:
> >> +
>  QDateTime::fromTime_t(d->when).toString(),
> >
> > Oh, didn't see this until just now when I started to look into
> > it... as Linus pointed out - you really don't want to do that as this
> > will break for anyone who doesn't happen to live in GMT.
>
> Ok, I just pushed two more commits to clean this up. These commits also
> show why I think it's a mistake to simply toss away Subsurface's types
> and pass around floats and strings.
>
> a) floats are not needed. almost everything we do has been rather
> carefully designed to fit in ints
> b) the moment you convert to float you lose type checking. Had you
> designed the constructor so that it takes a timestamp_t, a duration_t, a
> depth_t, etc as arguments then mistakes like this one would have been
> caught by the compiler - and the date string conversion would happen in
> one place.
>
> I was briefly tempted to fix the constructor to use the types that I
> want it to use but I'm way past my lunch break and need to go back to
> real work. But that's something I really want to see...
>
> /D
> _______________________________________________
> subsurface mailing list
> subsurface at hohndel.org
> http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.hohndel.org/pipermail/subsurface/attachments/20130419/82e6eab7/attachment.html>


More information about the subsurface mailing list