From c9e85a1888f0936342ea74121c7e070ff7322777 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Wed, 30 Apr 2025 19:35:35 +0800 Subject: [PATCH] Use recursive false --- .../ViewModels/SettingsPaneAboutViewModel.cs | 29 ++++++++----------- 1 file changed, 12 insertions(+), 17 deletions(-) diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs index 3889b9b00..652fc1ce5 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneAboutViewModel.cs @@ -186,8 +186,8 @@ public partial class SettingsPaneAboutViewModel : BaseModel { try { - // Make sure directory clean - dir.Delete(true); + // Log folders are the last level of folders + dir.Delete(false); } catch (Exception e) { @@ -249,21 +249,16 @@ public partial class SettingsPaneAboutViewModel : BaseModel }); // Then, delete plugin directory - cacheDirectory.EnumerateDirectories("*", SearchOption.TopDirectoryOnly) - .ToList() - .ForEach(dir => - { - try - { - // Make sure directory clean - dir.Delete(true); - } - catch (Exception e) - { - App.API.LogException(ClassName, $"Failed to delete cache directory: {dir.Name}", e); - success = false; - } - }); + try + { + // Log folders are the last level of folders + GetPluginCacheDir().Delete(false); + } + catch (Exception e) + { + App.API.LogException(ClassName, $"Failed to delete cache directory: {dir.Name}", e); + success = false; + } OnPropertyChanged(nameof(CacheFolderSize));