From 8e1fbc14f3be5cfdc8f27b159fbfd7719e930b31 Mon Sep 17 00:00:00 2001 From: Miepee Date: Sat, 14 Jan 2023 10:35:02 +0100 Subject: [PATCH] remove more unnecessary checks before deleting + remove fixed todo --- .../AM2RLauncher/MainForm/CustomControls/CustomButton.cs | 1 - AM2RLauncher/AM2RLauncherLib/Profile.cs | 6 ++---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/AM2RLauncher/AM2RLauncher/MainForm/CustomControls/CustomButton.cs b/AM2RLauncher/AM2RLauncher/MainForm/CustomControls/CustomButton.cs index 4c52959..f0314ec 100644 --- a/AM2RLauncher/AM2RLauncher/MainForm/CustomControls/CustomButton.cs +++ b/AM2RLauncher/AM2RLauncher/MainForm/CustomControls/CustomButton.cs @@ -137,7 +137,6 @@ public class CustomButton : Drawable /// /// Event raised, when this control gets focused. /// - //TODO: change focus via keyboard arrow keys protected override void OnGotFocus(EventArgs e) { hover = true; diff --git a/AM2RLauncher/AM2RLauncherLib/Profile.cs b/AM2RLauncher/AM2RLauncherLib/Profile.cs index 23e0491..413ab3e 100644 --- a/AM2RLauncher/AM2RLauncherLib/Profile.cs +++ b/AM2RLauncher/AM2RLauncherLib/Profile.cs @@ -628,8 +628,7 @@ public static class Profile var origName = file.Name; var finalPath = filedir + "/" + origName.ToLower(); file.MoveTo(filedir + "/" + file.Name + "_"); - if (File.Exists(finalPath)) - File.Delete(finalPath); + File.Delete(finalPath); file.MoveTo(finalPath); } } @@ -683,8 +682,7 @@ public static class Profile // Extra file cleanup string apkEndPath = $"{CrossPlatformOperations.CurrentPath}/{profile.Name}.apk"; - if (File.Exists(apkEndPath)) - File.Delete(apkEndPath); + File.Delete(apkEndPath); File.Move($"{tempDir}/{profile.Name}-aligned-debugSigned.apk", apkEndPath); log.Info($"{profile.Name}.apk signed and moved to {CrossPlatformOperations.CurrentPath}/{profile.Name}.apk."); HelperMethods.DeleteDirectory(tempDir);