diff --git a/shell/main.cpp b/shell/main.cpp index 119455734..ad87266de 100644 --- a/shell/main.cpp +++ b/shell/main.cpp @@ -132,8 +132,7 @@ int main(int argc, char *argv[]) if (cliOptions.isSet(standaloneOption) && cliOptions.isSet(shellPluginOption)) { ShellManager::s_standaloneOption = true; app.setApplicationName("plasmashell_"+cliOptions.value(shellPluginOption)); - Plasma::Theme theme; - theme.setUseGlobalSettings(false); + KDBusService service(KDBusService::Unique); StandaloneAppCorona corona(cliOptions.value(shellPluginOption)); return app.exec(); diff --git a/shell/shellcorona.cpp b/shell/shellcorona.cpp index c6bdbe55f..41056ed4b 100644 --- a/shell/shellcorona.cpp +++ b/shell/shellcorona.cpp @@ -124,28 +124,6 @@ ShellCorona::ShellCorona(QObject *parent) saveLayout(); }); - const QString themeGroupKey = QStringLiteral("Theme"); - const QString themeNameKey = QStringLiteral("name"); - - QString themeName; - - KConfigGroup plasmarc(KSharedConfig::openConfig("plasmarc"), themeGroupKey); - themeName = plasmarc.readEntry(themeNameKey, themeName); - - if (themeName.isEmpty()) { - KConfigGroup lnfCfg = KConfigGroup(KSharedConfig::openConfig( - m_lookAndFeelPackage.filePath("defaults")), - "plasmarc" - ); - lnfCfg = KConfigGroup(&lnfCfg, themeGroupKey); - themeName = lnfCfg.readEntry(themeNameKey, themeName); - } - - if (!themeName.isEmpty()) { - Plasma::Theme *t = new Plasma::Theme(this); - t->setThemeName(themeName); - } - connect(this, &ShellCorona::containmentAdded, this, &ShellCorona::handleContainmentAdded); @@ -208,6 +186,31 @@ void ShellCorona::setShell(const QString &shell) setPackage(package); m_desktopDefaultsConfig = KConfigGroup(KSharedConfig::openConfig(package.filePath("defaults")), "Desktop"); + const QString themeGroupKey = QStringLiteral("Theme"); + const QString themeNameKey = QStringLiteral("name"); + + QString themeName; + + KConfigGroup plasmarc(KSharedConfig::openConfig("plasmarc"), themeGroupKey); + themeName = plasmarc.readEntry(themeNameKey, themeName); + + if (themeName.isEmpty()) { + KConfigGroup shellCfg = KConfigGroup(KSharedConfig::openConfig(package.filePath("defaults")), "Theme"); + + themeName = shellCfg.readEntry("name", "default"); + KConfigGroup lnfCfg = KConfigGroup(KSharedConfig::openConfig( + m_lookAndFeelPackage.filePath("defaults")), + "plasmarc" + ); + lnfCfg = KConfigGroup(&lnfCfg, themeGroupKey); + themeName = lnfCfg.readEntry(themeNameKey, themeName); + } + + if (!themeName.isEmpty()) { + Plasma::Theme *t = new Plasma::Theme(this); + t->setThemeName(themeName); + } + //FIXME: this would change the runtime platform to a fixed one if available // but a different way to load platform specific components is needed beforehand // because if we import and use two different components plugin, the second time diff --git a/shell/standaloneappcorona.cpp b/shell/standaloneappcorona.cpp index ad82c83c0..373d629a5 100644 --- a/shell/standaloneappcorona.cpp +++ b/shell/standaloneappcorona.cpp @@ -44,6 +44,12 @@ StandaloneAppCorona::StandaloneAppCorona(const QString &coronaPlugin, QObject *p package.setPath(m_coronaPlugin); setPackage(package); + Plasma::Theme theme; + theme.setUseGlobalSettings(false); + + KConfigGroup lnfCfg = KConfigGroup(KSharedConfig::openConfig(package.filePath("defaults")), "Theme"); + theme.setThemeName(lnfCfg.readEntry("name", "default")); + m_desktopDefaultsConfig = KConfigGroup(KSharedConfig::openConfig(package.filePath("defaults")), "Desktop"); connect(m_activityConsumer, SIGNAL(currentActivityChanged(QString)), this, SLOT(currentActivityChanged(QString)));