From 240e269f19c23c230d1a9c2ee39c062e1508b3d3 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 17 Feb 2014 20:34:09 -0800 Subject: [PATCH] Code cleanup We called the helper functions way too often. Whitespace / coding style adjustments. Signed-off-by: Dirk Hohndel --- qt-ui/divelistview.cpp | 21 +++++++-------------- 1 file 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()