From 633f2dae53ca9b7f55bdcb20c5a493532dcb5fe2 Mon Sep 17 00:00:00 2001 From: YiFang Xiao Date: Mon, 4 Nov 2024 21:25:44 +0800 Subject: [PATCH] 1 --- src/ui/editdictionaries.cc | 5 ++--- src/ui/groups.cc | 5 ++--- src/ui/groups.hh | 4 ++-- 3 files changed, 6 insertions(+), 8 deletions(-) diff --git a/src/ui/editdictionaries.cc b/src/ui/editdictionaries.cc index ab2ab307..1b30f100 100644 --- a/src/ui/editdictionaries.cc +++ b/src/ui/editdictionaries.cc @@ -204,12 +204,11 @@ void EditDictionaries::acceptChangedSources( bool rebuildGroups ) // Those hold pointers to dictionaries, we need to free them. groupInstances.clear(); - groups.clear(); - orderAndProps.clear(); + // groups.clear(); + // orderAndProps.clear(); loadDictionaries( this, cfg, dictionaries, dictNetMgr ); - if ( rebuildGroups ) { // ui.tabs->removeTab( 1 ); // ui.tabs->removeTab( 1 ); diff --git a/src/ui/groups.cc b/src/ui/groups.cc index 3601a033..15a49e12 100644 --- a/src/ui/groups.cc +++ b/src/ui/groups.cc @@ -68,8 +68,7 @@ void Groups::rebuild( vector< sptr< Dictionary::Class > > const & dicts_, Config::Groups const & groups_, Config::Group const & order ) { - - setUpdatesEnabled( false ); + this->setUpdatesEnabled( false ); dicts = dicts_; groups = groups_; @@ -83,7 +82,7 @@ void Groups::rebuild( vector< sptr< Dictionary::Class > > const & dicts_, ui.groups->populate( groups, dicts, ui.dictionaries->getCurrentDictionaries() ); countChanged(); - setUpdatesEnabled( true ); + this->setUpdatesEnabled( true ); } void Groups::editGroup( unsigned id ) diff --git a/src/ui/groups.hh b/src/ui/groups.hh index ebb2eda6..0d54c321 100644 --- a/src/ui/groups.hh +++ b/src/ui/groups.hh @@ -18,7 +18,7 @@ public: std::vector< sptr< Dictionary::Class > > const &, Config::Groups const &, 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::Group const & order ); /// Instructs the dialog to position itself on editing the given group. @@ -33,7 +33,7 @@ public: private: Ui::Groups ui; - std::vector< sptr< Dictionary::Class > > const & dicts; + std::vector< sptr< Dictionary::Class > > dicts; Config::Groups groups; QToolButton * groupsListButton;