mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-12-31 20:58:07 -06:00
Merge pull request #8585 from Chocobo1/lint
Fix compiler/clazy warnings
This commit is contained in:
@@ -107,7 +107,7 @@ class downloadFromURL : public QDialog, private Ui::downloadFromURL
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!url_list_cleaned.size()) {
|
||||
if (url_list_cleaned.isEmpty()) {
|
||||
QMessageBox::warning(this, tr("No URL entered"), tr("Please type at least one URL."));
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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<Log::MsgType>(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
|
||||
}
|
||||
|
||||
@@ -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<QString>{absolutePath});
|
||||
#else
|
||||
if (containingFolder)
|
||||
@@ -660,7 +661,7 @@ void PropertiesWidget::displayWebSeedListMenu(const QPoint &)
|
||||
QAction *actCpy = nullptr;
|
||||
QAction *actEdit = nullptr;
|
||||
|
||||
if (rows.size()) {
|
||||
if (!rows.isEmpty()) {
|
||||
actDel = seedMenu.addAction(GuiIconProvider::instance()->getIcon("list-remove"), tr("Remove Web seed"));
|
||||
seedMenu.addSeparator();
|
||||
actCpy = seedMenu.addAction(GuiIconProvider::instance()->getIcon("edit-copy"), tr("Copy Web seed URL"));
|
||||
|
||||
@@ -446,8 +446,6 @@ void TrackerList::editSelectedTracker()
|
||||
BitTorrent::TorrentHandle *const torrent = m_properties->getCurrentTorrent();
|
||||
if (!torrent) return;
|
||||
|
||||
QString hash = torrent->hash();
|
||||
|
||||
QList<QTreeWidgetItem *> selectedTrackerItems = getSelectedTrackerItems();
|
||||
if (selectedTrackerItems.isEmpty()) return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user