Revert "opt: update name should reflect the latest info"

This reverts commit 1272ea2d20a7908b9a69d6b551511916f97cc024.
This commit is contained in:
xiaoyifang 2024-11-02 17:32:05 +08:00 committed by xiaoyifang
parent ac11ba7b51
commit 7784f8bb62

View file

@ -113,6 +113,7 @@ void EditDictionaries::currentChanged( int index )
if ( index == -1 || !isVisible() ) {
return; // Sent upon the construction/destruction
}
qDebug() << ui.tabs->currentWidget()->objectName();
if ( lastTabName.isEmpty() || lastTabName == "Sources" ) {
// We're switching away from the Sources tab -- if its contents were
// changed, we need to either apply or reject now.
@ -182,6 +183,9 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )
{
dictionariesChanged = true;
Config::Groups savedGroups = groups->getGroups();
Config::Group savedOrder = orderAndProps->getCurrentDictionaryOrder();
Config::Group savedInactive = orderAndProps->getCurrentInactiveDictionaries();
cfg.paths = sources.getPaths();
cfg.soundDirs = sources.getSoundDirs();
@ -205,6 +209,10 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )
loadDictionaries( this, cfg, dictionaries, dictNetMgr );
Instances::updateNames( savedGroups, dictionaries );
Instances::updateNames( savedOrder, dictionaries );
Instances::updateNames( savedInactive, dictionaries );
if ( rebuildGroups ) {
// ui.tabs->removeTab( 1 );
// ui.tabs->removeTab( 1 );
@ -217,15 +225,6 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )
// connect( groups, &Groups::showDictionaryInfo, this, &EditDictionaries::showDictionaryInfo );
// connect( orderAndProps, &OrderAndProps::showDictionaryHeadwords, this, &EditDictionaries::showDictionaryHeadwords );
}
Config::Groups savedGroups = groups->getGroups();
Config::Group savedOrder = orderAndProps->getCurrentDictionaryOrder();
Config::Group savedInactive = orderAndProps->getCurrentInactiveDictionaries();
Instances::updateNames( savedGroups, dictionaries );
Instances::updateNames( savedOrder, dictionaries );
Instances::updateNames( savedInactive, dictionaries );
setUpdatesEnabled( true );
}
EditDictionaries::~EditDictionaries()