diff options
author | Armin Berres <armin.berres@basyskom.de> | 2010-08-04 17:13:49 +0200 |
---|---|---|
committer | Sergiy Dubovik <sergiy.dubovik@nokia.com> | 2010-08-05 13:01:58 +0300 |
commit | 2a9c439409f7d51bf39bb1ced184d576f076108c (patch) | |
tree | 5e137714502a66f9bdd69c31a6bc714b3009a44c /src/corelib/theme/mthemedaemon.cpp | |
parent | c8395d15cb4324063e7466b1f4aeeb8c598cbf23 (diff) |
Changes: load pixmaps based on priorities
RevBy: Peter
Details:
So far the themedaemon loads pixmaps based on a first come first
serve base. When a bunch of applications request of lot of pixmaps,
this happens e.g. at startup or during a theme change it is pure
pure chance which item is loaded first. In the worst case an
invisible background application receives its pixmaps before the
forground application.
With this commit all pixmap requests have a priority. The highest
priority have currently visible applications, the lowest one pre-
started ones. Invisible not prestarted applications come in
between. Additionally via a conf file a set of applications be be
specified which have a fixed priority. Right now the forground
app has a priority of 100, sysuid 90, duihome = 80,
meego-im-uiserver 70. This means they will be updated before the
invisible applications which have a priority of 0. Change
themedaemonpriorities.conf if other values are needed.
Diffstat (limited to 'src/corelib/theme/mthemedaemon.cpp')
-rw-r--r-- | src/corelib/theme/mthemedaemon.cpp | 8 |
1 files changed, 2 insertions, 6 deletions
diff --git a/src/corelib/theme/mthemedaemon.cpp b/src/corelib/theme/mthemedaemon.cpp index a9d4ab4a..6dc27dbc 100644 --- a/src/corelib/theme/mthemedaemon.cpp +++ b/src/corelib/theme/mthemedaemon.cpp @@ -242,7 +242,7 @@ const QSettings *themeFile(const QString &theme) } -bool MThemeDaemon::activateTheme(const QString &newTheme, const QString &locale, const QList<MThemeDaemonClient *>& clientList, QHash<MThemeDaemonClient *, QList<PixmapIdentifier> >& pixmapsToReload, QList<QPixmap*>& pixmapsToDelete) +bool MThemeDaemon::activateTheme(const QString &newTheme, const QString &locale, const QList<MThemeDaemonClient *>& clientList, QList<QPixmap*>& pixmapsToDelete) { if (newTheme == currentThemeName) { // TODO: check need for warning @@ -342,14 +342,12 @@ bool MThemeDaemon::activateTheme(const QString &newTheme, const QString &locale, // plus send a packet for all clients, so they can start releasing and requesting new pixmaps, (so the daemon wouldn't need to reload all pixmaps that aren't needed anymore) foreach(MThemeDaemonClient * client, clientList) { - - QList<PixmapIdentifier> pixmapsToBeReloaded; QHash<PixmapIdentifier, ImageResource *>::iterator i; while(!client->pixmaps.isEmpty()) { i = client->pixmaps.begin(); ImageResource* resource = i.value(); PixmapIdentifier id = i.key(); - pixmapsToBeReloaded.append(id); + client->pixmapsToReload.append(id); client->pixmaps.erase(i); if(resource != NULL) { QPixmap* pixmap = resource->releaseWithoutDelete(id.size); @@ -359,8 +357,6 @@ bool MThemeDaemon::activateTheme(const QString &newTheme, const QString &locale, } } - pixmapsToReload.insert(client, pixmapsToBeReloaded); - client->reloadImagePaths(themeInheritance); } |