diff options
author | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-07 11:58:02 (GMT) |
---|---|---|
committer | Olivier Goffart <ogoffart@trolltech.com> | 2009-10-07 15:56:43 (GMT) |
commit | db182f75b69cd47ce8abbcc5acb2551306919a05 (patch) | |
tree | 726e5731b1f923cac6527b77c043874b27c256c0 /src/gui/itemviews/qfileiconprovider.cpp | |
parent | 3cad63946965416c89703fbf3d9730e856283c06 (diff) | |
download | Qt-db182f75b69cd47ce8abbcc5acb2551306919a05.zip Qt-db182f75b69cd47ce8abbcc5acb2551306919a05.tar.gz Qt-db182f75b69cd47ce8abbcc5acb2551306919a05.tar.bz2 |
QGuiPlatformPlugin: QFileIconProvider and QIcon backend.
Add a backend for QFileIconProvider in the platform plugin
Also change the QIcon::fromTheme backend in the platform plugin:
On KDE, we unfortunately can't use KIcon as backend, as the current
API doesn't let us know easily (and quickly) wether we should use
the fallback or not (KDE always fallback to the question mark
"unknown" icon)
So we will use the QIconLoader even on KDE.
But we need to make sure that the theme name and the icon search paths
are correct. Ask that to the platform plugin
Reviewed-by: Jens Bache-Wiig
Diffstat (limited to 'src/gui/itemviews/qfileiconprovider.cpp')
-rw-r--r-- | src/gui/itemviews/qfileiconprovider.cpp | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index c78a49b..e3d17ad 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -61,6 +61,7 @@ #endif #include <private/qfunctions_p.h> +#include <private/qguiplatformplugin_p.h> #ifndef SHGFI_ADDOVERLAYS #define SHGFI_ADDOVERLAYS 0x000000020 @@ -385,6 +386,10 @@ QIcon QFileIconProvider::icon(const QFileInfo &info) const { Q_D(const QFileIconProvider); + QIcon platformIcon = qt_guiPlatformPlugin()->fileSystemIcon(info); + if (!platformIcon.isNull()) + return platformIcon; + #if defined(Q_WS_X11) && !defined(QT_NO_STYLE_GTK) if (X11->desktopEnvironment == DE_GNOME) { QIcon gtkIcon = QGtk::getFilesystemIcon(info); |