diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2014-02-17 20:34:09 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2014-02-17 20:34:09 -0800 |
commit | 240e269f19c23c230d1a9c2ee39c062e1508b3d3 (patch) | |
tree | 49577d47cd229d06982d4c91f11ac49516ea95bf /qt-ui | |
parent | 8a4a693cb765538fab169f22d3f74716e6c67e36 (diff) | |
download | subsurface-240e269f19c23c230d1a9c2ee39c062e1508b3d3.tar.gz |
Code cleanup
We called the helper functions way too often.
Whitespace / coding style adjustments.
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui')
-rw-r--r-- | qt-ui/divelistview.cpp | 21 |
1 files changed, 7 insertions, 14 deletions
diff --git a/qt-ui/divelistview.cpp b/qt-ui/divelistview.cpp index c8a5f2b72..7c1eb393f 100644 --- a/qt-ui/divelistview.cpp +++ b/qt-ui/divelistview.cpp @@ -834,33 +834,26 @@ void DiveListView::loadImages() for_each_dive(j, dive){ if (!dive->selected) continue; + // FIXME: this adds the events only to the first DC if (dive->when - 3600 < imagetime && dive->when + dive->duration.seconds + 3600 > imagetime){ if (dive->when > imagetime) { - ; // Before dive + // Before dive add_event(&(dive->dc), 0, 123, 0, 0, fileNames.at(i).toUtf8().data()); - MainWindow::instance()->refreshDisplay(); - mark_divelist_changed(true); - } - else if (dive->when + dive->duration.seconds < imagetime){ - ; // After dive + } else if (dive->when + dive->duration.seconds < imagetime){ + // After dive add_event(&(dive->dc), dive->duration.seconds, 123, 0, 0, fileNames.at(i).toUtf8().data()); - MainWindow::instance()->refreshDisplay(); - mark_divelist_changed(true); - } - else { + } else { add_event(&(dive->dc), imagetime - dive->when, 123, 0, 0, fileNames.at(i).toUtf8().data()); - MainWindow::instance()->refreshDisplay(); - mark_divelist_changed(true); } if (!dive->latitude.udeg && !IS_FP_SAME(exif.GeoLocation.Latitude, 0.0)){ dive->latitude.udeg = lrint(1000000.0 * exif.GeoLocation.Latitude); dive->longitude.udeg = lrint(1000000.0 * exif.GeoLocation.Longitude); - mark_divelist_changed(true); - MainWindow::instance()->refreshDisplay(); } + mark_divelist_changed(true); } } } + MainWindow::instance()->refreshDisplay(); } void DiveListView::uploadToDivelogsDE() |