summaryrefslogtreecommitdiff
path: root/library/resource.cpp
Unidiff
Diffstat (limited to 'library/resource.cpp') (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 @@
33// inlinepics_p.h 33// inlinepics_p.h
34 34
35namespace { 35namespace {
36#include "inlinepics_p.h" 36#include "inlinepics_p.h"
37} 37}
38 38
39static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET");
40
39/*! 41/*!
40 \class Resource resource.h 42 \class Resource resource.h
41 \brief The Resource class provides access to named resources. 43 \brief The Resource class provides access to named resources.
42 44
43 The resources may be provided from files or other sources. 45 The resources may be provided from files or other sources.
44 46
@@ -156,20 +158,33 @@ QStringList Resource::allSounds()
156 result.append((*i).replace(QRegExp("\\.wav"),"")); 158 result.append((*i).replace(QRegExp("\\.wav"),""));
157 return result; 159 return result;
158} 160}
159 161
160static QImage load_image(const QString &name) 162static 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
172/*! 187/*!
173 Returns the QImage called \a name. You should avoid including 188 Returns the QImage called \a name. You should avoid including
174 any filename type extension (e.g. .png, .xpm). 189 any filename type extension (e.g. .png, .xpm).
175*/ 190*/