FIX: remove user preset folder when logout

Change-Id: I64f0e46de7a91264c3c50188bbad2ac1409bcc0d
This commit is contained in:
zhimin.zeng 2022-08-30 14:50:18 +08:00 committed by Lane.Wei
parent 346480005a
commit 11c24053dd
3 changed files with 17 additions and 1 deletions

View file

@ -722,6 +722,17 @@ void PresetBundle::update_user_presets_directory(const std::string preset_folder
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(" finished");
}
void PresetBundle::remove_user_presets_directory(const std::string preset_folder)
{
const std::string dir_user_presets = data_dir() + "/" + PRESET_USER_DIR + "/" + preset_folder;
BOOST_LOG_TRIVIAL(debug) << __FUNCTION__ << boost::format(" enter, delete directory : %1%") % dir_user_presets;
fs::path folder(dir_user_presets);
if (fs::exists(folder)) {
fs::remove_all(folder);
}
}
void PresetBundle::update_system_preset_setting_ids(std::map<std::string, std::map<std::string, std::string>>& system_presets)
{
for (auto iterator: system_presets)