author | zecke <zecke> | 2004-02-18 19:10:20 (UTC) |
---|---|---|
committer | zecke <zecke> | 2004-02-18 19:10:20 (UTC) |
commit | 859ad22772e90dfbd4a8c0760ddc52d451f50011 (patch) (unidiff) | |
tree | f5c37a68dd06326703205f665aa193ce16481b6c /library | |
parent | 7d16774139aa40fb812d636bcf9ad3f45aa2b9e1 (diff) | |
download | opie-859ad22772e90dfbd4a8c0760ddc52d451f50011.zip opie-859ad22772e90dfbd4a8c0760ddc52d451f50011.tar.gz opie-859ad22772e90dfbd4a8c0760ddc52d451f50011.tar.bz2 |
Commit the patch to allow overwriting the inline image
-rw-r--r-- | library/resource.cpp | 29 |
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 | |||
@@ -37,4 +37,6 @@ namespace { | |||
37 | } | 37 | } |
38 | 38 | ||
39 | static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET"); | ||
40 | |||
39 | /*! | 41 | /*! |
40 | \class Resource resource.h | 42 | \class Resource resource.h |
@@ -160,12 +162,25 @@ QStringList Resource::allSounds() | |||
160 | static QImage load_image(const QString &name) | 162 | static QImage load_image(const QString &name) |
161 | { | 163 | { |
162 | QImage img = qembed_findImage(name.latin1()); | 164 | if (g_notUseSet ) { |
163 | if ( img.isNull() ) { | 165 | // try file |
164 | // No inlined image, try file | 166 | QImage img; |
165 | QString f = Resource::findPixmap(name); | 167 | QString f = Resource::findPixmap(name); |
166 | if ( !f.isEmpty() ) | 168 | if ( !f.isEmpty() ) |
167 | img.load(f); | 169 | img.load(f); |
170 | if (img.isNull() ) | ||
171 | img = qembed_findImage(name.latin1() ); | ||
172 | return img; | ||
173 | } | ||
174 | else{ | ||
175 | QImage img = qembed_findImage(name.latin1()); | ||
176 | |||
177 | if ( img.isNull() ) { | ||
178 | // No inlined image, try file | ||
179 | QString f = Resource::findPixmap(name); | ||
180 | if ( !f.isEmpty() ) | ||
181 | img.load(f); | ||
182 | } | ||
183 | return img; | ||
168 | } | 184 | } |
169 | return img; | ||
170 | } | 185 | } |
171 | 186 | ||