From: Mike Gelfand Date: Mon, 17 Aug 2015 08:14:45 +0000 (+0000) Subject: #5982: Simplify filter bar connections by using needed slot directly X-Git-Tag: 2.90~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1640a71127b2a0cef64e051d16ed2dfaec6e1d65;p=transmission #5982: Simplify filter bar connections by using needed slot directly --- diff --git a/qt/FilterBar.cc b/qt/FilterBar.cc index 52215c4b9..bfcee7924 100644 --- a/qt/FilterBar.cc +++ b/qt/FilterBar.cc @@ -251,10 +251,10 @@ FilterBar::FilterBar (Prefs& prefs, const TorrentModel& torrents, const TorrentF connect (myTrackerCombo, SIGNAL (currentIndexChanged (int)), this, SLOT (onTrackerIndexChanged (int))); 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 (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 (&myTorrents, SIGNAL (modelReset ()), this, SLOT (recountSoon ())); + connect (&myTorrents, SIGNAL (rowsInserted (QModelIndex, int, int)), this, SLOT (recountSoon ())); + connect (&myTorrents, SIGNAL (rowsRemoved (QModelIndex, int, int)), this, SLOT (recountSoon ())); + connect (&myTorrents, SIGNAL (dataChanged (QModelIndex, QModelIndex)), this, SLOT (recountSoon ())); connect (myRecountTimer, SIGNAL (timeout ()), this, SLOT (recount ())); recountSoon (); @@ -356,11 +356,6 @@ FilterBar::onActivityIndexChanged (int i) **** ***/ -void FilterBar::onTorrentModelReset () { recountSoon (); } -void FilterBar::onTorrentModelRowsInserted (const QModelIndex&, int, int) { recountSoon (); } -void FilterBar::onTorrentModelRowsRemoved (const QModelIndex&, int, int) { recountSoon (); } -void FilterBar::onTorrentModelDataChanged (const QModelIndex&, const QModelIndex&) { recountSoon (); } - void FilterBar::recountSoon () { diff --git a/qt/FilterBar.h b/qt/FilterBar.h index 6c094a0bf..025d188c4 100644 --- a/qt/FilterBar.h +++ b/qt/FilterBar.h @@ -33,20 +33,16 @@ class FilterBar: public QWidget private: FilterBarComboBox * createTrackerCombo (QStandardItemModel *); FilterBarComboBox * createActivityCombo (); - void recountSoon (); void refreshTrackers (); QString getCountString (int n) const; private slots: + void recountSoon (); void recount (); void refreshPref (int key); void refreshCountLabel (); void onActivityIndexChanged (int index); void onTrackerIndexChanged (int index); - void onTorrentModelReset (); - void onTorrentModelRowsInserted (const QModelIndex&, int, int); - void onTorrentModelRowsRemoved (const QModelIndex&, int, int); - void onTorrentModelDataChanged (const QModelIndex&, const QModelIndex&); void onTextChanged (const QString&); private: