summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2017-03-17 21:33:51 +0000
committersr55 <[email protected]>2017-03-17 21:33:58 +0000
commit82a75bd3d9d5db5432275e9e83e1b65e7b7bdbb6 (patch)
tree79f95c5655be0821d5a4ff33f43bb3d5f471da5f /win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs
parentd9d6e28f2500688d7b6e0fc4b1e5396f237b99cf (diff)
WinGui: Make the Queue Storage Nightly aware. Also fix an issue with Queue and Log Files not being stored correctly for Portable mode. #267
Diffstat (limited to 'win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs')
-rw-r--r--win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs13
1 files changed, 7 insertions, 6 deletions
diff --git a/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs b/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs
index 5dccba552..8ea5c522e 100644
--- a/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs
+++ b/win/CS/HandBrakeWPF/Utilities/HandBrakeApp.cs
@@ -14,6 +14,8 @@ namespace HandBrakeWPF.Utilities
using System.IO;
using System.Linq;
+ using HandBrake.ApplicationServices.Utilities;
+
/// <summary>
/// A general Helper class for HandBrake GUI
/// </summary>
@@ -24,16 +26,15 @@ namespace HandBrakeWPF.Utilities
/// </summary>
public static void ResetToDefaults()
{
- DeleteFile(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\presets.xml");
- DeleteFile(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\user_presets.xml");
- DeleteFile(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\settings.xml");
+ string appDataFolder = DirectoryUtilities.GetUserStoragePath(VersionHelper.IsNightly());
+ DeleteFile(Path.Combine(appDataFolder, "presets.json"));
+ DeleteFile(Path.Combine(appDataFolder, "settings.xml"));
- string tempPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\");
- DirectoryInfo info = new DirectoryInfo(tempPath);
+ DirectoryInfo info = new DirectoryInfo(appDataFolder);
IEnumerable<FileInfo> logFiles = info.GetFiles("*.xml").Where(f => f.Name.StartsWith("hb_queue_recovery"));
foreach (FileInfo file in logFiles)
{
- DeleteFile(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData) + "\\HandBrake\\" + file.Name);
+ DeleteFile(Path.Combine(appDataFolder, file.Name));
}
}