take theme name also from the shell package if avail

the look and feel package still wins.
tough for applications is the shell that sets it
wilder-5.14
Marco Martin 12 years ago
parent 8b8dfa52da
commit ad31939ebf
  1. 3
      shell/main.cpp
  2. 47
      shell/shellcorona.cpp
  3. 6
      shell/standaloneappcorona.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();

@ -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

@ -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)));

Loading…
Cancel
Save