From: Flavio Tordini Date: Tue, 6 Apr 2010 17:35:19 +0000 (+0200) Subject: Use QIcon::fromTheme() with Qt >= 4.6 X-Git-Tag: 1.0~28 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=a449f164b5b069f5569a2320018c85f8cf078eda;p=minitube Use QIcon::fromTheme() with Qt >= 4.6 --- diff --git a/src/iconloader/qticonloader.cpp b/src/iconloader/qticonloader.cpp index 2e60783..551e1ac 100644 --- a/src/iconloader/qticonloader.cpp +++ b/src/iconloader/qticonloader.cpp @@ -102,6 +102,9 @@ Q_GLOBAL_STATIC(QtIconLoaderImplementation, iconLoaderInstance) QIcon QtIconLoader::icon(const QString &name, const QIcon &fallback) { QIcon icon; + +#if QT_VERSION < 0x040600 + #ifdef Q_WS_X11 QString pngExtension(QLatin1String(".png")); QList iconSizes; @@ -110,6 +113,11 @@ QIcon QtIconLoader::icon(const QString &name, const QIcon &fallback) icon.addPixmap(iconLoaderInstance()->findIcon(size, name + pngExtension)); } #endif + +#else + icon = QIcon::fromTheme(name, fallback); +#endif + if (icon.isNull()) icon = fallback; Q_UNUSED(name);