summaryrefslogtreecommitdiff
path: root/library/resource.cpp
authorllornkcor <llornkcor>2003-04-22 19:45:21 (UTC)
committer llornkcor <llornkcor>2003-04-22 19:45:21 (UTC)
commita4cbad5c0dece9af449a5a881973ce272208c1ba (patch) (unidiff)
tree851b17d12c1d9627514593dc62f167acd91aa6c6 /library/resource.cpp
parentc45bfc674b4ac3dcf13dca127f9f52a4f2641c03 (diff)
downloadopie-a4cbad5c0dece9af449a5a881973ce272208c1ba.zip
opie-a4cbad5c0dece9af449a5a881973ce272208c1ba.tar.gz
opie-a4cbad5c0dece9af449a5a881973ce272208c1ba.tar.bz2
remove qdebug
Diffstat (limited to 'library/resource.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--library/resource.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/library/resource.cpp b/library/resource.cpp
index 6f164c7..80ce7a2 100644
--- a/library/resource.cpp
+++ b/library/resource.cpp
@@ -81,49 +81,50 @@ QBitmap Resource::loadBitmap( const QString &pix )
81 bm = loadPixmap(pix); 81 bm = loadPixmap(pix);
82 return bm; 82 return bm;
83} 83}
84 84
85/*! 85/*!
86 Returns the filename of a pixmap called \a pix. You should avoid including 86 Returns the filename of a pixmap called \a pix. You should avoid including
87 any filename type extension (e.g. .png, .xpm). 87 any filename type extension (e.g. .png, .xpm).
88 88
89 Normally you will use loadPixmap() rather than this function. 89 Normally you will use loadPixmap() rather than this function.
90*/ 90*/
91QString Resource::findPixmap( const QString &pix ) 91QString Resource::findPixmap( const QString &pix )
92{ 92{
93 QString picsPath = QPEApplication::qpeDir() + "pics/"; 93 QString picsPath = QPEApplication::qpeDir() + "pics/";
94 94
95 QString f; 95 QString f;
96 96
97 // Common case optimizations... 97 // Common case optimizations...
98 f = picsPath + pix + ".png"; 98 f = picsPath + pix + ".png";
99 if ( QFile( f ).exists() ) 99 if ( QFile( f ).exists() )
100 return f; 100 return f;
101 f = picsPath + pix + ".xpm"; 101 f = picsPath + pix + ".xpm";
102 if ( QFile( f ).exists() ) 102 if ( QFile( f ).exists() )
103 return f; 103 return f;
104 104
105 qDebug ( "\nLoading of image '%s' is not ideal (either it doesn't exist or an extension was specified)\n", pix.latin1()); 105 //qDebug ( "\nLoading of image '%s' is not ideal (either it doesn't exist or an extension was specified)\n", pix.latin1());
106//is this really necessary??
106 107
107 // All formats... 108 // All formats...
108 QStrList fileFormats = QImageIO::inputFormats(); 109 QStrList fileFormats = QImageIO::inputFormats();
109 QString ff = fileFormats.first(); 110 QString ff = fileFormats.first();
110 while ( fileFormats.current() ) { 111 while ( fileFormats.current() ) {
111 QStringList exts = MimeType("image/"+ff.lower()).extensions(); 112 QStringList exts = MimeType("image/"+ff.lower()).extensions();
112 for ( QStringList::ConstIterator it = exts.begin(); it!=exts.end(); ++it ) { 113 for ( QStringList::ConstIterator it = exts.begin(); it!=exts.end(); ++it ) {
113 QString f = picsPath + pix + "." + *it; 114 QString f = picsPath + pix + "." + *it;
114 if ( QFile(f).exists() ) 115 if ( QFile(f).exists() )
115 return f; 116 return f;
116 } 117 }
117 ff = fileFormats.next(); 118 ff = fileFormats.next();
118 } 119 }
119 120
120 // Finally, no (or existing) extension... 121 // Finally, no (or existing) extension...
121 if ( QFile( picsPath + pix ).exists() ) 122 if ( QFile( picsPath + pix ).exists() )
122 return picsPath + pix; 123 return picsPath + pix;
123 124
124 //qDebug("Cannot find pixmap: %s", pix.latin1()); 125 //qDebug("Cannot find pixmap: %s", pix.latin1());
125 return QString(); 126 return QString();
126} 127}
127 128
128/*! 129/*!
129 Returns a sound file for a sound called \a name. 130 Returns a sound file for a sound called \a name.