]> granicus.if.org Git - handbrake/commitdiff
WinGui:
authorsr55 <sr55.hb@outlook.com>
Sat, 21 May 2011 19:38:40 +0000 (19:38 +0000)
committersr55 <sr55.hb@outlook.com>
Sat, 21 May 2011 19:38:40 +0000 (19:38 +0000)
- Small tweak to the preset service which might fix the preset loading issue when upgrading to a new version.

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

win/CS/HandBrake.ApplicationServices/Services/PresetService.cs
win/CS/Program.cs

index bd125c0840d67255e3f5f96f09aa5999db4367e5..227a6eef63a295047315bd429ef1197d3f810975 100644 (file)
@@ -60,7 +60,12 @@ namespace HandBrake.ApplicationServices.Services
         /// </summary>\r
         public PresetService()\r
         {\r
-            // this.Presets = CollectionViewSource.GetDefaultView(this.presets);\r
+            // If the preset file doesn't exist. Create it.\r
+            if (!File.Exists(this.builtInPresetFile))\r
+            {\r
+                this.UpdateBuiltInPresets(string.Empty);\r
+            }\r
+\r
             this.LoadPresets();\r
         }\r
 \r
@@ -371,7 +376,7 @@ namespace HandBrake.ApplicationServices.Services
                     }\r
 \r
                     reader.Close();\r
-                }\r
+                } \r
             }\r
             catch (Exception exc)\r
             {\r
index 132624b28639dcc6b1a4cbbb0724032815608d0f..a04c45e125f8a2ac0e4604b946149411dd4de579 100644 (file)
@@ -92,12 +92,6 @@ namespace Handbrake
                 if (!Directory.Exists(logDir))\r
                     Directory.CreateDirectory(logDir);\r
 \r
-                if (!File.Exists(Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.ApplicationData), @"HandBrake\presets.xml")))\r
-                {\r
-                    PresetService x = new PresetService();\r
-                    x.UpdateBuiltInPresets(string.Empty);\r
-                }\r
-\r
                 Application.EnableVisualStyles();\r
                 Application.SetCompatibleTextRenderingDefault(false);\r
                 Application.Run(new frmMain(args));\r