From a468c84b304bdcea985989ca987bda391e3ccaad Mon Sep 17 00:00:00 2001 From: Chocobo1 Date: Mon, 12 Mar 2018 14:29:58 +0800 Subject: [PATCH] Fix warnings from unused variables --- src/gui/mainwindow.cpp | 8 +++++--- src/gui/properties/propertieswidget.cpp | 1 + 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 50ac4b245..6eafd5416 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -679,8 +679,8 @@ void MainWindow::displayRSSTab(bool enable) if (!m_rssWidget) { m_rssWidget = new RSSWidget(m_tabs); connect(m_rssWidget.data(), &RSSWidget::unreadCountUpdated, this, &MainWindow::handleRSSUnreadCountUpdated); - int indexTab = m_tabs->addTab(m_rssWidget, tr("RSS (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount())); #ifndef Q_OS_MAC + const int indexTab = m_tabs->addTab(m_rssWidget, tr("RSS (%1)").arg(RSS::Session::instance()->rootFolder()->unreadCount())); m_tabs->setTabIcon(indexTab, GuiIconProvider::instance()->getIcon("application-rss+xml")); #endif } @@ -1388,7 +1388,9 @@ void MainWindow::loadPreferences(bool configureSession) { Logger::instance()->addMessage(tr("Options were saved successfully.")); const Preferences *const pref = Preferences::instance(); -#ifndef Q_OS_MAC +#ifdef Q_OS_MAC + Q_UNUSED(configureSession); +#else const bool newSystrayIntegration = pref->systrayIntegration(); m_ui->actionLock->setVisible(newSystrayIntegration); if (newSystrayIntegration != (m_systrayIcon != 0)) { @@ -1877,8 +1879,8 @@ void MainWindow::on_actionExecutionLogs_triggered(bool checked) if (checked) { Q_ASSERT(!m_executionLog); m_executionLog = new ExecutionLog(m_tabs, static_cast(executionLogMsgTypes())); - int indexTab = m_tabs->addTab(m_executionLog, tr("Execution Log")); #ifndef Q_OS_MAC + const int indexTab = m_tabs->addTab(m_executionLog, tr("Execution Log")); m_tabs->setTabIcon(indexTab, GuiIconProvider::instance()->getIcon("view-calendar-journal")); #endif } diff --git a/src/gui/properties/propertieswidget.cpp b/src/gui/properties/propertieswidget.cpp index 1b871375f..d9635fde9 100644 --- a/src/gui/properties/propertieswidget.cpp +++ b/src/gui/properties/propertieswidget.cpp @@ -579,6 +579,7 @@ void PropertiesWidget::openFolder(const QModelIndex &index, bool containingFolde // Flush data m_torrent->flushCache(); #ifdef Q_OS_MAC + Q_UNUSED(containingFolder); MacUtils::openFiles(QSet{absolutePath}); #else if (containingFolder)