From 7e535bc2278383756f6e07b429387ac3d336368c Mon Sep 17 00:00:00 2001 From: Daniel Lee Date: Wed, 16 Jun 2010 03:11:10 +0000 Subject: [PATCH] (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 --- qt/app.cc | 10 ++++++++++ qt/app.h | 1 + 2 files changed, 11 insertions(+) diff --git a/qt/app.cc b/qt/app.cc index 8ef9952a9..1d8966ce9 100644 --- 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)), mySession, SLOT(initTorrents(QSet)) ); @@ -299,6 +301,14 @@ MyApp :: maybeUpdateBlocklist( ) } } +void +MyApp :: onSessionSourceChanged( ) +{ + mySession->initTorrents( ); + mySession->refreshSessionStats( ); + mySession->refreshSessionInfo( ); +} + void MyApp :: refreshTorrents( ) { diff --git a/qt/app.h b/qt/app.h index 4d8b2c052..a04b07f53 100644 --- 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( );