1
1
mirror of https://github.com/KenanZhu/AutoLibrary.git synced 2026-06-17 23:13:03 +08:00

fix(Main, ALConfigWidget): 修复配置文件初始化问题

This commit is contained in:
2026-02-26 22:59:26 +08:00
parent fd96fc235e
commit 896242a1e3
2 changed files with 1 additions and 3 deletions
+1 -1
View File
@@ -24,7 +24,7 @@ def initializeConfigManager():
app_dir = QStandardPaths.writableLocation(QStandardPaths.StandardLocation.AppDataLocation)
config_dir = os.path.join(app_dir, "config")
if not QDir(config_dir).exists():
QDir().mkdir(config_dir)
QDir().mkpath(config_dir)
instance(config_dir)
def main():
-2
View File
@@ -185,7 +185,6 @@ class ALConfigWidget(QWidget, Ui_ALConfigWidget):
run_config_path = self.__config_paths[which]
if not os.path.exists(run_config_path):
self.__config_data[which] = self.defaultRunConfig()
self.__config_paths[which] = self.__default_config_paths[which]
if self.saveRunConfig(self.__config_paths[which], self.__config_data[which]):
msg += f"运行配置文件已初始化, 文件路径: \n{self.__config_paths[which]}\n"
else:
@@ -198,7 +197,6 @@ class ALConfigWidget(QWidget, Ui_ALConfigWidget):
user_config_path = self.__config_paths[which]
if not os.path.exists(user_config_path):
self.__config_data[which] = self.defaultUserConfig()
self.__config_paths[which] = self.__default_config_paths[which]
if self.saveUserConfig(self.__config_paths[which], self.__config_data[which]):
msg += f"用户配置文件已初始化, 文件路径: \n{self.__config_paths[which]}\n"
else: