Skip to content

Commit

Permalink
opt: remove updateNames condtion
Browse files Browse the repository at this point in the history
  • Loading branch information
xiaoyifang committed Nov 1, 2024
1 parent a0360ca commit 090a1da
Showing 1 changed file with 0 additions and 33 deletions.
33 changes: 0 additions & 33 deletions src/ui/editdictionaries.cc
Original file line number Diff line number Diff line change
Expand Up @@ -209,29 +209,8 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )

loadDictionaries( this, cfg, dictionaries, dictNetMgr );

// If no changes to groups were made, update the original data
const bool noGroupEdits = ( origCfg.groups == savedGroups );

if ( noGroupEdits ) {
savedGroups = cfg.groups;
}

Instances::updateNames( savedGroups, dictionaries );

const bool noOrderEdits = ( origCfg.dictionaryOrder == savedOrder );

if ( noOrderEdits ) {
savedOrder = cfg.dictionaryOrder;
}

Instances::updateNames( savedOrder, dictionaries );

const bool noInactiveEdits = ( origCfg.inactiveDictionaries == savedInactive );

if ( noInactiveEdits ) {
savedInactive = cfg.inactiveDictionaries;
}

Instances::updateNames( savedInactive, dictionaries );

if ( rebuildGroups ) {
Expand All @@ -245,18 +224,6 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )
ui.tabs->insertTab( 2, groups, QIcon( ":/icons/bookcase.svg" ), tr( "&Groups" ) );
connect( groups, &Groups::showDictionaryInfo, this, &EditDictionaries::showDictionaryInfo );
connect( orderAndProps, &OrderAndProps::showDictionaryHeadwords, this, &EditDictionaries::showDictionaryHeadwords );

if ( noGroupEdits ) {
origCfg.groups = groups->getGroups();
}

if ( noOrderEdits ) {
origCfg.dictionaryOrder = orderAndProps->getCurrentDictionaryOrder();
}

if ( noInactiveEdits ) {
origCfg.inactiveDictionaries = orderAndProps->getCurrentInactiveDictionaries();
}
}
ui.tabs->setUpdatesEnabled( true );
}
Expand Down

0 comments on commit 090a1da

Please sign in to comment.