Changeset 14560


Ignore:
Timestamp:
Aug 17, 2015, 8:14:45 AM (6 years ago)
Author:
mikedld
Message:

#5982: Simplify filter bar connections by using needed slot directly

Location:
trunk/qt
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/FilterBar.cc

    r14539 r14560  
    252252  connect (&myFilter, SIGNAL (rowsInserted (QModelIndex, int, int)), this, SLOT (refreshCountLabel ()));
    253253  connect (&myFilter, SIGNAL (rowsRemoved (QModelIndex, int, int)), this, SLOT (refreshCountLabel ()));
    254   connect (&myTorrents, SIGNAL (modelReset ()), this, SLOT (onTorrentModelReset ()));
    255   connect (&myTorrents, SIGNAL (rowsInserted (QModelIndex, int, int)), this, SLOT (onTorrentModelRowsInserted (QModelIndex, int, int)));
    256   connect (&myTorrents, SIGNAL (rowsRemoved (QModelIndex, int, int)), this, SLOT (onTorrentModelRowsRemoved (QModelIndex, int, int)));
    257   connect (&myTorrents, SIGNAL (dataChanged (QModelIndex, QModelIndex)), this, SLOT (onTorrentModelDataChanged (QModelIndex, QModelIndex)));
     254  connect (&myTorrents, SIGNAL (modelReset ()), this, SLOT (recountSoon ()));
     255  connect (&myTorrents, SIGNAL (rowsInserted (QModelIndex, int, int)), this, SLOT (recountSoon ()));
     256  connect (&myTorrents, SIGNAL (rowsRemoved (QModelIndex, int, int)), this, SLOT (recountSoon ()));
     257  connect (&myTorrents, SIGNAL (dataChanged (QModelIndex, QModelIndex)), this, SLOT (recountSoon ()));
    258258  connect (myRecountTimer, SIGNAL (timeout ()), this, SLOT (recount ()));
    259259
     
    357357***/
    358358
    359 void FilterBar::onTorrentModelReset () { recountSoon (); }
    360 void FilterBar::onTorrentModelRowsInserted (const QModelIndex&, int, int) { recountSoon (); }
    361 void FilterBar::onTorrentModelRowsRemoved (const QModelIndex&, int, int) { recountSoon (); }
    362 void FilterBar::onTorrentModelDataChanged (const QModelIndex&, const QModelIndex&) { recountSoon (); }
    363 
    364359void
    365360FilterBar::recountSoon ()
  • trunk/qt/FilterBar.h

    r14539 r14560  
    3434    FilterBarComboBox * createTrackerCombo (QStandardItemModel *);
    3535    FilterBarComboBox * createActivityCombo ();
    36     void recountSoon ();
    3736    void refreshTrackers ();
    3837    QString getCountString (int n) const;
    3938
    4039  private slots:
     40    void recountSoon ();
    4141    void recount ();
    4242    void refreshPref (int key);
     
    4444    void onActivityIndexChanged (int index);
    4545    void onTrackerIndexChanged (int index);
    46     void onTorrentModelReset ();
    47     void onTorrentModelRowsInserted (const QModelIndex&, int, int);
    48     void onTorrentModelRowsRemoved (const QModelIndex&, int, int);
    49     void onTorrentModelDataChanged (const QModelIndex&, const QModelIndex&);
    5046    void onTextChanged (const QString&);
    5147
Note: See TracChangeset for help on using the changeset viewer.