KColorScheme: default to application scheme if set by KColorSchemeManager
authorFrancis Herne <mail@flherne.uk>
Sun, 19 Feb 2017 20:01:38 +0000 (20:01 +0000)
committerMaximiliano Curia <maxy@debian.org>
Fri, 31 Mar 2017 13:26:18 +0000 (14:26 +0100)
commit47f8a5ac507945c17211131294b2241c2f5b446b
treea1ae66b7a416624df26935bcc740b5a4f0a40138
parentaf076bcaf89927cc1c6804780555e70f857f8842
KColorScheme: default to application scheme if set by KColorSchemeManager

KColorSchemeManager::activateScheme() sets a custom path for the
application's color scheme, with
`qApp->setProperty("KDE_COLOR_SCHEME_PATH", index.data(Qt::UserRole));`

Currently, the KColorScheme() and KStatefulBrush() constructors will
 ignore this and use only the system color scheme, unless an
 application-specific config is explicitly loaded and passed in by the
 caller.
This is problematic, because most callers assume that the default is to
 match the *application* scheme - usually this is equivalent, but it
 differs when KColorSchemeManager is used.

For example, when the application of a KTextEditor widget or
 KonsolePart has an opposite color scheme to the system, the Find bars
 are unreadable.
BUG: 373764

This patch makes KColorScheme() match the application scheme by default
 when this differs from the system scheme, which seems preferable to
 adding the same code in hundreds of callers.

Differential Revision: https://phabricator.kde.org/D4637

Gbp-Pq: Name KColorScheme-default-to-application-scheme-if-set-by-KCol.patch
src/kcolorscheme.cpp
src/kcolorscheme.h