summaryrefslogtreecommitdiff
path: root/library/resource.cpp
authorwimpie <wimpie>2005-01-09 02:59:13 (UTC)
committer wimpie <wimpie>2005-01-09 02:59:13 (UTC)
commit987bc9a2c5b39ddd4dc2a665cea65688bfd2179e (patch) (side-by-side diff)
tree815fc6d12162f1a5eccc4b1ae0da61dea3811bdf /library/resource.cpp
parente54346d28b19d3ac671802a25e8c03f346693291 (diff)
downloadopie-987bc9a2c5b39ddd4dc2a665cea65688bfd2179e.zip
opie-987bc9a2c5b39ddd4dc2a665cea65688bfd2179e.tar.gz
opie-987bc9a2c5b39ddd4dc2a665cea65688bfd2179e.tar.bz2
applnk : lazy loading of mime type icons (load only when needed)
resource.cpp : print warning when requested image cannot be found and print the name of that image too
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
@@ -61,10 +61,16 @@ static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET");
*/
+#include <stdio.h>
QPixmap Resource::loadPixmap( const QString &pix )
{
- QPixmap pm;
+ QPixmap pm; // null pixmap
QString key="QPE_"+pix;
if ( !QPixmapCache::find(key,pm) ) {
- pm.convertFromImage(loadImage(pix));
+ QImage I = loadImage(pix);
+ if( I.isNull() ) {
+ qWarning( "Could not load %s", pix.latin1() );
+ } else {
+ pm.convertFromImage(I);
QPixmapCache::insert(key,pm);
}
+ }
return pm;
@@ -103,3 +109,2 @@ QString Resource::findPixmap( const QString &pix )
-
// All formats...