From ad006a2c62263fea20c87157e948508a9eb7f9a8 Mon Sep 17 00:00:00 2001 From: Ioannis G Date: Fri, 26 Jun 2020 17:37:37 +0300 Subject: [PATCH] Core/Portable: update logging, exception handling also update comments in `PreStartCleanUpAfterPortabilityUpdate` --- Flow.Launcher.Core/Configuration/Portable.cs | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/Flow.Launcher.Core/Configuration/Portable.cs b/Flow.Launcher.Core/Configuration/Portable.cs index 622948e44..44e4434be 100644 --- a/Flow.Launcher.Core/Configuration/Portable.cs +++ b/Flow.Launcher.Core/Configuration/Portable.cs @@ -47,10 +47,7 @@ namespace Flow.Launcher.Core.Configuration } catch (Exception e) { -#if !DEBUG - Log.Exception("Portable", "Error occured while disabling portable mode", e); -#endif - throw; + Log.Exception("|Portable.DisablePortableMode|Error occured while disabling portable mode", e); } } @@ -74,10 +71,7 @@ namespace Flow.Launcher.Core.Configuration } catch (Exception e) { -#if !DEBUG - Log.Exception("Portable", "Error occured while enabling portable mode", e); -#endif - throw; + Log.Exception("|Portable.EnablePortableMode|Error occured while enabling portable mode", e); } } @@ -159,7 +153,8 @@ namespace Flow.Launcher.Core.Configuration var portableDataDeleteFilePath = Path.Combine(portableDataDir, DataLocation.DeletionIndicatorFile); var roamingDataDeleteFilePath = Path.Combine(roamingDataDir, DataLocation.DeletionIndicatorFile); - // Should we switch from %AppData% to portable mode? + // If the data folder in %appdata% is marked for deletion, + // delete it and prompt the user to pick the portable data location if (File.Exists(roamingDataDeleteFilePath)) { FilesFolders.RemoveFolderIfExists(roamingDataDir); @@ -173,7 +168,8 @@ namespace Flow.Launcher.Core.Configuration Environment.Exit(0); } } - // Should we switch from portable mode to %AppData%? + // Otherwise, if the portable data folder is marked for deletion, + // delete it and notify the user about it. else if (File.Exists(portableDataDeleteFilePath)) { FilesFolders.RemoveFolderIfExists(portableDataDir);