mirror of
https://github.com/subsurface/subsurface.git
synced 2025-01-19 22:35:27 +00:00
Rework foreach for a faster iteration.
The old code used a QString instead of a const QString&, wich mean that each foreach step the string was copied. added a break on the if-found-true to stop the foreach, since we already found it. Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org> Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
parent
03a01efdcb
commit
6925d13aa4
1 changed files with 6 additions and 3 deletions
|
@ -30,12 +30,15 @@ GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0), edit
|
|||
// if not, check if they are in a known location
|
||||
MapThemeManager mtm;
|
||||
QStringList list = mtm.mapThemeIds();
|
||||
QString theme, subsurfaceDataPath;
|
||||
QString subsurfaceDataPath;
|
||||
QDir marble;
|
||||
bool foundGoogleMap = false;
|
||||
Q_FOREACH(theme, list)
|
||||
if (theme == "earth/googlesat/googlesat.dgml")
|
||||
Q_FOREACH(const QString& theme, list){
|
||||
if (theme == "earth/googlesat/googlesat.dgml"){
|
||||
foundGoogleMap = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!foundGoogleMap) {
|
||||
subsurfaceDataPath = getSubsurfaceDataPath("marbledata");
|
||||
if (subsurfaceDataPath != "") {
|
||||
|
|
Loading…
Add table
Reference in a new issue