-rw-r--r-- | ChangeLog | 3 | ||||
-rw-r--r-- | Rules.make | 3 | ||||
-rw-r--r-- | config.in | 4 | ||||
-rw-r--r-- | library/resource.cpp | 34 |
4 files changed, 38 insertions, 6 deletions
@@ -23,10 +23,11 @@ | |||
23 | * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw) | 23 | * n.a. - PackageManager - fixed where last package in status file was not shown as installed when it should be (drw) |
24 | 24 | ||
25 | Internal | 25 | Internal |
26 | -------- | 26 | -------- |
27 | * Work around bug in Qt/Embedded 2.3.10: qt_version() returns 231 (mickeyl) | 27 | * Worked around bug in Qt/Embedded 2.3.10: qt_version() returns 231 (mickeyl) |
28 | * Killed the need for weak symbols in QtE (zecke) | 28 | * Killed the need for weak symbols in QtE (zecke) |
29 | * Added optional building libqpe without inline images (mickeyl) | ||
29 | 30 | ||
30 | 2005-02-03Opie 1.1.9 | 31 | 2005-02-03Opie 1.1.9 |
31 | 32 | ||
32 | New Features | 33 | New Features |
@@ -59,8 +59,11 @@ ifeq ($(CONFIG_OPIELOGIN_USEPAM),y) | |||
59 | endif | 59 | endif |
60 | ifeq ($(CONFIG_LIBQPE_WITHROHFEEDBACK),y) | 60 | ifeq ($(CONFIG_LIBQPE_WITHROHFEEDBACK),y) |
61 | echo CONFIG += LIBQPE_WITHROHFEEDBACK >> $@ | 61 | echo CONFIG += LIBQPE_WITHROHFEEDBACK >> $@ |
62 | endif | 62 | endif |
63 | ifeq ($(CONFIG_LIBQPE_NO_INLINE_IMAGES),y) | ||
64 | echo DEFINES += LIBQPE_NO_INLINE_IMAGES >> $@ | ||
65 | endif | ||
63 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y) | 66 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_SHUTDOWN),y) |
64 | echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@ | 67 | echo DEFINES += OPIE_NO_BUILTIN_SHUTDOWN >> $@ |
65 | endif | 68 | endif |
66 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) | 69 | ifeq ($(CONFIG_OPIE_NO_BUILTIN_CALIBRATE),y) |
@@ -169,8 +169,12 @@ config OPIE_TASKBAR_LOCK_KEY_STATE | |||
169 | config LIBQPE_WITHROHFEEDBACK | 169 | config LIBQPE_WITHROHFEEDBACK |
170 | boolean "Build libqpe with Right-On-Hold feedback" | 170 | boolean "Build libqpe with Right-On-Hold feedback" |
171 | default y | 171 | default y |
172 | 172 | ||
173 | config LIBQPE_NO_INLINE_IMAGES | ||
174 | boolean "Build libqpe without inline images" | ||
175 | default y | ||
176 | |||
173 | config OPIE_NO_SOUND_PCM_READ_BITS | 177 | config OPIE_NO_SOUND_PCM_READ_BITS |
174 | boolean "There is not a pcm_read_bits io control" | 178 | boolean "There is not a pcm_read_bits io control" |
175 | default y if TARGET_SHARP | 179 | default y if TARGET_SHARP |
176 | default n if ! TARGET_SHARP | 180 | default n if ! TARGET_SHARP |
diff --git a/library/resource.cpp b/library/resource.cpp index b31876f..3b5e9ec 100644 --- a/library/resource.cpp +++ b/library/resource.cpp | |||
@@ -28,11 +28,13 @@ | |||
28 | // this namespace is just a workaround for a gcc bug | 28 | // this namespace is just a workaround for a gcc bug |
29 | // gcc exports inline functions in the generated file | 29 | // gcc exports inline functions in the generated file |
30 | // inlinepics_p.h | 30 | // inlinepics_p.h |
31 | 31 | ||
32 | #ifndef LIBQPE_NO_INLINE_IMAGES | ||
32 | namespace { | 33 | namespace { |
33 | #include "inlinepics_p.h" | 34 | #include "inlinepics_p.h" |
34 | } | 35 | } |
36 | #endif | ||
35 | 37 | ||
36 | static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET"); | 38 | static bool g_notUseSet = ::getenv("OVERWRITE_ICON_SET"); |
37 | 39 | ||
38 | /*! | 40 | /*! |
@@ -95,9 +97,8 @@ QBitmap Resource::loadBitmap( const QString &pix ) | |||
95 | */ | 97 | */ |
96 | QString Resource::findPixmap( const QString &pix ) | 98 | QString Resource::findPixmap( const QString &pix ) |
97 | { | 99 | { |
98 | QString picsPath = QPEApplication::qpeDir() + "pics/"; | 100 | QString picsPath = QPEApplication::qpeDir() + "pics/"; |
99 | |||
100 | QString f; | 101 | QString f; |
101 | 102 | ||
102 | // Common case optimizations... | 103 | // Common case optimizations... |
103 | f = picsPath + pix + ".png"; | 104 | f = picsPath + pix + ".png"; |
@@ -106,8 +107,19 @@ QString Resource::findPixmap( const QString &pix ) | |||
106 | f = picsPath + pix + ".xpm"; | 107 | f = picsPath + pix + ".xpm"; |
107 | if ( QFile( f ).exists() ) | 108 | if ( QFile( f ).exists() ) |
108 | return f; | 109 | return f; |
109 | 110 | ||
111 | #ifdef LIBQPE_NO_INLINE_IMAGES | ||
112 | QString picsPathInline = picsPath + "inline/"; | ||
113 | // Common case optimizations... | ||
114 | f = picsPathInline + pix + ".png"; | ||
115 | if ( QFile( f ).exists() ) | ||
116 | return f; | ||
117 | f = picsPathInline + pix + ".xpm"; | ||
118 | if ( QFile( f ).exists() ) | ||
119 | return f; | ||
120 | #endif | ||
121 | |||
110 | // All formats... | 122 | // All formats... |
111 | QStrList fileFormats = QImageIO::inputFormats(); | 123 | QStrList fileFormats = QImageIO::inputFormats(); |
112 | QString ff = fileFormats.first(); | 124 | QString ff = fileFormats.first(); |
113 | while ( fileFormats.current() ) { | 125 | while ( fileFormats.current() ) { |
@@ -162,22 +174,34 @@ QStringList Resource::allSounds() | |||
162 | } | 174 | } |
163 | 175 | ||
164 | static QImage load_image(const QString &name) | 176 | static QImage load_image(const QString &name) |
165 | { | 177 | { |
178 | QImage img; | ||
179 | |||
166 | if (g_notUseSet ) { | 180 | if (g_notUseSet ) { |
167 | // try file | 181 | // try file |
168 | QImage img; | ||
169 | QString f = Resource::findPixmap(name); | 182 | QString f = Resource::findPixmap(name); |
170 | if ( !f.isEmpty() ) | 183 | if ( !f.isEmpty() ) |
171 | img.load(f); | 184 | img.load(f); |
185 | #ifndef LIBQPE_NO_INLINE_IMAGES | ||
172 | if (img.isNull() ) | 186 | if (img.isNull() ) |
173 | img = qembed_findImage(name.latin1() ); | 187 | img = qembed_findImage(name.latin1() ); |
188 | #endif | ||
174 | return img; | 189 | return img; |
175 | } | 190 | } |
176 | else{ | 191 | else{ |
177 | QImage img = qembed_findImage(name.latin1()); | 192 | #ifndef LIBQPE_NO_INLINE_IMAGES |
178 | 193 | img = qembed_findImage(name.latin1()); | |
179 | if ( img.isNull() ) { | 194 | #else |
195 | QString f = Resource::findPixmap( "/inline/" + name ); | ||
196 | if ( !f.isEmpty() ) | ||
197 | { | ||
198 | img.load(f); | ||
199 | return img; | ||
200 | } | ||
201 | #endif | ||
202 | if ( img.isNull() ) | ||
203 | { | ||
180 | // No inlined image, try file | 204 | // No inlined image, try file |
181 | QString f = Resource::findPixmap(name); | 205 | QString f = Resource::findPixmap(name); |
182 | if ( !f.isEmpty() ) | 206 | if ( !f.isEmpty() ) |
183 | img.load(f); | 207 | img.load(f); |