Port theme away from KGlobalSettings
This commit is contained in:
parent
18c12fb520
commit
c244c5a24a
@ -539,11 +539,13 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
|
||||
|
||||
if (colorsFile.isEmpty()) {
|
||||
colors = 0;
|
||||
// QObject::connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||
// this, SLOT(colorsChanged()), Qt::UniqueConnection);
|
||||
if (qApp) {
|
||||
installEventFilter(qApp);
|
||||
}
|
||||
} else {
|
||||
// QObject::disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()),
|
||||
// this, SLOT(colorsChanged()));
|
||||
if (qApp) {
|
||||
removeEventFilter(qApp);
|
||||
}
|
||||
colors = KSharedConfig::openConfig(colorsFile);
|
||||
}
|
||||
|
||||
@ -567,6 +569,16 @@ void ThemePrivate::setThemeName(const QString &tempThemeName, bool writeSettings
|
||||
scheduleThemeChangeNotification(SvgElementsCache);
|
||||
}
|
||||
|
||||
bool ThemePrivate::eventFilter(QObject *watched, QEvent *event)
|
||||
{
|
||||
if (watched == QCoreApplication::instance()) {
|
||||
if (event->type() == QEvent::ApplicationPaletteChange) {
|
||||
colorsChanged();
|
||||
}
|
||||
}
|
||||
return QObject::eventFilter(watched, event);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
#include "moc_theme_p.cpp"
|
||||
|
@ -115,6 +115,7 @@ public:
|
||||
KColorScheme colorScheme;
|
||||
KColorScheme buttonColorScheme;
|
||||
KColorScheme viewColorScheme;
|
||||
bool eventFilter(QObject *watched, QEvent *event);
|
||||
KConfigGroup cfg;
|
||||
QString defaultWallpaperTheme;
|
||||
QString defaultWallpaperSuffix;
|
||||
|
Loading…
Reference in New Issue
Block a user