color scheme signalling, patch by Andrew Lake

CCMAIL:jamboarder@yahoo.com

svn path=/trunk/KDE/kdebase/workspace/libs/plasma/; revision=779435
This commit is contained in:
Aaron J. Seigo 2008-02-26 05:08:08 +00:00
parent 8379d47abb
commit 450d289094
2 changed files with 9 additions and 0 deletions

View File

@ -30,6 +30,7 @@
#include <KSelectionWatcher> #include <KSelectionWatcher>
#include <KSharedConfig> #include <KSharedConfig>
#include <KStandardDirs> #include <KStandardDirs>
#include <KGlobalSettings>
#include "plasma/packages_p.h" #include "plasma/packages_p.h"
@ -149,6 +150,11 @@ void Theme::compositingChanged()
#endif #endif
} }
void Theme::colorsChanged()
{
emit changed();
}
void Theme::setThemeName(const QString &themeName) void Theme::setThemeName(const QString &themeName)
{ {
QString theme = themeName; QString theme = themeName;
@ -179,8 +185,10 @@ void Theme::setThemeName(const QString &themeName)
QString colorsFile = KStandardDirs::locate("data", "desktoptheme/" + theme + "/colors"); QString colorsFile = KStandardDirs::locate("data", "desktoptheme/" + theme + "/colors");
//kDebug() << "we're going for..." << colorsFile << "*******************"; //kDebug() << "we're going for..." << colorsFile << "*******************";
disconnect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(colorsChanged()));
if (colorsFile.isEmpty()) { if (colorsFile.isEmpty()) {
d->colors = 0; d->colors = 0;
connect(KGlobalSettings::self(), SIGNAL(kdisplayPaletteChanged()), this, SLOT(colorsChanged()));
} else { } else {
d->colors = KSharedConfig::openConfig(colorsFile); d->colors = KSharedConfig::openConfig(colorsFile);
} }

View File

@ -146,6 +146,7 @@ class PLASMA_EXPORT Theme : public QObject
private Q_SLOTS: private Q_SLOTS:
void compositingChanged(); void compositingChanged();
void colorsChanged();
private: private:
class Private; class Private;