summaryrefslogtreecommitdiff
authorzecke <zecke>2004-12-30 14:07:11 (UTC)
committer zecke <zecke>2004-12-30 14:07:11 (UTC)
commit8467a23d6a7f4b52619b60462c8ba80d8a736a9e (patch) (side-by-side diff)
treeb2ee7da7ee41cd4b3aab4215cddfcfaebd7c72e0
parente3fa443e845e76707171c6fae79125892a369b75 (diff)
downloadopie-8467a23d6a7f4b52619b60462c8ba80d8a736a9e.zip
opie-8467a23d6a7f4b52619b60462c8ba80d8a736a9e.tar.gz
opie-8467a23d6a7f4b52619b60462c8ba80d8a736a9e.tar.bz2
Remove the 'namespacing' of global and app icons in the PixmapCache
as it didn't utilize the embedded pixmaps anymore. Revert of the last commit
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/resource.cpp33
1 files changed, 4 insertions, 29 deletions
diff --git a/library/resource.cpp b/library/resource.cpp
index 43fdc60..cfa0d26 100644
--- a/library/resource.cpp
+++ b/library/resource.cpp
@@ -63,33 +63,8 @@ QPixmap Resource::loadPixmap( const QString &pix )
{
QPixmap pm;
-
- // Give the pixmaps some kind of namespace in the pixmapcache
- int index = pix.find('/');
- QString appName1 = qApp->argv()[0];
- appName1 = appName1.replace(QRegExp(".*/"),"");
- QString appName2 = pix.left(index);
-
- if ( appName2 == "" || appName2 == pix || appName2 == "icons" )
- appName2 = "Global";
-
- QString appKey1 = "_QPE_" + appName1 + "_" + pix;
- QString appKey2 = "_QPE_" + appName2 + "_" + pix.mid(index+1);
-
- if ( !QPixmapCache::find(appKey1, pm) ) {
- if ( !QPixmapCache::find(appKey2, pm) ) {
- QImage img;
- QString f = findPixmap( pix );
- if ( !f.isEmpty() ) {
- img.load(f);
- if ( !img.isNull() ) {
- pm.convertFromImage(img);
- if ( f.contains(appName1) ) {
- QPixmapCache::insert( appKey1, pm);
- } else {
- QPixmapCache::insert( appKey2, pm);
- }
- }
- }
- }
+ QString key="QPE_"+pix;
+ if ( !QPixmapCache::find(key,pm) ) {
+ pm.convertFromImage(loadImage(pix));
+ QPixmapCache::insert(key,pm);
}
return pm;