diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index 6bf0c2b3c..364f5ddc3 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -105,7 +105,13 @@ MainWindow::MainWindow(QWidget *parent, const QStringList& torrentCmdLine) : QMa // Clean exit on log out connect(static_cast(qApp), SIGNAL(sessionIsShuttingDown()), this, SLOT(deleteBTSession())); // Setting icons - this->setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png"))); +#if defined(Q_WS_X11) + if (Preferences().useSystemIconTheme()) + setWindowIcon(QIcon::fromTheme("qbittorrent", QString::fromUtf8(":/Icons/skin/qbittorrent32.png"))); + else +#else + setWindowIcon(QIcon(QString::fromUtf8(":/Icons/skin/qbittorrent32.png"))); +#endif actionOpen->setIcon(IconProvider::instance()->getIcon("list-add")); actionDownload_from_URL->setIcon(IconProvider::instance()->getIcon("insert-link")); actionSet_upload_limit->setIcon(QIcon(QString::fromUtf8(":/Icons/skin/seeding.png"))); @@ -1399,8 +1405,15 @@ QIcon MainWindow::getSystrayIcon() const } #endif QIcon icon; - 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)); +#if defined(Q_WS_X11) + if (Preferences().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; }