summaryrefslogtreecommitdiff
authorzecke <zecke>2004-02-18 19:10:20 (UTC)
committer zecke <zecke>2004-02-18 19:10:20 (UTC)
commit859ad22772e90dfbd4a8c0760ddc52d451f50011 (patch) (side-by-side diff)
treef5c37a68dd06326703205f665aa193ce16481b6c
parent7d16774139aa40fb812d636bcf9ad3f45aa2b9e1 (diff)
downloadopie-859ad22772e90dfbd4a8c0760ddc52d451f50011.zip
opie-859ad22772e90dfbd4a8c0760ddc52d451f50011.tar.gz
opie-859ad22772e90dfbd4a8c0760ddc52d451f50011.tar.bz2
Commit the patch to allow overwriting the inline image
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--library/resource.cpp29
1 files changed, 22 insertions, 7 deletions
diff --git a/library/resource.cpp b/library/resource.cpp
index 4108883..f70658d 100644
--- a/library/resource.cpp
+++ b/library/resource.cpp
@@ -33,12 +33,14 @@
// inlinepics_p.h
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.
The resources may be provided from files or other sources.
@@ -156,20 +158,33 @@ QStringList Resource::allSounds()
result.append((*i).replace(QRegExp("\\.wav"),""));
return result;
}
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;
}
/*!
Returns the QImage called \a name. You should avoid including
any filename type extension (e.g. .png, .xpm).
*/