From: Daniel Lee Date: Wed, 22 Sep 2010 02:22:03 +0000 (+0000) Subject: (trunk) #3574:Potential crash in tracker view when changing options X-Git-Tag: 2.10~41 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fe31e1a515c317353e76208d1429eaf73cced19e;p=transmission (trunk) #3574:Potential crash in tracker view when changing options --- diff --git a/qt/details.cc b/qt/details.cc index 97d046f6a..68a7ae671 100644 --- a/qt/details.cc +++ b/qt/details.cc @@ -229,10 +229,17 @@ Details :: refreshPref( int key ) switch( key ) { - case Prefs :: SHOW_TRACKER_SCRAPES: + case Prefs :: SHOW_TRACKER_SCRAPES: { + QItemSelectionModel * selectionModel( myTrackerView->selectionModel( ) ); + const QItemSelection selection( selectionModel->selection( ) ); + const QModelIndex currentIndex( selectionModel->currentIndex( ) ); myTrackerDelegate->setShowMore( myPrefs.getBool( key ) ); + selectionModel->clear( ); myTrackerView->reset( ); + selectionModel->select( selection, QItemSelectionModel::Select ); + selectionModel->setCurrentIndex( currentIndex, QItemSelectionModel::NoUpdate ); break; + } case Prefs :: SHOW_BACKUP_TRACKERS: myTrackerFilter->setShowBackupTrackers( myPrefs.getBool( key ) );