[Marble-commits] KDE/kdeedu/marble/src
Dennis Nienhüser
earthwings at gentoo.org
Thu Apr 22 19:32:19 CEST 2010
SVN commit 1117648 by nienhueser:
Use an ordered list of fallback themes: srtm, bluemarble, openstreetmap.
M +17 -5 ControlView.cpp
--- trunk/KDE/kdeedu/marble/src/ControlView.cpp #1117647:1117648
@@ -127,16 +127,28 @@
QString ControlView::defaultMapThemeId() const
{
+ QStringList fallBackThemes;
+ fallBackThemes << "earth/srtm/srtm.dgml";
+ fallBackThemes << "earth/bluemarble/bluemarble.dgml";
+ fallBackThemes << "earth/openstreetmap/openstreetmap.dgml";
+
+ QStringList installedThemes;
QList<GeoSceneDocument const*> themes = m_mapThemeManager->mapThemes();
- QString result;
foreach(GeoSceneDocument const* theme, themes) {
- result = theme->head()->mapThemeId();
- if ( result == "earth/srtm/srtm.dgml" ) {
- return result;
+ installedThemes << theme->head()->mapThemeId();
+ }
+
+ foreach(const QString &fallback, fallBackThemes) {
+ if (installedThemes.contains(fallback)) {
+ return fallback;
}
}
- return result;
+ if (installedThemes.size()) {
+ return installedThemes.first();
+ }
+
+ return QString();
}
}
More information about the Marble-commits
mailing list