diff options
author | Jens Bache-Wiig <jens.bache-wiig@nokia.com> | 2010-08-20 15:14:37 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2010-08-20 15:22:00 (GMT) |
commit | a1381dcce6ad42567d88d628934b55873c3687e9 (patch) | |
tree | c90c7399be3ff5d584493fa99470d30c9205df76 /src | |
parent | 4148769f9465449cb537fde193912a5a071ddd8a (diff) | |
download | Qt-a1381dcce6ad42567d88d628934b55873c3687e9.zip Qt-a1381dcce6ad42567d88d628934b55873c3687e9.tar.gz Qt-a1381dcce6ad42567d88d628934b55873c3687e9.tar.bz2 |
Revised fix for pixmap loading
Change 2c8f9dee611 had an unwelcome side-effect and was reverted.
Since we do have the undocumented behavior that we scan for all possible
extensions when QPixmap is provided with a filename without extensions
we could not simply exit if the file did not exist. We now check if
there are extensions before doing so.
Reviewed-by: gabi
Task-number: QTBUG-11137
Diffstat (limited to 'src')
-rw-r--r-- | src/gui/image/qpixmap.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/image/qpixmap.cpp b/src/gui/image/qpixmap.cpp index 1c0ceff..c039ca8 100644 --- a/src/gui/image/qpixmap.cpp +++ b/src/gui/image/qpixmap.cpp @@ -836,6 +836,11 @@ bool QPixmap::load(const QString &fileName, const char *format, Qt::ImageConvers % HexString<quint64>(info.size()) % HexString<uint>(data ? data->pixelType() : QPixmapData::PixmapType); + // Note: If no extension is provided, we try to match the + // file against known plugin extensions + if (!info.completeSuffix().isEmpty() && !info.exists()) + return false; + if (QPixmapCache::find(key, *this)) return true; |