From 4fba1ba3113c11931eed1073f8031d0c1adc676d Mon Sep 17 00:00:00 2001 From: sqzw-x Date: Sun, 14 Jan 2024 16:34:06 +0800 Subject: [PATCH] Fix: update config after save (#38) --- src/controllers/main_window/save_config.py | 3 +-- src/models/config/config.py | 4 ++-- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/src/controllers/main_window/save_config.py b/src/controllers/main_window/save_config.py index d3ed252..de0b385 100644 --- a/src/controllers/main_window/save_config.py +++ b/src/controllers/main_window/save_config.py @@ -904,9 +904,8 @@ def save_config(self): config.path = convert_path(os.path.join(config_folder, config.file)) config.version = self.localversion config.save_config() + config.update_config() - # 根据设置页是否勾选同意, 改变文件清理按钮状态 - self.checkBox_i_agree_clean_clicked() try: scrape_like_text = Flags.scrape_like_text if config.scrape_like == 'single': diff --git a/src/models/config/config.py b/src/models/config/config.py index 00e7254..d54971f 100644 --- a/src/models/config/config.py +++ b/src/models/config/config.py @@ -79,7 +79,7 @@ def read_config(self): setattr(self, key, float(value)) else: setattr(self, key, value) - self._update_config() + self.update_config() def save_config(self): with open(self.get_mark_file_path(), 'w', encoding='UTF-8') as f: @@ -319,7 +319,7 @@ def init_config(self): with open(self.path, "wt", encoding='UTF-8') as code: print(GeneratedConfig.CONFIG_STR, file=code) - def _update_config(self): + def update_config(self): # 获取proxies if self.type == 'http': self.proxies = {