From 2e6c890883d2a290426ace1c8abf5fc4a2b2944e Mon Sep 17 00:00:00 2001 From: sledgehammer999 Date: Sun, 21 Jun 2015 00:56:18 +0300 Subject: [PATCH] Partially revert 30f21259f8c219. Fixes Linux issue for when the theme doesn't have a corresponding icon. --- src/gui/mainwindow.cpp | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 151f9b598..0ace0512c 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -1512,11 +1512,6 @@ void MainWindow::checkForActiveTorrents() QIcon MainWindow::getSystrayIcon() const { -#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) - if (Preferences::instance()->useSystemIconTheme()) - return QIcon::fromTheme("qbittorrent"); -#endif - TrayIcon::Style style = Preferences::instance()->trayIconStyle(); switch(style) { case TrayIcon::MONO_DARK: @@ -1528,9 +1523,16 @@ QIcon MainWindow::getSystrayIcon() const } QIcon icon; - icon.addFile(":/icons/skin/qbittorrent16.png"); - icon.addFile(":/icons/skin/qbittorrent22.png"); - icon.addFile(":/icons/skin/qbittorrent32.png"); +#if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) + if (Preferences::instance()->useSystemIconTheme()) + icon = QIcon::fromTheme("qbittorrent"); + +#endif + if (icon.isNull()) { + icon.addFile(":/icons/skin/qbittorrent22.png", QSize(22, 22)); + icon.addFile(":/icons/skin/qbittorrent16.png", QSize(16, 16)); + icon.addFile(":/icons/skin/qbittorrent32.png", QSize(32, 32)); + } return icon; }