[Marble-commits] KDE/kdeedu/marble/src/lib
Jens-Michael Hoffmann
jensmh at gmx.de
Wed Apr 14 20:37:36 CEST 2010
SVN commit 1114850 by jmhoffmann:
ViewParams: propagate global settings to local settings on map theme change.
M +21 -0 ViewParams.cpp
--- trunk/KDE/kdeedu/marble/src/lib/ViewParams.cpp #1114849:1114850
@@ -68,6 +68,7 @@
QImage *m_coastImage; // A slightly higher level image.
void initGlobalSettings();
+ void propagateGlobalToLocalSettings();
};
ViewParamsPrivate::ViewParamsPrivate()
@@ -100,7 +101,26 @@
m_globalSettings.addProperty( showClouds );
}
+void ViewParamsPrivate::propagateGlobalToLocalSettings()
+{
+ bool showClouds = false;
+ bool const propertyFound = m_globalSettings.propertyValue( showCloudsPropertyName, showClouds );
+ if ( propertyFound ) {
+ if ( !m_mapTheme )
+ return;
+ GeoSceneSettings * const settings = m_mapTheme->settings();
+ if ( !settings )
+ return;
+
+ GeoSceneGroup * const textureLayerSettings = settings->group( "Texture Layers" );
+ if ( !textureLayerSettings )
+ return;
+ textureLayerSettings->setPropertyValue( cloudsLayerName, showClouds );
+ }
+}
+
+
ViewParams::ViewParams()
: d( new ViewParamsPrivate )
{
@@ -173,6 +193,7 @@
}
d->m_mapTheme = mapTheme;
+ d->propagateGlobalToLocalSettings();
}
GeoSceneDocument *ViewParams::mapTheme()
More information about the Marble-commits
mailing list