mirror of
https://github.com/transmission/transmission.git
synced 2026-05-08 09:39:08 +01:00
(trunk) #3574:Potential crash in tracker view when changing options
This commit is contained in:
+8
-1
@@ -229,10 +229,17 @@ Details :: refreshPref( int key )
|
|||||||
|
|
||||||
switch( 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 ) );
|
myTrackerDelegate->setShowMore( myPrefs.getBool( key ) );
|
||||||
|
selectionModel->clear( );
|
||||||
myTrackerView->reset( );
|
myTrackerView->reset( );
|
||||||
|
selectionModel->select( selection, QItemSelectionModel::Select );
|
||||||
|
selectionModel->setCurrentIndex( currentIndex, QItemSelectionModel::NoUpdate );
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
case Prefs :: SHOW_BACKUP_TRACKERS:
|
case Prefs :: SHOW_BACKUP_TRACKERS:
|
||||||
myTrackerFilter->setShowBackupTrackers( myPrefs.getBool( key ) );
|
myTrackerFilter->setShowBackupTrackers( myPrefs.getBool( key ) );
|
||||||
|
|||||||
Reference in New Issue
Block a user