]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Fri, 18 Dec 2009 20:58:56 +0000 (20:58 +0000)
committersr55 <sr55.hb@outlook.com>
Fri, 18 Dec 2009 20:58:56 +0000 (20:58 +0000)
- Move the Queue Recovery file to HandBrakes appdata folder. Queue Recovery file won't be deleted when temp folder is cleared now.

Note that it will not detect the old hb_queue_recovery.xml file in the systems temp folder.

git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@3034 b64f7644-9d1e-0410-96f1-a4d463321fa5

win/C#/EncodeQueue/EncodeAndQueueHandler.cs
win/C#/Functions/Main.cs

index f2a4eaedf2b8ed36f7809d474ed0d7807733868f..db91e6d9008f207d706ac727a54473021f713c8a 100644 (file)
@@ -141,7 +141,8 @@ namespace Handbrake.EncodeQueue
         /// <param name="file">The location of the file to write the queue to.</param>\r
         public void WriteQueueStateToFile(string file)\r
         {\r
-            string tempPath = file == "hb_queue_recovery.xml" ? Path.Combine(Path.GetTempPath(), "hb_queue_recovery.xml") : file;\r
+            string appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\hb_queue_recovery.xml");\r
+            string tempPath = file == "hb_queue_recovery.xml" ? appDataPath : file;\r
 \r
             try\r
             {\r
@@ -205,7 +206,8 @@ namespace Handbrake.EncodeQueue
         /// <param name="file">The location of the file to read the queue from.</param>\r
         public void LoadQueueFromFile(string file)\r
         {\r
-            string tempPath = file == "hb_queue_recovery.xml" ? Path.Combine(Path.GetTempPath(), "hb_queue_recovery.xml") : file;\r
+            string appDataPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\hb_queue_recovery.xml");\r
+            string tempPath = file == "hb_queue_recovery.xml" ? appDataPath : file;\r
 \r
             if (File.Exists(tempPath))\r
             {\r
index 250813df65001061d6ee7415a5355c87ee8dbb0b..9d2489f94de3f5328eef96c313472e3158b35f05 100644 (file)
@@ -263,7 +263,7 @@ namespace Handbrake.Functions
         {\r
             try\r
             {\r
-                string tempPath = Path.Combine(Path.GetTempPath(), "hb_queue_recovery.xml");\r
+                string tempPath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\hb_queue_recovery.xml");\r
                 if (File.Exists(tempPath))\r
                 {\r
                     using (FileStream strm = new FileStream(tempPath, FileMode.Open, FileAccess.Read))\r