From 365b28bc81a3ec4a01fcf217c70c882956d20449 Mon Sep 17 00:00:00 2001 From: Mike Gelfand Date: Sat, 13 Dec 2014 09:04:10 +0000 Subject: [PATCH] Strip needless const& specifiers on SIGNAL and SLOT arguments (Qt client) --- qt/details.cc | 18 +++++++++--------- qt/file-tree.cc | 24 ++++++++++++------------ qt/filterbar.cc | 10 +++++----- qt/freespace-label.cc | 4 ++-- qt/mainwin.cc | 20 ++++++++++---------- qt/make-dialog.cc | 12 ++++++------ qt/options.cc | 10 +++++----- qt/session.cc | 4 ++-- qt/session.h | 2 +- qt/watchdir.cc | 4 ++-- 10 files changed, 54 insertions(+), 54 deletions(-) diff --git a/qt/details.cc b/qt/details.cc index a950bf515..a15522292 100644 --- a/qt/details.cc +++ b/qt/details.cc @@ -1285,7 +1285,7 @@ Details::createTrackerTab () myTrackerView->setItemsExpandable (false); myTrackerView->setAlternatingRowColors (true); myTrackerView->setItemDelegate (myTrackerDelegate = new TrackerDelegate ()); - connect (myTrackerView->selectionModel (), SIGNAL (selectionChanged (const QItemSelection&, const QItemSelection&)), this, SLOT (onTrackerSelectionChanged ())); + connect (myTrackerView->selectionModel (), SIGNAL (selectionChanged (QItemSelection, QItemSelection)), this, SLOT (onTrackerSelectionChanged ())); h->addWidget (myTrackerView, 1); p = new QPushButton (); @@ -1384,17 +1384,17 @@ Details::createFilesTab () { myFileTreeView = new FileTreeView (); - connect (myFileTreeView, SIGNAL ( priorityChanged (const QSet&, int)), - this, SLOT ( onFilePriorityChanged (const QSet&, int))); + connect (myFileTreeView, SIGNAL ( priorityChanged (QSet, int)), + this, SLOT ( onFilePriorityChanged (QSet, int))); - connect (myFileTreeView, SIGNAL ( wantedChanged (const QSet&, bool)), - this, SLOT ( onFileWantedChanged (const QSet&, bool))); + connect (myFileTreeView, SIGNAL ( wantedChanged (QSet, bool)), + this, SLOT ( onFileWantedChanged (QSet, bool))); - connect (myFileTreeView, SIGNAL (pathEdited (const QString&, const QString&)), - this, SLOT (onPathEdited (const QString&, const QString&))); + connect (myFileTreeView, SIGNAL (pathEdited (QString, QString)), + this, SLOT (onPathEdited (QString, QString))); - connect (myFileTreeView, SIGNAL (openRequested (const QString&)), - this, SLOT (onOpenRequested (const QString&))); + connect (myFileTreeView, SIGNAL (openRequested (QString)), + this, SLOT (onOpenRequested (QString))); return myFileTreeView; } diff --git a/qt/file-tree.cc b/qt/file-tree.cc index d895076e5..cd6bf6953 100644 --- a/qt/file-tree.cc +++ b/qt/file-tree.cc @@ -892,23 +892,23 @@ FileTreeView::FileTreeView (QWidget * parent, bool isEditable): #endif } - connect (this, SIGNAL(clicked(const QModelIndex&)), - this, SLOT(onClicked(const QModelIndex&))); + connect (this, SIGNAL(clicked(QModelIndex)), + this, SLOT(onClicked(QModelIndex))); - connect (this, SIGNAL(doubleClicked(const QModelIndex&)), - this, SLOT(onDoubleClicked(const QModelIndex&))); + connect (this, SIGNAL(doubleClicked(QModelIndex)), + this, SLOT(onDoubleClicked(QModelIndex))); - connect (&myModel, SIGNAL(priorityChanged(const QSet&, int)), - this, SIGNAL(priorityChanged(const QSet&, int))); + connect (&myModel, SIGNAL(priorityChanged(QSet, int)), + this, SIGNAL(priorityChanged(QSet, int))); - connect (&myModel, SIGNAL(wantedChanged(const QSet&, bool)), - this, SIGNAL(wantedChanged(const QSet&, bool))); + connect (&myModel, SIGNAL(wantedChanged(QSet, bool)), + this, SIGNAL(wantedChanged(QSet, bool))); - connect (&myModel, SIGNAL(pathEdited(const QString&, const QString&)), - this, SIGNAL(pathEdited(const QString&, const QString&))); + connect (&myModel, SIGNAL(pathEdited(QString, QString)), + this, SIGNAL(pathEdited(QString, QString))); - connect (&myModel, SIGNAL (openRequested (const QString&)), - this, SLOT (onOpenRequested (const QString&)), + connect (&myModel, SIGNAL (openRequested (QString)), + this, SLOT (onOpenRequested (QString)), Qt::QueuedConnection); } diff --git a/qt/filterbar.cc b/qt/filterbar.cc index faf1041fc..d0e59df5c 100644 --- a/qt/filterbar.cc +++ b/qt/filterbar.cc @@ -461,12 +461,12 @@ FilterBar::FilterBar (Prefs& prefs, TorrentModel& torrents, TorrentFilter& filte connect (&myPrefs, SIGNAL (changed (int)), this, SLOT (refreshPref (int))); connect (myActivityCombo, SIGNAL (currentIndexChanged (int)), this, SLOT (onActivityIndexChanged (int))); connect (myTrackerCombo, SIGNAL (currentIndexChanged (int)), this, SLOT (onTrackerIndexChanged (int))); - connect (&myFilter, SIGNAL (rowsInserted (const QModelIndex&,int,int)), this, SLOT (refreshCountLabel ())); - connect (&myFilter, SIGNAL (rowsRemoved (const QModelIndex&,int,int)), this, SLOT (refreshCountLabel ())); + connect (&myFilter, SIGNAL (rowsInserted (QModelIndex, int, int)), this, SLOT (refreshCountLabel ())); + connect (&myFilter, SIGNAL (rowsRemoved (QModelIndex, int, int)), this, SLOT (refreshCountLabel ())); connect (&myTorrents, SIGNAL (modelReset ()), this, SLOT (onTorrentModelReset ())); - connect (&myTorrents, SIGNAL (rowsInserted (const QModelIndex&,int,int)), this, SLOT (onTorrentModelRowsInserted (const QModelIndex&,int,int))); - connect (&myTorrents, SIGNAL (rowsRemoved (const QModelIndex&,int,int)), this, SLOT (onTorrentModelRowsRemoved (const QModelIndex&,int,int))); - connect (&myTorrents, SIGNAL (dataChanged (const QModelIndex&,const QModelIndex&)), this, SLOT (onTorrentModelDataChanged (const QModelIndex&,const QModelIndex&))); + connect (&myTorrents, SIGNAL (rowsInserted (QModelIndex, int, int)), this, SLOT (onTorrentModelRowsInserted (QModelIndex, int, int))); + connect (&myTorrents, SIGNAL (rowsRemoved (QModelIndex, int, int)), this, SLOT (onTorrentModelRowsRemoved (QModelIndex, int, int))); + connect (&myTorrents, SIGNAL (dataChanged (QModelIndex, QModelIndex)), this, SLOT (onTorrentModelDataChanged (QModelIndex, QModelIndex))); connect (myRecountTimer, SIGNAL (timeout ()), this, SLOT (recount ())); recountSoon (); diff --git a/qt/freespace-label.cc b/qt/freespace-label.cc index 20b3d4636..f29e55036 100644 --- a/qt/freespace-label.cc +++ b/qt/freespace-label.cc @@ -33,8 +33,8 @@ FreespaceLabel::FreespaceLabel (Session & session, connect (&myTimer, SIGNAL(timeout()), this, SLOT(onTimer())); - connect (&mySession, SIGNAL(executed(int64_t, const QString&, tr_variant *)), - this, SLOT(onSessionExecuted(int64_t, const QString&, tr_variant *))); + connect (&mySession, SIGNAL(executed(int64_t, QString, tr_variant *)), + this, SLOT(onSessionExecuted(int64_t, QString, tr_variant *))); setPath (path); } diff --git a/qt/mainwin.cc b/qt/mainwin.cc index 2937419ec..7add920e1 100644 --- a/qt/mainwin.cc +++ b/qt/mainwin.cc @@ -184,26 +184,26 @@ TrMainWindow::TrMainWindow (Session& session, Prefs& prefs, TorrentModel& model, connect (ui.action_Properties, SIGNAL (triggered ()), this, SLOT (openProperties ())); connect (ui.action_SessionDialog, SIGNAL (triggered ()), mySessionDialog, SLOT (show ())); - connect (ui.listView, SIGNAL (activated (const QModelIndex&)), ui.action_Properties, SLOT (trigger ())); + connect (ui.listView, SIGNAL (activated (QModelIndex)), ui.action_Properties, SLOT (trigger ())); // signals connect (ui.action_SelectAll, SIGNAL (triggered ()), ui.listView, SLOT (selectAll ())); connect (ui.action_DeselectAll, SIGNAL (triggered ()), ui.listView, SLOT (clearSelection ())); - connect (&myFilterModel, SIGNAL (rowsInserted (const QModelIndex&,int,int)), this, SLOT (refreshActionSensitivitySoon ())); - connect (&myFilterModel, SIGNAL (rowsRemoved (const QModelIndex&,int,int)), this, SLOT (refreshActionSensitivitySoon ())); + connect (&myFilterModel, SIGNAL (rowsInserted (QModelIndex, int, int)), this, SLOT (refreshActionSensitivitySoon ())); + connect (&myFilterModel, SIGNAL (rowsRemoved (QModelIndex, int, int)), this, SLOT (refreshActionSensitivitySoon ())); connect (ui.action_Quit, SIGNAL (triggered ()), QCoreApplication::instance (), SLOT (quit ())); // torrent view myFilterModel.setSourceModel (&myModel); connect (&myModel, SIGNAL (modelReset ()), this, SLOT (onModelReset ())); - connect (&myModel, SIGNAL (rowsRemoved (const QModelIndex&,int,int)), this, SLOT (onModelReset ())); - connect (&myModel, SIGNAL (rowsInserted (const QModelIndex&,int,int)), this, SLOT (onModelReset ())); - connect (&myModel, SIGNAL (dataChanged (const QModelIndex&,const QModelIndex&)), this, SLOT (refreshTrayIconSoon ())); + connect (&myModel, SIGNAL (rowsRemoved (QModelIndex, int, int)), this, SLOT (onModelReset ())); + connect (&myModel, SIGNAL (rowsInserted (QModelIndex, int, int)), this, SLOT (onModelReset ())); + connect (&myModel, SIGNAL (dataChanged (QModelIndex, QModelIndex)), this, SLOT (refreshTrayIconSoon ())); ui.listView->setModel (&myFilterModel); - connect (ui.listView->selectionModel (), SIGNAL (selectionChanged (const QItemSelection&,const QItemSelection&)), this, SLOT (refreshActionSensitivitySoon ())); + connect (ui.listView->selectionModel (), SIGNAL (selectionChanged (QItemSelection, QItemSelection)), this, SLOT (refreshActionSensitivitySoon ())); QActionGroup * actionGroup = new QActionGroup (this); actionGroup->addAction (ui.action_SortByActivity); @@ -273,7 +273,7 @@ TrMainWindow::TrMainWindow (Session& session, Prefs& prefs, TorrentModel& model, connect (&mySession, SIGNAL (dataSendProgress ()), this, SLOT (dataSendProgress ())); connect (&mySession, SIGNAL (httpAuthenticationRequired ()), this, SLOT (wrongAuthentication ())); connect (&mySession, SIGNAL (error (QNetworkReply::NetworkError)), this, SLOT (onError (QNetworkReply::NetworkError))); - connect (&mySession, SIGNAL (errorMessage (const QString)), this, SLOT (errorMessage(const QString))); + connect (&mySession, SIGNAL (errorMessage (QString)), this, SLOT (errorMessage(QString))); if (mySession.isServer ()) { @@ -1174,8 +1174,8 @@ TrMainWindow::openTorrent () } l->addWidget (b, l->rowCount(), 0, 1, -1, Qt::AlignLeft); - connect (d, SIGNAL (filesSelected (const QStringList&)), - this, SLOT (addTorrents (const QStringList&))); + connect (d, SIGNAL (filesSelected (QStringList)), + this, SLOT (addTorrents (QStringList))); d->show (); } diff --git a/qt/make-dialog.cc b/qt/make-dialog.cc index d6540c9ae..197176d4f 100644 --- a/qt/make-dialog.cc +++ b/qt/make-dialog.cc @@ -177,8 +177,8 @@ MakeDialog::onFileClicked () QFileDialog * d = new QFileDialog (this, tr ("Select File")); d->setFileMode (QFileDialog::ExistingFile); d->setAttribute (Qt::WA_DeleteOnClose); - connect (d, SIGNAL(filesSelected(const QStringList&)), - this, SLOT(onFileSelected(const QStringList&))); + connect (d, SIGNAL(filesSelected(QStringList)), + this, SLOT(onFileSelected(QStringList))); d->show (); } void @@ -202,8 +202,8 @@ MakeDialog::onFolderClicked () d->setFileMode (QFileDialog::Directory); d->setOption (QFileDialog::ShowDirsOnly); d->setAttribute (Qt::WA_DeleteOnClose); - connect (d, SIGNAL(filesSelected(const QStringList&)), - this, SLOT(onFolderSelected(const QStringList&))); + connect (d, SIGNAL(filesSelected(QStringList)), + this, SLOT(onFolderSelected(QStringList))); d->show (); } @@ -229,8 +229,8 @@ MakeDialog::onDestinationClicked () d->setFileMode (QFileDialog::Directory); d->setOption (QFileDialog::ShowDirsOnly); d->setAttribute (Qt::WA_DeleteOnClose); - connect (d, SIGNAL(filesSelected(const QStringList&)), - this, SLOT(onDestinationSelected(const QStringList&))); + connect (d, SIGNAL(filesSelected(QStringList)), + this, SLOT(onDestinationSelected(QStringList))); d->show (); } void diff --git a/qt/options.cc b/qt/options.cc index 552ba1725..681a212cc 100644 --- a/qt/options.cc +++ b/qt/options.cc @@ -132,7 +132,7 @@ Options::Options (Session& session, const Prefs& prefs, const AddData& addme, QW e->setText (downloadDir); layout->addWidget (e, row, 1); l->setBuddy (e); - connect (e, SIGNAL (textEdited (const QString&)), this, SLOT (onDestinationEdited (const QString&))); + connect (e, SIGNAL (textEdited (QString)), this, SLOT (onDestinationEdited (QString))); } l = myFreespaceLabel; @@ -179,8 +179,8 @@ Options::Options (Session& session, const Prefs& prefs, const AddData& addme, QW layout->setColumnStretch (1, 2); layout->setSpacing (HIG::PAD); - connect (myTree, SIGNAL (priorityChanged (const QSet&,int)), this, SLOT (onPriorityChanged (const QSet&,int))); - connect (myTree, SIGNAL (wantedChanged (const QSet&,bool)), this, SLOT (onWantedChanged (const QSet&,bool))); + connect (myTree, SIGNAL (priorityChanged (QSet, int)), this, SLOT (onPriorityChanged (QSet, int))); + connect (myTree, SIGNAL (wantedChanged (QSet, bool)), this, SLOT (onWantedChanged (QSet, bool))); if (session.isLocal ()) connect (myVerifyButton, SIGNAL (clicked (bool)), this, SLOT (onVerify ())); @@ -405,7 +405,7 @@ Options::onFilenameClicked () tr ("Torrent Files (*.torrent);;All Files (*.*)")); d->setFileMode (QFileDialog::ExistingFile); d->setAttribute (Qt::WA_DeleteOnClose); - connect (d, SIGNAL (filesSelected (const QStringList&)), this, SLOT (onFilesSelected (const QStringList&))); + connect (d, SIGNAL (filesSelected (QStringList)), this, SLOT (onFilesSelected (QStringList))); d->show (); } } @@ -433,7 +433,7 @@ Options::onDestinationClicked () QFileDialog * d = new QFileDialog (this, tr ("Select Destination"), myLocalDestination.absolutePath ()); d->setFileMode (QFileDialog::Directory); d->setAttribute (Qt::WA_DeleteOnClose); - connect (d, SIGNAL (filesSelected (const QStringList&)), this, SLOT (onDestinationsSelected (const QStringList&))); + connect (d, SIGNAL (filesSelected (QStringList)), this, SLOT (onDestinationsSelected (QStringList))); d->show (); } diff --git a/qt/session.cc b/qt/session.cc index 84f7f7ad8..65019cf24 100644 --- a/qt/session.cc +++ b/qt/session.cc @@ -305,8 +305,8 @@ Session::Session (const char * configDir, Prefs& prefs): connect (&myPrefs, SIGNAL (changed (int)), this, SLOT (updatePref (int))); - connect (this, SIGNAL (responseReceived (const QByteArray&)), - this, SLOT (onResponseReceived (const QByteArray&))); + connect (this, SIGNAL (responseReceived (QByteArray)), + this, SLOT (onResponseReceived (QByteArray))); } Session::~Session () diff --git a/qt/session.h b/qt/session.h index f91ad7284..73ef70ff1 100644 --- a/qt/session.h +++ b/qt/session.h @@ -162,7 +162,7 @@ class Session: public QObject void dataReadProgress (); void dataSendProgress (); void error (QNetworkReply::NetworkError); - void errorMessage (const QString); + void errorMessage (const QString&); void httpAuthenticationRequired (); private: diff --git a/qt/watchdir.cc b/qt/watchdir.cc index 91ce7f387..c059bda67 100644 --- a/qt/watchdir.cc +++ b/qt/watchdir.cc @@ -89,8 +89,8 @@ WatchDir::setPath (const QString& path, bool isEnabled) { myWatcher = new QFileSystemWatcher (); myWatcher->addPath( path ); - connect (myWatcher, SIGNAL(directoryChanged(const QString&)), - this, SLOT(watcherActivated(const QString&))); + connect (myWatcher, SIGNAL(directoryChanged(QString)), + this, SLOT(watcherActivated(QString))); //std::cerr << "watching " << qPrintable(path) << " for new .torrent files" << std::endl; QTimer::singleShot (0, this, SLOT (rescanAllWatchedDirectories ())); // trigger the watchdir for .torrent files in there already } -- 2.40.0