controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp
changeset 15 cc79acdc26cb
parent 14 23411a3be0db
child 17 4a9568303383
equal deleted inserted replaced
14:23411a3be0db 15:cc79acdc26cb
    36 #if !defined(Q_OS_SYMBIAN)
    36 #if !defined(Q_OS_SYMBIAN)
    37     #include <stdio.h>
    37     #include <stdio.h>
    38     static const char* KThemePathKey = "HB_THEMES_DIR";
    38     static const char* KThemePathKey = "HB_THEMES_DIR";
    39 #endif
    39 #endif
    40 
    40 
    41     static const QString KDefaultTheme = "hbdefault";
    41     static const QString KDefaultTheme = "hbdefault";   
    42     static const char* KSettingsCategory = "currenttheme";
       
    43    
       
    44 }
    42 }
    45 
    43 
    46 CpThemeChangerPrivate::CpThemeChangerPrivate(CpThemeChanger* qq):
    44 CpThemeChangerPrivate::CpThemeChangerPrivate(CpThemeChanger* qq):
    47     q_ptr(qq),
    45     q_ptr(qq),
    48     themeClient(CpThemeClient::global()),
    46     themeClient(CpThemeClient::global()),
    75     themeRootPath = "c:\\resource\\hb";
    73     themeRootPath = "c:\\resource\\hb";
    76     themeRootPathPostfix = QString();
    74     themeRootPathPostfix = QString();
    77     #endif
    75     #endif
    78 
    76 
    79     // Get our current state
    77     // Get our current state
    80     QSettings settings(QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT));
    78     if (HbInstance::instance()) {
    81     mCurrentTheme.name = settings.value(KSettingsCategory).toString();
    79         HbTheme *hbTheme = HbInstance::instance()->theme();
       
    80         if (hbTheme) {
       
    81             mCurrentTheme.name = hbTheme->name();
       
    82         }
       
    83     }
    82     updateThemeList(mCurrentTheme.name);
    84     updateThemeList(mCurrentTheme.name);
    83 
    85 
    84     // Watch for changes to the theme directory in flash.
    86     // Watch for changes to the theme directory in flash.
    85     // This may change once we start offering a model.
    87     // This may change once we start offering a model.
    86     fileWatcher->addPath(themeRootPath+"/themes/");
    88     fileWatcher->addPath(themeRootPath+"/themes/");