OSDN Git Service

WinGui:
authorsr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
Fri, 18 Dec 2009 20:58:56 +0000 (20:58 +0000)
committersr55 <sr55@b64f7644-9d1e-0410-96f1-a4d463321fa5>
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://localhost/HandBrake/trunk@3034 b64f7644-9d1e-0410-96f1-a4d463321fa5

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

index f2a4eae..db91e6d 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 250813d..9d2489f 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