Only query for the theme if it is available in the GTKStyle

If the theme is not available then it should not try to use it when
getting the file system icon as it will cause a number of messages to be
outputted to the console as it is an invalid call.

Change-Id: I33003568f6785ee423c4a6e079a6c62c95145cbc
Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
This commit is contained in:
Andy Shaw 2014-02-11 17:49:26 +01:00 committed by The Qt Project
parent aef82ebe15
commit da888ba539

View File

@ -855,7 +855,7 @@ QFont QGtkStylePrivate::getThemeFont()
QIcon QGtkStylePrivate::getFilesystemIcon(const QFileInfo &info) QIcon QGtkStylePrivate::getFilesystemIcon(const QFileInfo &info)
{ {
QIcon icon; QIcon icon;
if (gnome_vfs_init && gnome_icon_lookup_sync) { if (isThemeAvailable() && gnome_vfs_init && gnome_icon_lookup_sync) {
gnome_vfs_init(); gnome_vfs_init();
GtkIconTheme *theme = gtk_icon_theme_get_default(); GtkIconTheme *theme = gtk_icon_theme_get_default();
QByteArray fileurl = QUrl::fromLocalFile(info.absoluteFilePath()).toEncoded(); QByteArray fileurl = QUrl::fromLocalFile(info.absoluteFilePath()).toEncoded();