From 995de3e31aef578b87cdb7a1762d6bc465d21651 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 9 Oct 2009 20:49:21 +0200 Subject: Fixed compilation warning by removing unused variables. Reviewed-by: trustme --- src/gui/itemviews/qheaderview.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/gui/itemviews/qheaderview.cpp b/src/gui/itemviews/qheaderview.cpp index a754579..0045bd5 100644 --- a/src/gui/itemviews/qheaderview.cpp +++ b/src/gui/itemviews/qheaderview.cpp @@ -524,8 +524,6 @@ QSize QHeaderView::sizeHint() const Q_D(const QHeaderView); if (d->cachedSizeHint.isValid()) return d->cachedSizeHint; - int width = 0; - int height = 0; const int sectionCount = count(); d->executePostedLayout(); -- cgit v0.12 From e361321e156bf1123e0d670c052307dc00f6d3f4 Mon Sep 17 00:00:00 2001 From: Denis Dzyubenko Date: Fri, 9 Oct 2009 20:49:56 +0200 Subject: Fixed getting an icon for a file on the filesystem with gnome. According to the documentation gnome_icon_lookup_sync() can return an absolute file path for the icon, so we check if the returned string starts like a path, then we load the icon from the file. This also fixes compilation warnings. Reviewed-by: Olivier Goffart --- src/gui/styles/gtksymbols.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/styles/gtksymbols.cpp b/src/gui/styles/gtksymbols.cpp index d62f717..6ec5796 100644 --- a/src/gui/styles/gtksymbols.cpp +++ b/src/gui/styles/gtksymbols.cpp @@ -984,15 +984,18 @@ QIcon QGtk::getFilesystemIcon(const QFileInfo &info) if (QGtk::gnome_vfs_init && QGtk::gnome_icon_lookup_sync) { QGtk::gnome_vfs_init(); GtkIconTheme *theme = QGtk::gtk_icon_theme_get_default(); - QString fileurl = QUrl::fromLocalFile(info.absoluteFilePath()).toEncoded(); + QByteArray fileurl = QUrl::fromLocalFile(info.absoluteFilePath()).toEncoded(); char * icon_name = QGtk::gnome_icon_lookup_sync(theme, NULL, - qPrintable(fileurl), + fileurl.data(), NULL, GNOME_ICON_LOOKUP_FLAGS_NONE, NULL); - return QIcon::fromTheme(icon_name); + QString iconName = QString::fromUtf8(icon_name); g_free(icon_name); + if (iconName.startsWith(QLatin1Char('/'))) + return QIcon(iconName); + return QIcon::fromTheme(iconName); } return icon; } -- cgit v0.12