mirror of
https://github.com/xiaoyifang/goldendict-ng.git
synced 2024-11-27 23:34:06 +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();
|
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 );
|
||||||
|
|
Loading…
Reference in a new issue