FIX:use default download dir when the download path does not exist

Change-Id: Ie1a341caa9803b8cd121fac4fe20c0f3d6fcf3fa
This commit is contained in:
tao wang 2023-02-23 14:15:48 +08:00 committed by Lane.Wei
parent 06daf3bc45
commit 0f8672eb99
1 changed files with 2 additions and 4 deletions

View File

@ -1878,10 +1878,8 @@ void GUI_App::init_download_path()
fs::path dp(down_path);
if (!fs::exists(dp)) {
if (!fs::create_directory(dp)) {
std::string user_down_path = wxStandardPaths::Get().GetUserDir(wxStandardPaths::Dir_Downloads).ToUTF8().data();
app_config->set("download_path", user_down_path);
}
std::string user_down_path = wxStandardPaths::Get().GetUserDir(wxStandardPaths::Dir_Downloads).ToUTF8().data();
app_config->set("download_path", user_down_path);
}
}
}