Ignore:
Timestamp:
Dec 5, 2010, 6:52:09 PM (11 years ago)
Author:
charles
Message:

(2.0x qt) backport r11222 for #3496 "Crash when changing to/from compact mode"

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2.0x/qt/mainwin.cc

    r10871 r11475  
    10611061            break;
    10621062
    1063         case Prefs::COMPACT_VIEW:
     1063        case Prefs::COMPACT_VIEW: {
     1064            QItemSelectionModel * selectionModel( ui.listView->selectionModel( ) );
     1065            const QItemSelection selection( selectionModel->selection( ) );
     1066            const QModelIndex currentIndex( selectionModel->currentIndex( ) );
    10641067            b = myPrefs.getBool( key );
    10651068            ui.action_CompactView->setChecked( b );
    10661069            ui.listView->setItemDelegate( b ? myTorrentDelegateMin : myTorrentDelegate );
     1070            selectionModel->clear( );
    10671071            ui.listView->reset( ); // force the rows to resize
    1068             break;
     1072            selectionModel->select( selection, QItemSelectionModel::Select );
     1073            selectionModel->setCurrentIndex( currentIndex, QItemSelectionModel::NoUpdate );
     1074            break;
     1075        }
    10691076
    10701077        case Prefs::MAIN_WINDOW_X:
Note: See TracChangeset for help on using the changeset viewer.