From 859ad22772e90dfbd4a8c0760ddc52d451f50011 Mon Sep 17 00:00:00 2001 From: zecke Date: Wed, 18 Feb 2004 19:10:20 +0000 Subject: Commit the patch to allow overwriting the inline image --- (limited to 'library/resource.cpp') diff --git a/library/resource.cpp b/library/resource.cpp index 4108883..f70658d 100644 --- a/library/resource.cpp +++ b/library/resource.cpp @@ -36,6 +36,8 @@ namespace { #include "inlinepics_p.h" } +static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET"); + /*! \class Resource resource.h \brief The Resource class provides access to named resources. @@ -159,14 +161,27 @@ QStringList Resource::allSounds() static QImage load_image(const QString &name) { - QImage img = qembed_findImage(name.latin1()); - if ( img.isNull() ) { - // No inlined image, try file - QString f = Resource::findPixmap(name); - if ( !f.isEmpty() ) - img.load(f); + if (g_notUseSet ) { + // try file + QImage img; + QString f = Resource::findPixmap(name); + if ( !f.isEmpty() ) + img.load(f); + if (img.isNull() ) + img = qembed_findImage(name.latin1() ); + return img; + } + else{ + QImage img = qembed_findImage(name.latin1()); + + if ( img.isNull() ) { + // No inlined image, try file + QString f = Resource::findPixmap(name); + if ( !f.isEmpty() ) + img.load(f); + } + return img; } - return img; } /*! -- cgit v0.9.0.2