Usage of QStringList::contains instead of iterating the list.
>From 55816b141f06fd9a74e5e4ab01e36d9219e75206 Mon Sep 17 00:00:00 2001 From: Patrick Valsecchi <patr...@thus.ch> Date: Thu, 26 Dec 2013 14:59:06 +0100 Subject: [PATCH] Usage of QStringList::contains instead of iterating the list. Signed-off-by: Patrick Valsecchi <patr...@thus.ch> --- qt-ui/globe.cpp | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/qt-ui/globe.cpp b/qt-ui/globe.cpp index 9662d88..bbd1034 100644 --- a/qt-ui/globe.cpp +++ b/qt-ui/globe.cpp @@ -32,14 +32,7 @@ GlobeGPS::GlobeGPS(QWidget* parent) : MarbleWidget(parent), loadedDives(0), edit QStringList list = mtm.mapThemeIds(); QString subsurfaceDataPath; QDir marble; - bool foundGoogleMap = false; - Q_FOREACH(const QString& theme, list){ - if (theme == "earth/googlesat/googlesat.dgml"){ - foundGoogleMap = true; - break; - } - } - if (!foundGoogleMap) { + if (!list.contains("earth/googlesat/googlesat.dgml")) { subsurfaceDataPath = getSubsurfaceDataPath("marbledata"); if (subsurfaceDataPath != "") { MarbleDirs::setMarbleDataPath(subsurfaceDataPath); -- 1.8.3.2
_______________________________________________ subsurface mailing list subsurface@hohndel.org http://lists.hohndel.org/cgi-bin/mailman/listinfo/subsurface