Changeset View
Changeset View
Standalone View
Standalone View
src/kcolorscheme.cpp
Show First 20 Lines • Show All 246 Lines • ▼ Show 20 Line(s) | |||||
247 | 247 | | |||
248 | static const DecoDefaultColors defaultDecorationColors = { | 248 | static const DecoDefaultColors defaultDecorationColors = { | ||
249 | { 147, 206, 233 }, // Hover | 249 | { 147, 206, 233 }, // Hover | ||
250 | { 61, 174, 233 }, // Focus | 250 | { 61, 174, 233 }, // Focus | ||
251 | }; | 251 | }; | ||
252 | //END default colors | 252 | //END default colors | ||
253 | 253 | | |||
254 | KSharedConfigPtr defaultConfig() { | 254 | KSharedConfigPtr defaultConfig() { | ||
255 | // cache the value we'll return, since usually it's going to be the same value | ||||
256 | static thread_local KSharedConfigPtr config; | ||||
255 | // Read from the application's color scheme file (as set by KColorSchemeManager). | 257 | // Read from the application's color scheme file (as set by KColorSchemeManager). | ||
256 | // If unset, this is equivalent to openConfig() and the system scheme is used. | 258 | // If unset, this is equivalent to openConfig() and the system scheme is used. | ||
257 | return KSharedConfig::openConfig(qApp->property("KDE_COLOR_SCHEME_PATH").toString()); | 259 | const auto colorSchemePath = qApp->property("KDE_COLOR_SCHEME_PATH").toString(); | ||
260 | if (!config || config->name() != colorSchemePath) { | ||||
261 | config = KSharedConfig::openConfig(colorSchemePath); | ||||
262 | } | ||||
263 | return config; | ||||
258 | } | 264 | } | ||
259 | 265 | | |||
260 | //BEGIN KColorSchemePrivate | 266 | //BEGIN KColorSchemePrivate | ||
261 | class KColorSchemePrivate : public QSharedData | 267 | class KColorSchemePrivate : public QSharedData | ||
262 | { | 268 | { | ||
263 | public: | 269 | public: | ||
264 | explicit KColorSchemePrivate(const KSharedConfigPtr &, QPalette::ColorGroup, const char *, const SetDefaultColors &); | 270 | explicit KColorSchemePrivate(const KSharedConfigPtr &, QPalette::ColorGroup, const char *, const SetDefaultColors &); | ||
265 | explicit KColorSchemePrivate(const KSharedConfigPtr &, QPalette::ColorGroup, const char *, const SetDefaultColors &, const QBrush &); | 271 | explicit KColorSchemePrivate(const KSharedConfigPtr &, QPalette::ColorGroup, const char *, const SetDefaultColors &, const QBrush &); | ||
▲ Show 20 Lines • Show All 474 Lines • Show Last 20 Lines |