[Svg] Don't reparse configuration in response to Theme::applicationPaletteChanged

Plasma::Theme emits the applicationPaletteChanged signal after it has fetched the
colors from KColorScheme and scheduled the caches to be nuked. There's no need to do
the same exact thing from every single Svg out there.

This speeds up Plasma picking up color scheme changes significantly and is now
on a par with other opened applications.

REVIEW: 127426
This commit is contained in:
Kai Uwe Broulik 2016-03-20 11:30:58 +01:00
parent 28b4400da8
commit bd354ecf70
2 changed files with 2 additions and 12 deletions

View File

@ -360,7 +360,7 @@ void ThemePrivate::colorsChanged()
colorScheme = KColorScheme(QPalette::Active, KColorScheme::Window, colors);
buttonColorScheme = KColorScheme(QPalette::Active, KColorScheme::Button, colors);
viewColorScheme = KColorScheme(QPalette::Active, KColorScheme::View, colors);
scheduleThemeChangeNotification(PixmapCache);
scheduleThemeChangeNotification(PixmapCache | SvgElementsCache);
emit applicationPaletteChange();
}

View File

@ -672,17 +672,7 @@ void SvgPrivate::colorsChanged()
}
eraseRenderer();
//qCDebug(LOG_PLASMA) << "repaint needed from colorsChanged";
// in the case the theme follows the desktop settings, refetch the colorschemes
// and discard the svg pixmap cache
if (!theme.data()->d->colors) {
KSharedConfig::openConfig()->reparseConfiguration();
theme.data()->d->colorScheme = KColorScheme(QPalette::Active, KColorScheme::Window);
theme.data()->d->buttonColorScheme = KColorScheme(QPalette::Active, KColorScheme::Button);
theme.data()->d->viewColorScheme = KColorScheme(QPalette::Active, KColorScheme::View);
theme.data()->d->discardCache(PixmapCache | SvgElementsCache);
}
qCDebug(LOG_PLASMA) << "repaint needed from colorsChanged";
emit q->repaintNeeded();
}