mirror of
https://github.com/transmission/transmission
synced 2025-03-10 06:02:57 +00:00
(trunk qt) fix remove-torrent filtering error reported by W4pp
This commit is contained in:
parent
2b42c00c45
commit
ccd02666ee
3 changed files with 9 additions and 1 deletions
|
@ -188,6 +188,9 @@ TrMainWindow :: TrMainWindow( Session& session, Prefs& prefs, TorrentModel& mode
|
|||
|
||||
// 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()));
|
||||
ui.listView->setModel( &myFilterModel );
|
||||
connect( ui.listView->selectionModel(), SIGNAL(selectionChanged(const QItemSelection&,const QItemSelection&)), this, SLOT(refreshActionSensitivity()));
|
||||
|
||||
|
@ -278,6 +281,11 @@ void
|
|||
TrMainWindow :: onSessionSourceChanged( )
|
||||
{
|
||||
myModel.clear( );
|
||||
}
|
||||
|
||||
void
|
||||
TrMainWindow :: onModelReset( )
|
||||
{
|
||||
refreshTitle( );
|
||||
refreshVisibleCount( );
|
||||
refreshActionSensitivity( );
|
||||
|
|
|
@ -121,6 +121,7 @@ class TrMainWindow: public QMainWindow
|
|||
void onSetPrefs( );
|
||||
void onSetPrefs( bool );
|
||||
void onSessionSourceChanged( );
|
||||
void onModelReset( );
|
||||
|
||||
private slots:
|
||||
void setSortPref ( int );
|
||||
|
|
|
@ -204,7 +204,6 @@ TorrentModel :: removeTorrent( int id )
|
|||
if( row >= 0 )
|
||||
{
|
||||
Torrent * tor = myIdToTorrent.value( id, 0 );
|
||||
std::cerr << "removing torrent " << id << std::endl;
|
||||
|
||||
beginRemoveRows( QModelIndex(), row, row );
|
||||
myIdToRow.remove( id );
|
||||
|
|
Loading…
Add table
Reference in a new issue