mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 19:24:08 +00:00
Fix crash in some cases after new group adding
This commit is contained in:
parent
521b88790c
commit
ceb2f4f8bc
|
@ -845,9 +845,8 @@ void MainWindow::updateDictionaryBar()
|
|||
unsigned currentId = groupList.getCurrentGroup();
|
||||
Instances::Group * grp = groupInstances.findGroup( currentId );
|
||||
|
||||
dictionaryBar.setMutedDictionaries( 0 );
|
||||
if ( grp ) { // Should always be !0, but check as a safeguard
|
||||
dictionaryBar.setDictionaries( grp->dictionaries );
|
||||
|
||||
if( currentId == Instances::Group::AllGroupId )
|
||||
dictionaryBar.setMutedDictionaries( &cfg.mutedDictionaries );
|
||||
else
|
||||
|
@ -856,6 +855,8 @@ void MainWindow::updateDictionaryBar()
|
|||
dictionaryBar.setMutedDictionaries( grp ? &grp->mutedDictionaries : 0 );
|
||||
}
|
||||
|
||||
dictionaryBar.setDictionaries( grp->dictionaries );
|
||||
|
||||
if ( useSmallIconsInToolbarsAction.isChecked() ) {
|
||||
int extent = QApplication::style()->pixelMetric(QStyle::PM_SmallIconSize);
|
||||
dictionaryBar.setDictionaryIconSize( extent );
|
||||
|
|
Loading…
Reference in a new issue