diff options
author | Christian Kandeler <christian.kandeler@nokia.com> | 2012-08-23 15:53:58 +0200 |
---|---|---|
committer | hjk <qthjk@ovi.com> | 2012-08-27 17:00:03 +0200 |
commit | e669f054069c3a1214a31c4c1d7d9269659c31c4 (patch) | |
tree | d611e865215dc8ee705a640fdf3e35660542632f /src/plugins/coreplugin/fileiconprovider.cpp | |
parent | b674b59b3d652fa9c5d74dc4e16380e3a5d23882 (diff) | |
download | qt-creator-e669f054069c3a1214a31c4c1d7d9269659c31c4.tar.gz |
Utils: Introduce HostOsInfo class.
The class' member functions are intended to be used
instead of the Q_OS_* macros in all contexts where
the latter are not syntactically required.
This lowers the likelihood of changes made on one
platform breaking the build on another, e.g. due to
the code model missing symbols in #ifdef'ed out code
when refactoring.
Change-Id: I4a54788591b4c8f8d589b8368a6c683d4155c9fa
Reviewed-by: hjk <qthjk@ovi.com>
Diffstat (limited to 'src/plugins/coreplugin/fileiconprovider.cpp')
-rw-r--r-- | src/plugins/coreplugin/fileiconprovider.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/src/plugins/coreplugin/fileiconprovider.cpp b/src/plugins/coreplugin/fileiconprovider.cpp index 3541027cd0..ffc94139a9 100644 --- a/src/plugins/coreplugin/fileiconprovider.cpp +++ b/src/plugins/coreplugin/fileiconprovider.cpp @@ -31,6 +31,7 @@ #include "fileiconprovider.h" #include "mimedatabase.h" +#include <utils/hostosinfo.h> #include <utils/qtcassert.h> #include <QApplication> @@ -44,6 +45,8 @@ #include <QIcon> #include <QStyle> +using namespace Utils; + /*! \class Core::FileIconProvider @@ -139,14 +142,13 @@ QIcon FileIconProvider::icon(const QFileInfo &fileInfo) const } } // Get icon from OS. -#if defined(Q_WS_WIN) || defined(Q_OS_MAC) - return QFileIconProvider::icon(fileInfo); -#else + if (HostOsInfo::isWindowsHost() || HostOsInfo::isMacHost()) + return QFileIconProvider::icon(fileInfo); + // File icons are unknown on linux systems. return (fileInfo.isDir()) ? QFileIconProvider::icon(fileInfo) : d->m_unknownFileIcon; -#endif } /*! |