mirror of
https://github.com/qbittorrent/qBittorrent.git
synced 2025-01-06 15:04:34 +08:00
Convert pass-by-value arguments to const refs where applicable
This commit is contained in:
parent
ca3ce87e06
commit
445adb0ab4
@ -43,7 +43,7 @@ PeerAddress::PeerAddress()
|
||||
{
|
||||
}
|
||||
|
||||
PeerAddress::PeerAddress(QHostAddress ip, ushort port)
|
||||
PeerAddress::PeerAddress(const QHostAddress &ip, ushort port)
|
||||
: ip(ip)
|
||||
, port(port)
|
||||
{
|
||||
|
@ -45,7 +45,7 @@ namespace BitTorrent
|
||||
ushort port;
|
||||
|
||||
PeerAddress();
|
||||
PeerAddress(QHostAddress ip, ushort port);
|
||||
PeerAddress(const QHostAddress &ip, ushort port);
|
||||
};
|
||||
|
||||
class PeerInfo
|
||||
|
@ -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<libt::metadata_received_alert*>(a));
|
||||
handleMetadataReceivedAlert(static_cast<const libt::metadata_received_alert*>(a));
|
||||
dispatchTorrentAlert(a);
|
||||
break;
|
||||
case libt::state_update_alert::alert_type:
|
||||
handleStateUpdateAlert(static_cast<libt::state_update_alert*>(a));
|
||||
handleStateUpdateAlert(static_cast<const libt::state_update_alert*>(a));
|
||||
break;
|
||||
case libt::session_stats_alert::alert_type:
|
||||
handleSessionStatsAlert(static_cast<libt::session_stats_alert*>(a));
|
||||
handleSessionStatsAlert(static_cast<const libt::session_stats_alert*>(a));
|
||||
break;
|
||||
case libt::file_error_alert::alert_type:
|
||||
handleFileErrorAlert(static_cast<libt::file_error_alert*>(a));
|
||||
handleFileErrorAlert(static_cast<const libt::file_error_alert*>(a));
|
||||
break;
|
||||
case libt::add_torrent_alert::alert_type:
|
||||
handleAddTorrentAlert(static_cast<libt::add_torrent_alert*>(a));
|
||||
handleAddTorrentAlert(static_cast<const libt::add_torrent_alert*>(a));
|
||||
break;
|
||||
case libt::torrent_removed_alert::alert_type:
|
||||
handleTorrentRemovedAlert(static_cast<libt::torrent_removed_alert*>(a));
|
||||
handleTorrentRemovedAlert(static_cast<const libt::torrent_removed_alert*>(a));
|
||||
break;
|
||||
case libt::torrent_deleted_alert::alert_type:
|
||||
handleTorrentDeletedAlert(static_cast<libt::torrent_deleted_alert*>(a));
|
||||
handleTorrentDeletedAlert(static_cast<const libt::torrent_deleted_alert*>(a));
|
||||
break;
|
||||
case libt::torrent_delete_failed_alert::alert_type:
|
||||
handleTorrentDeleteFailedAlert(static_cast<libt::torrent_delete_failed_alert*>(a));
|
||||
handleTorrentDeleteFailedAlert(static_cast<const libt::torrent_delete_failed_alert*>(a));
|
||||
break;
|
||||
case libt::portmap_error_alert::alert_type:
|
||||
handlePortmapWarningAlert(static_cast<libt::portmap_error_alert*>(a));
|
||||
handlePortmapWarningAlert(static_cast<const libt::portmap_error_alert*>(a));
|
||||
break;
|
||||
case libt::portmap_alert::alert_type:
|
||||
handlePortmapAlert(static_cast<libt::portmap_alert*>(a));
|
||||
handlePortmapAlert(static_cast<const libt::portmap_alert*>(a));
|
||||
break;
|
||||
case libt::peer_blocked_alert::alert_type:
|
||||
handlePeerBlockedAlert(static_cast<libt::peer_blocked_alert*>(a));
|
||||
handlePeerBlockedAlert(static_cast<const libt::peer_blocked_alert*>(a));
|
||||
break;
|
||||
case libt::peer_ban_alert::alert_type:
|
||||
handlePeerBanAlert(static_cast<libt::peer_ban_alert*>(a));
|
||||
handlePeerBanAlert(static_cast<const libt::peer_ban_alert*>(a));
|
||||
break;
|
||||
case libt::url_seed_alert::alert_type:
|
||||
handleUrlSeedAlert(static_cast<libt::url_seed_alert*>(a));
|
||||
handleUrlSeedAlert(static_cast<const libt::url_seed_alert*>(a));
|
||||
break;
|
||||
case libt::listen_succeeded_alert::alert_type:
|
||||
handleListenSucceededAlert(static_cast<libt::listen_succeeded_alert*>(a));
|
||||
handleListenSucceededAlert(static_cast<const libt::listen_succeeded_alert*>(a));
|
||||
break;
|
||||
case libt::listen_failed_alert::alert_type:
|
||||
handleListenFailedAlert(static_cast<libt::listen_failed_alert*>(a));
|
||||
handleListenFailedAlert(static_cast<const libt::listen_failed_alert*>(a));
|
||||
break;
|
||||
case libt::external_ip_alert::alert_type:
|
||||
handleExternalIPAlert(static_cast<libt::external_ip_alert*>(a));
|
||||
handleExternalIPAlert(static_cast<const libt::external_ip_alert*>(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<const libt::torrent_alert*>(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);
|
||||
|
@ -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);
|
||||
|
||||
|
@ -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:
|
||||
|
@ -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();
|
||||
|
@ -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;
|
||||
|
@ -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);
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -149,7 +149,7 @@ QList<QTreeWidgetItem*> 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);
|
||||
|
@ -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();
|
||||
|
@ -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<QTreeWidgetItem*> PluginSelectDialog::findItemsWithUrl(QString url)
|
||||
QList<QTreeWidgetItem*> PluginSelectDialog::findItemsWithUrl(const QString &url)
|
||||
{
|
||||
QList<QTreeWidgetItem*> res;
|
||||
|
||||
@ -249,7 +249,7 @@ QList<QTreeWidgetItem*> 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);
|
||||
|
@ -51,8 +51,8 @@ public:
|
||||
explicit PluginSelectDialog(SearchPluginManager *pluginManager, QWidget *parent = nullptr);
|
||||
~PluginSelectDialog();
|
||||
|
||||
QList<QTreeWidgetItem*> findItemsWithUrl(QString url);
|
||||
QTreeWidgetItem *findItemWithID(QString id);
|
||||
QList<QTreeWidgetItem*> 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();
|
||||
|
@ -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"));
|
||||
|
@ -74,7 +74,7 @@ private:
|
||||
void fillCatCombobox();
|
||||
void fillPluginComboBox();
|
||||
void selectActivePage();
|
||||
void searchTextEdited(QString);
|
||||
void searchTextEdited(const QString &);
|
||||
void updateButtons();
|
||||
|
||||
QString selectedCategory() const;
|
||||
|
@ -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();
|
||||
|
@ -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:
|
||||
|
Loading…
Reference in New Issue
Block a user