Skip to content

Commit

Permalink
Fix: update config after save (#38)
Browse files Browse the repository at this point in the history
  • Loading branch information
sqzw-x committed Jan 14, 2024
1 parent 775c060 commit 4fba1ba
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 4 deletions.
3 changes: 1 addition & 2 deletions src/controllers/main_window/save_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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':
Expand Down
4 changes: 2 additions & 2 deletions src/models/config/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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 = {
Expand Down

0 comments on commit 4fba1ba

Please sign in to comment.