Changeset View
Changeset View
Standalone View
Standalone View
decorations/decorationpalette.cpp
Show All 35 Lines | |||||
36 | namespace Decoration | 36 | namespace Decoration | ||
37 | { | 37 | { | ||
38 | 38 | | |||
39 | DecorationPalette::DecorationPalette(const QString &colorScheme) | 39 | DecorationPalette::DecorationPalette(const QString &colorScheme) | ||
40 | : m_colorScheme(QFileInfo(colorScheme).isAbsolute() | 40 | : m_colorScheme(QFileInfo(colorScheme).isAbsolute() | ||
41 | ? colorScheme | 41 | ? colorScheme | ||
42 | : QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme)) | 42 | : QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme)) | ||
43 | { | 43 | { | ||
44 | if (m_colorScheme.isEmpty() && colorScheme == QStringLiteral("kdeglobals")) { | 44 | if (!m_colorScheme.startsWith(QStandardPaths::writableLocation(QStandardPaths::GenericConfigLocation)) && colorScheme == QStringLiteral("kdeglobals")) { | ||
45 | // kdeglobals doesn't exist so create it. This is needed to monitor it using QFileSystemWatcher. | 45 | // kdeglobals doesn't exist so create it. This is needed to monitor it using QFileSystemWatcher. | ||
46 | auto config = KSharedConfig::openConfig(colorScheme, KConfig::SimpleConfig); | 46 | auto config = KSharedConfig::openConfig(colorScheme, KConfig::SimpleConfig); | ||
47 | KConfigGroup wmConfig(config, QStringLiteral("WM")); | 47 | KConfigGroup wmConfig(config, QStringLiteral("WM")); | ||
48 | wmConfig.writeEntry("FakeEntryToKeepThisGroup", true); | 48 | wmConfig.writeEntry("FakeEntryToKeepThisGroup", true); | ||
49 | config->sync(); | 49 | config->sync(); | ||
50 | 50 | | |||
51 | m_colorScheme = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme); | 51 | m_colorScheme = QStandardPaths::locate(QStandardPaths::GenericConfigLocation, colorScheme); | ||
52 | } | 52 | } | ||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |