author | sandman <sandman> | 2002-09-24 22:52:01 (UTC) |
---|---|---|
committer | sandman <sandman> | 2002-09-24 22:52:01 (UTC) |
commit | cfb3613fcf068f071b353b26f778fc9b41ac8a38 (patch) (unidiff) | |
tree | 411d0fa22c742760164f4b040bf68667b180dbd1 | |
parent | 4374a35d9a3b072536bf091518f98855e6e438ad (diff) | |
download | opie-cfb3613fcf068f071b353b26f778fc9b41ac8a38.zip opie-cfb3613fcf068f071b353b26f778fc9b41ac8a38.tar.gz opie-cfb3613fcf068f071b353b26f778fc9b41ac8a38.tar.bz2 |
Better workaround for the "ignoring inline" gcc bug, since editing the
generated inlinepics_p.h makes no sense after all
-rw-r--r-- | library/resource.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/library/resource.cpp b/library/resource.cpp index 0db2a75..bdcd603 100644 --- a/library/resource.cpp +++ b/library/resource.cpp | |||
@@ -1,63 +1,69 @@ | |||
1 | /********************************************************************** | 1 | /********************************************************************** |
2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. | 2 | ** Copyright (C) 2000-2002 Trolltech AS. All rights reserved. |
3 | ** | 3 | ** |
4 | ** This file is part of the Qtopia Environment. | 4 | ** This file is part of the Qtopia Environment. |
5 | ** | 5 | ** |
6 | ** This file may be distributed and/or modified under the terms of the | 6 | ** This file may be distributed and/or modified under the terms of the |
7 | ** GNU General Public License version 2 as published by the Free Software | 7 | ** GNU General Public License version 2 as published by the Free Software |
8 | ** Foundation and appearing in the file LICENSE.GPL included in the | 8 | ** Foundation and appearing in the file LICENSE.GPL included in the |
9 | ** packaging of this file. | 9 | ** packaging of this file. |
10 | ** | 10 | ** |
11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE | 11 | ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE |
12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. | 12 | ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. |
13 | ** | 13 | ** |
14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. | 14 | ** See http://www.trolltech.com/gpl/ for GPL licensing information. |
15 | ** | 15 | ** |
16 | ** Contact info@trolltech.com if any conditions of this licensing are | 16 | ** Contact info@trolltech.com if any conditions of this licensing are |
17 | ** not clear to you. | 17 | ** not clear to you. |
18 | ** | 18 | ** |
19 | **********************************************************************/ | 19 | **********************************************************************/ |
20 | 20 | ||
21 | #define QTOPIA_INTERNAL_MIMEEXT | 21 | #define QTOPIA_INTERNAL_MIMEEXT |
22 | #include "qpeapplication.h" | 22 | #include "qpeapplication.h" |
23 | #include "resource.h" | 23 | #include "resource.h" |
24 | #include "mimetype.h" | 24 | #include "mimetype.h" |
25 | #include <qdir.h> | 25 | #include <qdir.h> |
26 | #include <qfile.h> | 26 | #include <qfile.h> |
27 | #include <qregexp.h> | 27 | #include <qregexp.h> |
28 | #include <qpixmapcache.h> | 28 | #include <qpixmapcache.h> |
29 | #include <qpainter.h> | 29 | #include <qpainter.h> |
30 | 30 | ||
31 | // this namespace is just a workaround for a gcc bug | ||
32 | // gcc exports inline functions in the generated file | ||
33 | // inlinepics_p.h | ||
34 | |||
35 | namespace { | ||
31 | #include "inlinepics_p.h" | 36 | #include "inlinepics_p.h" |
37 | } | ||
32 | 38 | ||
33 | /*! | 39 | /*! |
34 | \class Resource resource.h | 40 | \class Resource resource.h |
35 | \brief The Resource class provides access to named resources. | 41 | \brief The Resource class provides access to named resources. |
36 | 42 | ||
37 | The resources may be provided from files or other sources. | 43 | The resources may be provided from files or other sources. |
38 | 44 | ||
39 | The allSounds() function returns a list of all the sounds available. | 45 | The allSounds() function returns a list of all the sounds available. |
40 | A particular sound can be searched for using findSound(). | 46 | A particular sound can be searched for using findSound(). |
41 | 47 | ||
42 | Images can be loaded with loadImage(), loadPixmap(), loadBitmap() | 48 | Images can be loaded with loadImage(), loadPixmap(), loadBitmap() |
43 | and loadIconSet(). | 49 | and loadIconSet(). |
44 | 50 | ||
45 | \ingroup qtopiaemb | 51 | \ingroup qtopiaemb |
46 | */ | 52 | */ |
47 | 53 | ||
48 | /*! | 54 | /*! |
49 | \fn Resource::Resource() | 55 | \fn Resource::Resource() |
50 | \internal | 56 | \internal |
51 | */ | 57 | */ |
52 | 58 | ||
53 | /*! | 59 | /*! |
54 | Returns the QPixmap called \a pix. You should avoid including | 60 | Returns the QPixmap called \a pix. You should avoid including |
55 | any filename type extension (e.g. .png, .xpm). | 61 | any filename type extension (e.g. .png, .xpm). |
56 | */ | 62 | */ |
57 | QPixmap Resource::loadPixmap( const QString &pix ) | 63 | QPixmap Resource::loadPixmap( const QString &pix ) |
58 | { | 64 | { |
59 | QPixmap pm; | 65 | QPixmap pm; |
60 | QString key="QPE_"+pix; | 66 | QString key="QPE_"+pix; |
61 | if ( !QPixmapCache::find(key,pm) ) { | 67 | if ( !QPixmapCache::find(key,pm) ) { |
62 | pm.convertFromImage(loadImage(pix)); | 68 | pm.convertFromImage(loadImage(pix)); |
63 | QPixmapCache::insert(key,pm); | 69 | QPixmapCache::insert(key,pm); |