]> granicus.if.org Git - transmission/commitdiff
(qt) #3269: When changing session source we should request a full refresh right away
authorDaniel Lee <Longinus00@gmail.com>
Wed, 16 Jun 2010 03:11:10 +0000 (03:11 +0000)
committerDaniel Lee <Longinus00@gmail.com>
Wed, 16 Jun 2010 03:11:10 +0000 (03:11 +0000)
r10770 is actually for #3282: After removing a torrent list jumps to the very top

qt/app.cc
qt/app.h

index 8ef9952a946227a067f235c2a66d44beeeff392c..1d8966ce9e66e3d0313c97d02a2d451a32a06083 100644 (file)
--- a/qt/app.cc
+++ b/qt/app.cc
@@ -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( )
 {
index 4d8b2c052f59ac40f412c75893909a994839c230..a04b07f53185ce41438ff5f64b3a09a880df482b 100644 (file)
--- a/qt/app.h
+++ b/qt/app.h
@@ -46,6 +46,7 @@ class MyApp: public QApplication
 
     private slots:
         void consentGiven( );
+        void onSessionSourceChanged( );
         void refreshPref( int key );
         void refreshTorrents( );