1
0
Fork 0
mirror of https://github.com/transmission/transmission synced 2025-03-10 06:02:57 +00:00

(qt) #3269: When changing session source we should request a full refresh right away

r10770 is actually for #3282: After removing a torrent list jumps to the very top
This commit is contained in:
Daniel Lee 2010-06-16 03:11:10 +00:00
parent 13b073fcdc
commit 7e535bc227
2 changed files with 11 additions and 0 deletions

View file

@ -159,6 +159,8 @@ MyApp :: MyApp( int& argc, char ** argv ):
connect( mySession, SIGNAL(torrentsUpdated(tr_benc*,bool)), myModel, SLOT(updateTorrents(tr_benc*,bool)) );
connect( mySession, SIGNAL(torrentsUpdated(tr_benc*,bool)), myWindow, SLOT(refreshActionSensitivity()) );
connect( mySession, SIGNAL(torrentsRemoved(tr_benc*)), myModel, SLOT(removeTorrents(tr_benc*)) );
// when the session source gets changed, request a full refresh
connect( mySession, SIGNAL(sourceChanged()), this, SLOT(onSessionSourceChanged()) );
// when the model sees a torrent for the first time, ask the session for full info on it
connect( myModel, SIGNAL(torrentsAdded(QSet<int>)), mySession, SLOT(initTorrents(QSet<int>)) );
@ -299,6 +301,14 @@ MyApp :: maybeUpdateBlocklist( )
}
}
void
MyApp :: onSessionSourceChanged( )
{
mySession->initTorrents( );
mySession->refreshSessionStats( );
mySession->refreshSessionInfo( );
}
void
MyApp :: refreshTorrents( )
{

View file

@ -46,6 +46,7 @@ class MyApp: public QApplication
private slots:
void consentGiven( );
void onSessionSourceChanged( );
void refreshPref( int key );
void refreshTorrents( );