controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp
changeset 15 cc79acdc26cb
parent 14 23411a3be0db
child 17 4a9568303383
--- a/controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp	Fri May 14 15:53:07 2010 +0300
+++ b/controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp	Thu May 27 12:52:25 2010 +0300
@@ -38,9 +38,7 @@
     static const char* KThemePathKey = "HB_THEMES_DIR";
 #endif
 
-    static const QString KDefaultTheme = "hbdefault";
-    static const char* KSettingsCategory = "currenttheme";
-   
+    static const QString KDefaultTheme = "hbdefault";   
 }
 
 CpThemeChangerPrivate::CpThemeChangerPrivate(CpThemeChanger* qq):
@@ -77,8 +75,12 @@
     #endif
 
     // Get our current state
-    QSettings settings(QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT));
-    mCurrentTheme.name = settings.value(KSettingsCategory).toString();
+    if (HbInstance::instance()) {
+        HbTheme *hbTheme = HbInstance::instance()->theme();
+        if (hbTheme) {
+            mCurrentTheme.name = hbTheme->name();
+        }
+    }
     updateThemeList(mCurrentTheme.name);
 
     // Watch for changes to the theme directory in flash.