diff --git a/src/base/bittorrent/peerinfo.cpp b/src/base/bittorrent/peerinfo.cpp index 6d5deb46a..a5a3d8f60 100644 --- a/src/base/bittorrent/peerinfo.cpp +++ b/src/base/bittorrent/peerinfo.cpp @@ -43,7 +43,7 @@ PeerAddress::PeerAddress() { } -PeerAddress::PeerAddress(QHostAddress ip, ushort port) +PeerAddress::PeerAddress(const QHostAddress &ip, ushort port) : ip(ip) , port(port) { diff --git a/src/base/bittorrent/peerinfo.h b/src/base/bittorrent/peerinfo.h index bdeed4cad..9edac8552 100644 --- a/src/base/bittorrent/peerinfo.h +++ b/src/base/bittorrent/peerinfo.h @@ -45,7 +45,7 @@ namespace BitTorrent ushort port; PeerAddress(); - PeerAddress(QHostAddress ip, ushort port); + PeerAddress(const QHostAddress &ip, ushort port); }; class PeerInfo diff --git a/src/base/bittorrent/session.cpp b/src/base/bittorrent/session.cpp index 8d93d313c..14e10f1ab 100644 --- a/src/base/bittorrent/session.cpp +++ b/src/base/bittorrent/session.cpp @@ -3762,7 +3762,7 @@ void Session::readAlerts() handleAlert(a); } -void Session::handleAlert(libt::alert *a) +void Session::handleAlert(const libt::alert *a) { try { switch (a->type()) { @@ -3784,53 +3784,53 @@ void Session::handleAlert(libt::alert *a) dispatchTorrentAlert(a); break; case libt::metadata_received_alert::alert_type: - handleMetadataReceivedAlert(static_cast(a)); + handleMetadataReceivedAlert(static_cast(a)); dispatchTorrentAlert(a); break; case libt::state_update_alert::alert_type: - handleStateUpdateAlert(static_cast(a)); + handleStateUpdateAlert(static_cast(a)); break; case libt::session_stats_alert::alert_type: - handleSessionStatsAlert(static_cast(a)); + handleSessionStatsAlert(static_cast(a)); break; case libt::file_error_alert::alert_type: - handleFileErrorAlert(static_cast(a)); + handleFileErrorAlert(static_cast(a)); break; case libt::add_torrent_alert::alert_type: - handleAddTorrentAlert(static_cast(a)); + handleAddTorrentAlert(static_cast(a)); break; case libt::torrent_removed_alert::alert_type: - handleTorrentRemovedAlert(static_cast(a)); + handleTorrentRemovedAlert(static_cast(a)); break; case libt::torrent_deleted_alert::alert_type: - handleTorrentDeletedAlert(static_cast(a)); + handleTorrentDeletedAlert(static_cast(a)); break; case libt::torrent_delete_failed_alert::alert_type: - handleTorrentDeleteFailedAlert(static_cast(a)); + handleTorrentDeleteFailedAlert(static_cast(a)); break; case libt::portmap_error_alert::alert_type: - handlePortmapWarningAlert(static_cast(a)); + handlePortmapWarningAlert(static_cast(a)); break; case libt::portmap_alert::alert_type: - handlePortmapAlert(static_cast(a)); + handlePortmapAlert(static_cast(a)); break; case libt::peer_blocked_alert::alert_type: - handlePeerBlockedAlert(static_cast(a)); + handlePeerBlockedAlert(static_cast(a)); break; case libt::peer_ban_alert::alert_type: - handlePeerBanAlert(static_cast(a)); + handlePeerBanAlert(static_cast(a)); break; case libt::url_seed_alert::alert_type: - handleUrlSeedAlert(static_cast(a)); + handleUrlSeedAlert(static_cast(a)); break; case libt::listen_succeeded_alert::alert_type: - handleListenSucceededAlert(static_cast(a)); + handleListenSucceededAlert(static_cast(a)); break; case libt::listen_failed_alert::alert_type: - handleListenFailedAlert(static_cast(a)); + handleListenFailedAlert(static_cast(a)); break; case libt::external_ip_alert::alert_type: - handleExternalIPAlert(static_cast(a)); + handleExternalIPAlert(static_cast(a)); break; } } @@ -3839,7 +3839,7 @@ void Session::handleAlert(libt::alert *a) } } -void Session::dispatchTorrentAlert(libt::alert *a) +void Session::dispatchTorrentAlert(const libt::alert *a) { TorrentHandle *const torrent = m_torrents.value(static_cast(a)->handle.info_hash()); if (torrent) @@ -3901,7 +3901,7 @@ void Session::createTorrentHandle(const libt::torrent_handle &nativeHandle) emit torrentNew(torrent); } -void Session::handleAddTorrentAlert(libt::add_torrent_alert *p) +void Session::handleAddTorrentAlert(const libt::add_torrent_alert *p) { if (p->error) { qDebug("/!\\ Error: Failed to add torrent!"); @@ -3914,7 +3914,7 @@ void Session::handleAddTorrentAlert(libt::add_torrent_alert *p) } } -void Session::handleTorrentRemovedAlert(libt::torrent_removed_alert *p) +void Session::handleTorrentRemovedAlert(const libt::torrent_removed_alert *p) { const InfoHash infoHash {p->info_hash}; @@ -3930,7 +3930,7 @@ void Session::handleTorrentRemovedAlert(libt::torrent_removed_alert *p) } } -void Session::handleTorrentDeletedAlert(libt::torrent_deleted_alert *p) +void Session::handleTorrentDeletedAlert(const libt::torrent_deleted_alert *p) { const InfoHash infoHash {p->info_hash}; @@ -3942,7 +3942,7 @@ void Session::handleTorrentDeletedAlert(libt::torrent_deleted_alert *p) LogMsg(tr("'%1' was removed from the transfer list and hard disk.", "'xxx.avi' was removed...").arg(tmpRemovingTorrentData.name)); } -void Session::handleTorrentDeleteFailedAlert(libt::torrent_delete_failed_alert *p) +void Session::handleTorrentDeleteFailedAlert(const libt::torrent_delete_failed_alert *p) { const InfoHash infoHash {p->info_hash}; @@ -3958,7 +3958,7 @@ void Session::handleTorrentDeleteFailedAlert(libt::torrent_delete_failed_alert * , Log::CRITICAL); } -void Session::handleMetadataReceivedAlert(libt::metadata_received_alert *p) +void Session::handleMetadataReceivedAlert(const libt::metadata_received_alert *p) { const InfoHash hash {p->handle.info_hash()}; @@ -3970,7 +3970,7 @@ void Session::handleMetadataReceivedAlert(libt::metadata_received_alert *p) } } -void Session::handleFileErrorAlert(libt::file_error_alert *p) +void Session::handleFileErrorAlert(const libt::file_error_alert *p) { qDebug() << Q_FUNC_INFO; // NOTE: Check this function! @@ -3988,18 +3988,18 @@ void Session::handleFileErrorAlert(libt::file_error_alert *p) } } -void Session::handlePortmapWarningAlert(libt::portmap_error_alert *p) +void Session::handlePortmapWarningAlert(const libt::portmap_error_alert *p) { Logger::instance()->addMessage(tr("UPnP/NAT-PMP: Port mapping failure, message: %1").arg(QString::fromStdString(p->message())), Log::CRITICAL); } -void Session::handlePortmapAlert(libt::portmap_alert *p) +void Session::handlePortmapAlert(const libt::portmap_alert *p) { qDebug("UPnP Success, msg: %s", p->message().c_str()); Logger::instance()->addMessage(tr("UPnP/NAT-PMP: Port mapping successful, message: %1").arg(QString::fromStdString(p->message())), Log::INFO); } -void Session::handlePeerBlockedAlert(libt::peer_blocked_alert *p) +void Session::handlePeerBlockedAlert(const libt::peer_blocked_alert *p) { boost::system::error_code ec; const std::string ip = p->ip.to_string(ec); @@ -4029,7 +4029,7 @@ void Session::handlePeerBlockedAlert(libt::peer_blocked_alert *p) Logger::instance()->addPeer(QString::fromLatin1(ip.c_str()), true, reason); } -void Session::handlePeerBanAlert(libt::peer_ban_alert *p) +void Session::handlePeerBanAlert(const libt::peer_ban_alert *p) { boost::system::error_code ec; const std::string ip = p->ip.address().to_string(ec); @@ -4037,14 +4037,14 @@ void Session::handlePeerBanAlert(libt::peer_ban_alert *p) Logger::instance()->addPeer(QString::fromLatin1(ip.c_str()), false); } -void Session::handleUrlSeedAlert(libt::url_seed_alert *p) +void Session::handleUrlSeedAlert(const libt::url_seed_alert *p) { Logger::instance()->addMessage(tr("URL seed lookup failed for URL: '%1', message: %2") .arg(QString::fromStdString(p->server_url())) .arg(QString::fromStdString(p->message())), Log::CRITICAL); } -void Session::handleListenSucceededAlert(libt::listen_succeeded_alert *p) +void Session::handleListenSucceededAlert(const libt::listen_succeeded_alert *p) { boost::system::error_code ec; QString proto = "TCP"; @@ -4067,7 +4067,7 @@ void Session::handleListenSucceededAlert(libt::listen_succeeded_alert *p) it->force_reannounce(); } -void Session::handleListenFailedAlert(libt::listen_failed_alert *p) +void Session::handleListenFailedAlert(const libt::listen_failed_alert *p) { boost::system::error_code ec; QString proto = "TCP"; @@ -4090,13 +4090,13 @@ void Session::handleListenFailedAlert(libt::listen_failed_alert *p) , Log::CRITICAL); } -void Session::handleExternalIPAlert(libt::external_ip_alert *p) +void Session::handleExternalIPAlert(const libt::external_ip_alert *p) { boost::system::error_code ec; Logger::instance()->addMessage(tr("External IP: %1", "e.g. External IP: 192.168.0.1").arg(p->external_address.to_string(ec).c_str()), Log::INFO); } -void Session::handleSessionStatsAlert(libt::session_stats_alert *p) +void Session::handleSessionStatsAlert(const libt::session_stats_alert *p) { const qreal interval = m_statsUpdateTimer.restart() / 1000.; @@ -4161,7 +4161,7 @@ void Session::handleSessionStatsAlert(libt::session_stats_alert *p) emit statsUpdated(); } -void Session::handleStateUpdateAlert(libt::state_update_alert *p) +void Session::handleStateUpdateAlert(const libt::state_update_alert *p) { for (const libt::torrent_status &status : p->status) { TorrentHandle *const torrent = m_torrents.value(status.info_hash); diff --git a/src/base/bittorrent/session.h b/src/base/bittorrent/session.h index 294155e7c..8f056204d 100644 --- a/src/base/bittorrent/session.h +++ b/src/base/bittorrent/session.h @@ -589,24 +589,24 @@ namespace BitTorrent void exportTorrentFile(TorrentHandle *const torrent, TorrentExportFolder folder = TorrentExportFolder::Regular); void saveTorrentResumeData(TorrentHandle *const torrent); - void handleAlert(libtorrent::alert *a); - void dispatchTorrentAlert(libtorrent::alert *a); - void handleAddTorrentAlert(libtorrent::add_torrent_alert *p); - void handleStateUpdateAlert(libtorrent::state_update_alert *p); - void handleMetadataReceivedAlert(libtorrent::metadata_received_alert *p); - void handleFileErrorAlert(libtorrent::file_error_alert *p); - void handleTorrentRemovedAlert(libtorrent::torrent_removed_alert *p); - void handleTorrentDeletedAlert(libtorrent::torrent_deleted_alert *p); - void handleTorrentDeleteFailedAlert(libtorrent::torrent_delete_failed_alert *p); - void handlePortmapWarningAlert(libtorrent::portmap_error_alert *p); - void handlePortmapAlert(libtorrent::portmap_alert *p); - void handlePeerBlockedAlert(libtorrent::peer_blocked_alert *p); - void handlePeerBanAlert(libtorrent::peer_ban_alert *p); - void handleUrlSeedAlert(libtorrent::url_seed_alert *p); - void handleListenSucceededAlert(libtorrent::listen_succeeded_alert *p); - void handleListenFailedAlert(libtorrent::listen_failed_alert *p); - void handleExternalIPAlert(libtorrent::external_ip_alert *p); - void handleSessionStatsAlert(libtorrent::session_stats_alert *p); + void handleAlert(const libtorrent::alert *a); + void dispatchTorrentAlert(const libtorrent::alert *a); + void handleAddTorrentAlert(const libtorrent::add_torrent_alert *p); + void handleStateUpdateAlert(const libtorrent::state_update_alert *p); + void handleMetadataReceivedAlert(const libtorrent::metadata_received_alert *p); + void handleFileErrorAlert(const libtorrent::file_error_alert *p); + void handleTorrentRemovedAlert(const libtorrent::torrent_removed_alert *p); + void handleTorrentDeletedAlert(const libtorrent::torrent_deleted_alert *p); + void handleTorrentDeleteFailedAlert(const libtorrent::torrent_delete_failed_alert *p); + void handlePortmapWarningAlert(const libtorrent::portmap_error_alert *p); + void handlePortmapAlert(const libtorrent::portmap_alert *p); + void handlePeerBlockedAlert(const libtorrent::peer_blocked_alert *p); + void handlePeerBanAlert(const libtorrent::peer_ban_alert *p); + void handleUrlSeedAlert(const libtorrent::url_seed_alert *p); + void handleListenSucceededAlert(const libtorrent::listen_succeeded_alert *p); + void handleListenFailedAlert(const libtorrent::listen_failed_alert *p); + void handleExternalIPAlert(const libtorrent::external_ip_alert *p); + void handleSessionStatsAlert(const libtorrent::session_stats_alert *p); void createTorrentHandle(const libtorrent::torrent_handle &nativeHandle); diff --git a/src/base/bittorrent/torrenthandle.cpp b/src/base/bittorrent/torrenthandle.cpp index 6cddf36ec..5261bc2cb 100644 --- a/src/base/bittorrent/torrenthandle.cpp +++ b/src/base/bittorrent/torrenthandle.cpp @@ -1717,7 +1717,7 @@ void TorrentHandle::handleAppendExtensionToggled() manageIncompleteFiles(); } -void TorrentHandle::handleAlert(libtorrent::alert *a) +void TorrentHandle::handleAlert(const libtorrent::alert *a) { switch (a->type()) { case libt::stats_alert::alert_type: diff --git a/src/base/bittorrent/torrenthandle.h b/src/base/bittorrent/torrenthandle.h index 096759c20..1f30ad892 100644 --- a/src/base/bittorrent/torrenthandle.h +++ b/src/base/bittorrent/torrenthandle.h @@ -358,7 +358,7 @@ namespace BitTorrent // Session interface libtorrent::torrent_handle nativeHandle() const; - void handleAlert(libtorrent::alert *a); + void handleAlert(const libtorrent::alert *a); void handleStateUpdate(const libtorrent::torrent_status &nativeStatus); void handleTempPathChanged(); void handleCategorySavePathChanged(); diff --git a/src/base/search/searchpluginmanager.cpp b/src/base/search/searchpluginmanager.cpp index 767859326..098979163 100644 --- a/src/base/search/searchpluginmanager.cpp +++ b/src/base/search/searchpluginmanager.cpp @@ -533,7 +533,7 @@ void SearchPluginManager::parseVersionInfo(const QByteArray &info) } } -bool SearchPluginManager::isUpdateNeeded(QString pluginName, PluginVersion newVersion) const +bool SearchPluginManager::isUpdateNeeded(const QString &pluginName, PluginVersion newVersion) const { PluginInfo *plugin = pluginInfo(pluginName); if (!plugin) return true; diff --git a/src/base/search/searchpluginmanager.h b/src/base/search/searchpluginmanager.h index e5aa6ce88..ac485807d 100644 --- a/src/base/search/searchpluginmanager.h +++ b/src/base/search/searchpluginmanager.h @@ -102,7 +102,7 @@ private: void updateNova(); void parseVersionInfo(const QByteArray &info); void installPlugin_impl(const QString &name, const QString &path); - bool isUpdateNeeded(QString pluginName, PluginVersion newVersion) const; + bool isUpdateNeeded(const QString &pluginName, PluginVersion newVersion) const; void versionInfoDownloaded(const QString &url, const QByteArray &data); void versionInfoDownloadFailed(const QString &url, const QString &reason); diff --git a/src/gui/mainwindow.cpp b/src/gui/mainwindow.cpp index 46ee3a16c..d2ecf2212 100644 --- a/src/gui/mainwindow.cpp +++ b/src/gui/mainwindow.cpp @@ -849,7 +849,7 @@ void MainWindow::finishedTorrent(BitTorrent::TorrentHandle *const torrent) const } // Notification when disk is full -void MainWindow::fullDiskError(BitTorrent::TorrentHandle *const torrent, QString msg) const +void MainWindow::fullDiskError(BitTorrent::TorrentHandle *const torrent, const QString &msg) const { showNotificationBaloon(tr("I/O Error", "i.e: Input/Output Error") , tr("An I/O error occurred for torrent '%1'.\n Reason: %2" @@ -963,7 +963,7 @@ void MainWindow::askRecursiveTorrentDownloadConfirmation(BitTorrent::TorrentHand confirmBox->show(); } -void MainWindow::handleDownloadFromUrlFailure(QString url, QString reason) const +void MainWindow::handleDownloadFromUrlFailure(const QString &url, const QString &reason) const { // Display a message box showNotificationBaloon(tr("URL download error") @@ -1061,7 +1061,7 @@ bool MainWindow::unlockUI() return true; } -void MainWindow::notifyOfUpdate(QString) +void MainWindow::notifyOfUpdate(const QString &) { // Show restart message m_statusBar->showRestartRequired(); @@ -1565,7 +1565,7 @@ void MainWindow::updateGUI() } } -void MainWindow::showNotificationBaloon(QString title, QString msg) const +void MainWindow::showNotificationBaloon(const QString &title, const QString &msg) const { if (!isNotificationsEnabled()) return; #if (defined(Q_OS_UNIX) && !defined(Q_OS_MAC)) && defined(QT_DBUS_LIB) diff --git a/src/gui/mainwindow.h b/src/gui/mainwindow.h index 2f346ed59..52168ad5e 100644 --- a/src/gui/mainwindow.h +++ b/src/gui/mainwindow.h @@ -99,20 +99,20 @@ public: void activate(); void cleanup(); - void showNotificationBaloon(QString title, QString msg) const; + void showNotificationBaloon(const QString &title, const QString &msg) const; private slots: void showFilterContextMenu(const QPoint &); void balloonClicked(); void writeSettings(); void readSettings(); - void fullDiskError(BitTorrent::TorrentHandle *const torrent, QString msg) const; - void handleDownloadFromUrlFailure(QString, QString) const; + void fullDiskError(BitTorrent::TorrentHandle *const torrent, const QString &msg) const; + void handleDownloadFromUrlFailure(const QString &, const QString &) const; void tabChanged(int newTab); bool defineUILockPassword(); void clearUILockPassword(); bool unlockUI(); - void notifyOfUpdate(QString); + void notifyOfUpdate(const QString &); void showConnectionSettings(); void minimizeWindow(); // Keyboard shortcuts diff --git a/src/gui/properties/trackerlistwidget.cpp b/src/gui/properties/trackerlistwidget.cpp index 40b1263a4..1af932331 100644 --- a/src/gui/properties/trackerlistwidget.cpp +++ b/src/gui/properties/trackerlistwidget.cpp @@ -149,7 +149,7 @@ QList TrackerListWidget::getSelectedTrackerItems() const return selectedTrackers; } -void TrackerListWidget::setRowColor(const int row, QColor color) +void TrackerListWidget::setRowColor(const int row, const QColor &color) { const int nbColumns = columnCount(); QTreeWidgetItem *item = topLevelItem(row); diff --git a/src/gui/properties/trackerlistwidget.h b/src/gui/properties/trackerlistwidget.h index 378023e27..8fcde45eb 100644 --- a/src/gui/properties/trackerlistwidget.h +++ b/src/gui/properties/trackerlistwidget.h @@ -69,7 +69,7 @@ public: int visibleColumnsCount() const; public slots: - void setRowColor(int row, QColor color); + void setRowColor(int row, const QColor &color); void moveSelectionUp(); void moveSelectionDown(); diff --git a/src/gui/search/pluginselectdialog.cpp b/src/gui/search/pluginselectdialog.cpp index 432154d93..3543eaa63 100644 --- a/src/gui/search/pluginselectdialog.cpp +++ b/src/gui/search/pluginselectdialog.cpp @@ -228,7 +228,7 @@ void PluginSelectDialog::enableSelection(bool enable) } // Set the color of a row in data model -void PluginSelectDialog::setRowColor(const int row, QString color) +void PluginSelectDialog::setRowColor(const int row, const QString &color) { QTreeWidgetItem *item = m_ui->pluginsTree->topLevelItem(row); for (int i = 0; i < m_ui->pluginsTree->columnCount(); ++i) { @@ -236,7 +236,7 @@ void PluginSelectDialog::setRowColor(const int row, QString color) } } -QList PluginSelectDialog::findItemsWithUrl(QString url) +QList PluginSelectDialog::findItemsWithUrl(const QString &url) { QList res; @@ -249,7 +249,7 @@ QList PluginSelectDialog::findItemsWithUrl(QString url) return res; } -QTreeWidgetItem *PluginSelectDialog::findItemWithID(QString id) +QTreeWidgetItem *PluginSelectDialog::findItemWithID(const QString &id) { for (int i = 0; i < m_ui->pluginsTree->topLevelItemCount(); ++i) { QTreeWidgetItem *item = m_ui->pluginsTree->topLevelItem(i); @@ -268,7 +268,7 @@ void PluginSelectDialog::loadSupportedSearchPlugins() addNewPlugin(name); } -void PluginSelectDialog::addNewPlugin(QString pluginName) +void PluginSelectDialog::addNewPlugin(const QString &pluginName) { QTreeWidgetItem *item = new QTreeWidgetItem(m_ui->pluginsTree); PluginInfo *plugin = m_pluginManager->pluginInfo(pluginName); diff --git a/src/gui/search/pluginselectdialog.h b/src/gui/search/pluginselectdialog.h index 7eadfda5e..c2754f8bf 100644 --- a/src/gui/search/pluginselectdialog.h +++ b/src/gui/search/pluginselectdialog.h @@ -51,8 +51,8 @@ public: explicit PluginSelectDialog(SearchPluginManager *pluginManager, QWidget *parent = nullptr); ~PluginSelectDialog(); - QList findItemsWithUrl(QString url); - QTreeWidgetItem *findItemWithID(QString id); + QList findItemsWithUrl(const QString &url); + QTreeWidgetItem *findItemWithID(const QString &id); protected: void dropEvent(QDropEvent *event) override; @@ -64,7 +64,7 @@ private slots: void on_installButton_clicked(); void on_closeButton_clicked(); void togglePluginState(QTreeWidgetItem*, int); - void setRowColor(int row, QString color); + void setRowColor(int row, const QString &color); void displayContextMenu(const QPoint &pos); void enableSelection(bool enable); void askForLocalPlugin(); @@ -81,7 +81,7 @@ private slots: private: void loadSupportedSearchPlugins(); - void addNewPlugin(QString pluginName); + void addNewPlugin(const QString &pluginName); void startAsyncOp(); void finishAsyncOp(); void finishPluginUpdate(); diff --git a/src/gui/search/searchwidget.cpp b/src/gui/search/searchwidget.cpp index 4b552b748..5ae242222 100644 --- a/src/gui/search/searchwidget.cpp +++ b/src/gui/search/searchwidget.cpp @@ -280,7 +280,7 @@ void SearchWidget::on_pluginsButton_clicked() new PluginSelectDialog(SearchPluginManager::instance(), this); } -void SearchWidget::searchTextEdited(QString) +void SearchWidget::searchTextEdited(const QString &) { // Enable search button m_ui->searchButton->setText(tr("Search")); diff --git a/src/gui/search/searchwidget.h b/src/gui/search/searchwidget.h index 153beea15..e303b569d 100644 --- a/src/gui/search/searchwidget.h +++ b/src/gui/search/searchwidget.h @@ -74,7 +74,7 @@ private: void fillCatCombobox(); void fillPluginComboBox(); void selectActivePage(); - void searchTextEdited(QString); + void searchTextEdited(const QString &); void updateButtons(); QString selectedCategory() const; diff --git a/src/gui/transferlistwidget.cpp b/src/gui/transferlistwidget.cpp index c46bb64e2..4fabfd69b 100644 --- a/src/gui/transferlistwidget.cpp +++ b/src/gui/transferlistwidget.cpp @@ -338,7 +338,7 @@ TransferListModel *TransferListWidget::getSourceModel() const return m_listModel; } -void TransferListWidget::previewFile(QString filePath) +void TransferListWidget::previewFile(const QString &filePath) { Utils::Misc::openPath(filePath); } @@ -854,7 +854,7 @@ void TransferListWidget::renameSelectedTorrent() } } -void TransferListWidget::setSelectionCategory(QString category) +void TransferListWidget::setSelectionCategory(const QString &category) { for (const QModelIndex &index : asConst(selectionModel()->selectedRows())) m_listModel->setData(m_listModel->index(mapToSource(index).row(), TransferListModel::TR_CATEGORY), category, Qt::DisplayRole); @@ -1173,7 +1173,7 @@ void TransferListWidget::currentChanged(const QModelIndex ¤t, const QModel emit currentTorrentChanged(torrent); } -void TransferListWidget::applyCategoryFilter(QString category) +void TransferListWidget::applyCategoryFilter(const QString &category) { if (category.isNull()) m_sortFilterModel->disableCategoryFilter(); diff --git a/src/gui/transferlistwidget.h b/src/gui/transferlistwidget.h index 2807d0325..ff29b97a3 100644 --- a/src/gui/transferlistwidget.h +++ b/src/gui/transferlistwidget.h @@ -56,7 +56,7 @@ public: TransferListModel *getSourceModel() const; public slots: - void setSelectionCategory(QString category); + void setSelectionCategory(const QString &category); void addSelectionTag(const QString &tag); void removeSelectionTag(const QString &tag); void clearSelectionTags(); @@ -90,11 +90,11 @@ public slots: void displayDLHoSMenu(const QPoint&); void applyNameFilter(const QString &name); void applyStatusFilter(int f); - void applyCategoryFilter(QString category); + void applyCategoryFilter(const QString &category); void applyTagFilter(const QString &tag); void applyTrackerFilterAll(); void applyTrackerFilter(const QStringList &hashes); - void previewFile(QString filePath); + void previewFile(const QString &filePath); void renameSelectedTorrent(); protected: