diff options
author | Liang Qi <liang.qi@qt.io> | 2018-09-28 11:40:10 +0200 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-10-12 14:26:33 +0000 |
commit | 3eebadc1734463afa469dcd08eab8c5d2557dec6 (patch) | |
tree | 939afe7c3da0ff7249c6ae7f167dd56442401f51 /src/gui/image | |
parent | 9c8ca26a4829d5ce810c9653fec3dfe48717f0b1 (diff) |
Modernize the "mimetype" feature
Change-Id: I9b67c2cbc0891a38ece18d521c86fbc7344dce7a
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Diffstat (limited to 'src/gui/image')
-rw-r--r-- | src/gui/image/qicon.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/gui/image/qicon.cpp b/src/gui/image/qicon.cpp index 32fa9e75ac..635fdc3a68 100644 --- a/src/gui/image/qicon.cpp +++ b/src/gui/image/qicon.cpp @@ -47,8 +47,10 @@ #include "private/qiconloader_p.h" #include "qpainter.h" #include "qfileinfo.h" +#if QT_CONFIG(mimetype) #include <qmimedatabase.h> #include <qmimetype.h> +#endif #include "qpixmapcache.h" #include "qvariant.h" #include "qcache.h" @@ -1079,10 +1081,10 @@ void QIcon::addFile(const QString &fileName, const QSize &size, Mode mode, State QFileInfo info(fileName); QIconEngine *engine = iconEngineFromSuffix(fileName, info.suffix()); -#ifndef QT_NO_MIMETYPE +#if QT_CONFIG(mimetype) if (!engine) engine = iconEngineFromSuffix(fileName, QMimeDatabase().mimeTypeForFile(info).preferredSuffix()); -#endif // !QT_NO_MIMETYPE +#endif // mimetype d = new QIconPrivate(engine ? engine : new QPixmapIconEngine); } |