This commit is contained in:
YiFang Xiao 2024-11-04 21:25:44 +08:00 committed by xiaoyifang
parent dcb2e555c4
commit 633f2dae53
3 changed files with 6 additions and 8 deletions

View file

@ -204,12 +204,11 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups )
// Those hold pointers to dictionaries, we need to free them. // Those hold pointers to dictionaries, we need to free them.
groupInstances.clear(); groupInstances.clear();
groups.clear(); // groups.clear();
orderAndProps.clear(); // orderAndProps.clear();
loadDictionaries( this, cfg, dictionaries, dictNetMgr ); loadDictionaries( this, cfg, dictionaries, dictNetMgr );
if ( rebuildGroups ) { if ( rebuildGroups ) {
// ui.tabs->removeTab( 1 ); // ui.tabs->removeTab( 1 );
// ui.tabs->removeTab( 1 ); // ui.tabs->removeTab( 1 );

View file

@ -68,8 +68,7 @@ void Groups::rebuild( vector< sptr< Dictionary::Class > > const & dicts_,
Config::Groups const & groups_, Config::Groups const & groups_,
Config::Group const & order ) Config::Group const & order )
{ {
this->setUpdatesEnabled( false );
setUpdatesEnabled( false );
dicts = dicts_; dicts = dicts_;
groups = groups_; groups = groups_;
@ -83,7 +82,7 @@ void Groups::rebuild( vector< sptr< Dictionary::Class > > const & dicts_,
ui.groups->populate( groups, dicts, ui.dictionaries->getCurrentDictionaries() ); ui.groups->populate( groups, dicts, ui.dictionaries->getCurrentDictionaries() );
countChanged(); countChanged();
setUpdatesEnabled( true ); this->setUpdatesEnabled( true );
} }
void Groups::editGroup( unsigned id ) void Groups::editGroup( unsigned id )

View file

@ -18,7 +18,7 @@ public:
std::vector< sptr< Dictionary::Class > > const &, std::vector< sptr< Dictionary::Class > > const &,
Config::Groups const &, Config::Groups const &,
Config::Group const & order ); Config::Group const & order );
void rebuild( vector< sptr< Dictionary::Class > > const & dicts_, void rebuild( std::vector< sptr< Dictionary::Class > > const & dicts_,
Config::Groups const & groups_, Config::Groups const & groups_,
Config::Group const & order ); Config::Group const & order );
/// Instructs the dialog to position itself on editing the given group. /// Instructs the dialog to position itself on editing the given group.
@ -33,7 +33,7 @@ public:
private: private:
Ui::Groups ui; Ui::Groups ui;
std::vector< sptr< Dictionary::Class > > const & dicts; std::vector< sptr< Dictionary::Class > > dicts;
Config::Groups groups; Config::Groups groups;
QToolButton * groupsListButton; QToolButton * groupsListButton;