diff options
author | Jens Bache-Wiig <jbache@trolltech.com> | 2009-10-06 09:59:32 (GMT) |
---|---|---|
committer | Jens Bache-Wiig <jbache@trolltech.com> | 2009-10-06 10:33:26 (GMT) |
commit | 3d2ef8ab18dcf0b772d2f6ddeb5cf5295ca09db6 (patch) | |
tree | 35755588c8c2487e4dac1aa6cb5e8daac6a1dfb9 /src/gui/itemviews/qfileiconprovider.cpp | |
parent | cadad3fdc7f6de95979f5b5be070da0853c46ba4 (diff) | |
download | Qt-3d2ef8ab18dcf0b772d2f6ddeb5cf5295ca09db6.zip Qt-3d2ef8ab18dcf0b772d2f6ddeb5cf5295ca09db6.tar.gz Qt-3d2ef8ab18dcf0b772d2f6ddeb5cf5295ca09db6.tar.bz2 |
Add GNOME implementation for native filesystem icons
This adds some code to support native filesystem icons
on GNOME. It works by resolving gnome libs and gnome-vfs dynamically,
hence we are explicitly running it on GNOME only and not KDE.
Even if it would work there as well. We are planning on adding this
functionality to the platform plugin as well.
Task-number: QTBUG-2195
Reviewed-by: joao
Diffstat (limited to 'src/gui/itemviews/qfileiconprovider.cpp')
-rw-r--r-- | src/gui/itemviews/qfileiconprovider.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/gui/itemviews/qfileiconprovider.cpp b/src/gui/itemviews/qfileiconprovider.cpp index 4abdef9..c78a49b 100644 --- a/src/gui/itemviews/qfileiconprovider.cpp +++ b/src/gui/itemviews/qfileiconprovider.cpp @@ -54,6 +54,12 @@ #elif defined(Q_WS_MAC) #include <private/qt_cocoa_helpers_mac_p.h> #endif + +#if defined(Q_WS_X11) && !defined(Q_NO_STYLE_GTK) +#include <private/qt_x11_p.h> +#include <private/gtksymbols_p.h> +#endif + #include <private/qfunctions_p.h> #ifndef SHGFI_ADDOVERLAYS @@ -378,6 +384,15 @@ QIcon QFileIconProviderPrivate::getMacIcon(const QFileInfo &fi) const QIcon QFileIconProvider::icon(const QFileInfo &info) const { Q_D(const QFileIconProvider); + +#if defined(Q_WS_X11) && !defined(QT_NO_STYLE_GTK) + if (X11->desktopEnvironment == DE_GNOME) { + QIcon gtkIcon = QGtk::getFilesystemIcon(info); + if (!gtkIcon.isNull()) + return gtkIcon; + } +#endif + #ifdef Q_WS_MAC QIcon retIcon = d->getMacIcon(info); if (!retIcon.isNull()) |