Changeset 11246


Ignore:
Timestamp:
Sep 22, 2010, 2:22:03 AM (11 years ago)
Author:
Longinus00
Message:

(trunk) #3574:Potential crash in tracker view when changing options

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/qt/details.cc

    r11234 r11246  
    230230    switch( key )
    231231    {
    232         case Prefs :: SHOW_TRACKER_SCRAPES:
     232        case Prefs :: SHOW_TRACKER_SCRAPES: {
     233            QItemSelectionModel * selectionModel( myTrackerView->selectionModel( ) );
     234            const QItemSelection selection( selectionModel->selection( ) );
     235            const QModelIndex currentIndex( selectionModel->currentIndex( ) );
    233236            myTrackerDelegate->setShowMore( myPrefs.getBool( key ) );
     237            selectionModel->clear( );
    234238            myTrackerView->reset( );
     239            selectionModel->select( selection, QItemSelectionModel::Select );
     240            selectionModel->setCurrentIndex( currentIndex, QItemSelectionModel::NoUpdate );
    235241            break;
     242        }
    236243
    237244        case Prefs :: SHOW_BACKUP_TRACKERS:
Note: See TracChangeset for help on using the changeset viewer.