Fix crash in some cases after new group adding

This commit is contained in:
Abs62 2012-11-17 12:20:18 +04:00
parent 521b88790c
commit ceb2f4f8bc

View file

@ -845,9 +845,8 @@ void MainWindow::updateDictionaryBar()
unsigned currentId = groupList.getCurrentGroup(); unsigned currentId = groupList.getCurrentGroup();
Instances::Group * grp = groupInstances.findGroup( currentId ); Instances::Group * grp = groupInstances.findGroup( currentId );
dictionaryBar.setMutedDictionaries( 0 );
if ( grp ) { // Should always be !0, but check as a safeguard if ( grp ) { // Should always be !0, but check as a safeguard
dictionaryBar.setDictionaries( grp->dictionaries );
if( currentId == Instances::Group::AllGroupId ) if( currentId == Instances::Group::AllGroupId )
dictionaryBar.setMutedDictionaries( &cfg.mutedDictionaries ); dictionaryBar.setMutedDictionaries( &cfg.mutedDictionaries );
else else
@ -856,6 +855,8 @@ void MainWindow::updateDictionaryBar()
dictionaryBar.setMutedDictionaries( grp ? &grp->mutedDictionaries : 0 ); dictionaryBar.setMutedDictionaries( grp ? &grp->mutedDictionaries : 0 );
} }
dictionaryBar.setDictionaries( grp->dictionaries );
if ( useSmallIconsInToolbarsAction.isChecked() ) { if ( useSmallIconsInToolbarsAction.isChecked() ) {
int extent = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize); int extent = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
dictionaryBar.setDictionaryIconSize( extent ); dictionaryBar.setDictionaryIconSize( extent );