From 2f52c1aa1b6d1893ef21969c07372ff7ba0487a0 Mon Sep 17 00:00:00 2001 From: Jack251970 <1160210343@qq.com> Date: Sun, 21 Sep 2025 16:17:31 +0800 Subject: [PATCH] Improve code quality --- Flow.Launcher.Core/Configuration/Portable.cs | 4 ++-- .../SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Flow.Launcher.Core/Configuration/Portable.cs b/Flow.Launcher.Core/Configuration/Portable.cs index 721e14dca..bc6f073c3 100644 --- a/Flow.Launcher.Core/Configuration/Portable.cs +++ b/Flow.Launcher.Core/Configuration/Portable.cs @@ -139,8 +139,8 @@ namespace Flow.Launcher.Core.Configuration public void PreStartCleanUpAfterPortabilityUpdate() { // Specify here so this method does not rely on other environment variables to initialise - var portableDataDir = Path.Combine(Directory.GetParent(Assembly.GetExecutingAssembly().Location.NonNull()).ToString(), "UserData"); - var roamingDataDir = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), "FlowLauncher"); + var portableDataDir = DataLocation.PortableDataPath; + var roamingDataDir = DataLocation.RoamingDataPath; // Get full path to the .dead files for each case var portableDataDeleteFilePath = Path.Combine(portableDataDir, DataLocation.DeletionIndicatorFile); diff --git a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs index b47b53654..885330b8c 100644 --- a/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs +++ b/Flow.Launcher/SettingPages/ViewModels/SettingsPaneGeneralViewModel.cs @@ -123,7 +123,7 @@ public partial class SettingsPaneGeneralViewModel : BaseModel } // This is only required to set at startup. When portable mode enabled/disabled a restart is always required - private static bool _portableMode = DataLocation.PortableDataLocationInUse(); + private static readonly bool _portableMode = DataLocation.PortableDataLocationInUse(); public bool PortableMode {