summaryrefslogtreecommitdiffstats
path: root/qt-ui/globe.cpp
diff options
context:
space:
mode:
authorGravatar Tomaz Canabrava <tcanabrava@kde.org>2013-12-02 17:15:40 -0200
committerGravatar Dirk Hohndel <dirk@hohndel.org>2013-12-02 11:40:39 -0800
commit7481746d91212dff97233245c77db78f54e25f24 (patch)
tree9bd03f8e10ab5dd0ea3a0b5fca584d9046592d8e /qt-ui/globe.cpp
parent768cab66ccdf4e2619b7c143638e85dce43592e1 (diff)
downloadsubsurface-7481746d91212dff97233245c77db78f54e25f24.tar.gz
Huge speedup when selecting Dives from the Globe View.
The old code ( slow++ ) ignored that each new dive-selection we recreated all information on the profile window, so this version ( a lot more verbose, I know. ) will ignore all dives that are being selected and will only send the 'dive was selected' information in the last line of the algorithm, instead of calling it for each dive on the list of 'to be selected' dives. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
Diffstat (limited to 'qt-ui/globe.cpp')
-rw-r--r--qt-ui/globe.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp
index c149bda74..c39723dc3 100644
--- a/qt-ui/globe.cpp
+++ b/qt-ui/globe.cpp
@@ -135,6 +135,7 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
bool clear = !(QApplication::keyboardModifiers() && Qt::ControlModifier);
bool toggle = !clear;
bool first = true;
+ QList<int> selectedDiveIds;
for_each_dive(idx, dive) {
long lat_diff, lon_diff;
if (!dive_has_gps_location(dive))
@@ -152,9 +153,10 @@ void GlobeGPS::mouseClicked(qreal lon, qreal lat, GeoDataCoordinates::Unit unit)
mainWindow()->dive_list()->unselectDives();
clear = false;
}
- mainWindow()->dive_list()->selectDive(idx, first, toggle);
+ selectedDiveIds.push_back(idx);
first = false;
}
+ mainWindow()->dive_list()->selectDives(selectedDiveIds);
}
void GlobeGPS::repopulateLabels()