summaryrefslogtreecommitdiff
path: root/library/resource.cpp
Unidiff
Diffstat (limited to 'library/resource.cpp') (more/less context) (show whitespace changes)
-rw-r--r--library/resource.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/library/resource.cpp b/library/resource.cpp
index cfa0d26..b31876f 100644
--- a/library/resource.cpp
+++ b/library/resource.cpp
@@ -60,12 +60,18 @@ static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET");
60 any filename type extension (e.g. .png, .xpm). 60 any filename type extension (e.g. .png, .xpm).
61*/ 61*/
62#include <stdio.h>
62QPixmap Resource::loadPixmap( const QString &pix ) 63QPixmap Resource::loadPixmap( const QString &pix )
63{ 64{
64 QPixmap pm; 65 QPixmap pm; // null pixmap
65 QString key="QPE_"+pix; 66 QString key="QPE_"+pix;
66 if ( !QPixmapCache::find(key,pm) ) { 67 if ( !QPixmapCache::find(key,pm) ) {
67 pm.convertFromImage(loadImage(pix)); 68 QImage I = loadImage(pix);
69 if( I.isNull() ) {
70 qWarning( "Could not load %s", pix.latin1() );
71 } else {
72 pm.convertFromImage(I);
68 QPixmapCache::insert(key,pm); 73 QPixmapCache::insert(key,pm);
69 } 74 }
75 }
70 return pm; 76 return pm;
71} 77}
@@ -102,5 +108,4 @@ QString Resource::findPixmap( const QString &pix )
102 return f; 108 return f;
103 109
104
105 // All formats... 110 // All formats...
106 QStrList fileFormats = QImageIO::inputFormats(); 111 QStrList fileFormats = QImageIO::inputFormats();