remove the ThemePrivate singleton
This commit is contained in:
parent
2006df44cc
commit
fe9ebd86a8
@ -46,25 +46,6 @@ QHash<QString, ThemePrivate *> ThemePrivate::themes = QHash<QString, ThemePrivat
|
||||
QHash<QString, int> ThemePrivate::themesRefCount = QHash<QString, int>();
|
||||
|
||||
|
||||
class ThemePrivateSingleton
|
||||
{
|
||||
public:
|
||||
ThemePrivateSingleton()
|
||||
{
|
||||
self.isDefault = true;
|
||||
|
||||
//FIXME: if/when kconfig gets change notification, this will be unnecessary
|
||||
KDirWatch::self()->addFile(QStandardPaths::writableLocation(QStandardPaths::ConfigLocation) + QLatin1Char('/') + ThemePrivate::themeRcFile);
|
||||
QObject::connect(KDirWatch::self(), SIGNAL(created(QString)), &self, SLOT(settingsFileChanged(QString)));
|
||||
QObject::connect(KDirWatch::self(), SIGNAL(dirty(QString)), &self, SLOT(settingsFileChanged(QString)));
|
||||
}
|
||||
|
||||
ThemePrivate self;
|
||||
};
|
||||
|
||||
Q_GLOBAL_STATIC(ThemePrivateSingleton, themePrivateSelf)
|
||||
|
||||
|
||||
ThemePrivate::ThemePrivate(QObject *parent)
|
||||
: QObject(parent),
|
||||
colorScheme(QPalette::Active, KColorScheme::Window, KSharedConfigPtr(0)),
|
||||
@ -114,11 +95,6 @@ ThemePrivate::~ThemePrivate()
|
||||
delete pixmapCache;
|
||||
}
|
||||
|
||||
ThemePrivate *ThemePrivate::self()
|
||||
{
|
||||
return &themePrivateSelf()->self;
|
||||
}
|
||||
|
||||
KConfigGroup &ThemePrivate::config()
|
||||
{
|
||||
if (!cfg.isValid()) {
|
||||
|
@ -68,8 +68,6 @@ public:
|
||||
ThemePrivate(QObject *parent = 0);
|
||||
~ThemePrivate();
|
||||
|
||||
static ThemePrivate *self();
|
||||
|
||||
KConfigGroup &config();
|
||||
|
||||
QString findInTheme(const QString &image, const QString &theme, bool cache = true);
|
||||
|
@ -73,8 +73,7 @@ Theme *Theme::defaultTheme()
|
||||
}
|
||||
|
||||
Theme::Theme(QObject *parent)
|
||||
: QObject(parent),
|
||||
d(ThemePrivate::self())
|
||||
: QObject(parent)
|
||||
{
|
||||
if (!ThemePrivate::globalTheme) {
|
||||
ThemePrivate::globalTheme = new ThemePrivate;
|
||||
|
Loading…
x
Reference in New Issue
Block a user