Change in plasma-framework[master]: Save SVGs only when a theme is unloaded, not on each theme p...
David Edmundson (Code Review)
noreply at kde.org
Thu Dec 11 01:00:04 UTC 2014
David Edmundson has uploaded a new change for review.
https://gerrit.vesnicky.cesnet.cz/r/215
Change subject: Save SVGs only when a theme is unloaded, not on each theme proxy
......................................................................
Save SVGs only when a theme is unloaded, not on each theme proxy
A single Plasma theme will be represented by one ThemePrivate object,
which is exported in multiple Theme objects.
We want to save the cache when that theme stops being used, not each
time an item stops using the theme.
saveSvgElementsCache calls sync() which involves a lot of parsing and
IO. This makes everything a lot faster at no cost.
Change-Id: Ica6ba0273bc99fb8ad8733a1c90db8f1e87c49ea
---
M src/plasma/private/theme_p.cpp
M src/plasma/theme.cpp
2 files changed, 3 insertions(+), 4 deletions(-)
git pull ssh://gerrit.vesnicky.cesnet.cz:29418/plasma-framework refs/changes/15/215/1
diff --git a/src/plasma/private/theme_p.cpp b/src/plasma/private/theme_p.cpp
index b9c2a55..1963f74 100644
--- a/src/plasma/private/theme_p.cpp
+++ b/src/plasma/private/theme_p.cpp
@@ -115,7 +115,8 @@
ThemePrivate::~ThemePrivate()
{
- if (FrameSvgPrivate::s_sharedFrames.contains(this)) {
+ saveSvgElementsCache();
+ if (FrameSvgPrivate::s_sharedFrames.contains(this)) {
foreach (FrameData *data, FrameSvgPrivate::s_sharedFrames[this].values()) {
delete data;
}
@@ -633,7 +634,7 @@
break;
}
}
-
+
switch (role) {
diff --git a/src/plasma/theme.cpp b/src/plasma/theme.cpp
index ba4e9e8..18d4ed6 100644
--- a/src/plasma/theme.cpp
+++ b/src/plasma/theme.cpp
@@ -91,8 +91,6 @@
Theme::~Theme()
{
- d->saveSvgElementsCache();
-
if (d == ThemePrivate::globalTheme) {
if (!ThemePrivate::globalThemeRefCount.deref()) {
disconnect(ThemePrivate::globalTheme, 0, this, 0);
--
To view, visit https://gerrit.vesnicky.cesnet.cz/r/215
To unsubscribe, visit https://gerrit.vesnicky.cesnet.cz/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica6ba0273bc99fb8ad8733a1c90db8f1e87c49ea
Gerrit-PatchSet: 1
Gerrit-Project: plasma-framework
Gerrit-Branch: master
Gerrit-Owner: David Edmundson <david at davidedmundson.co.uk>
Gerrit-Reviewer: Aaron J. Seigo <aseigo at kde.org>
Gerrit-Reviewer: Marco Martin <notmart at gmail.com>
More information about the Plasma-devel
mailing list