]> granicus.if.org Git - handbrake/commitdiff
WinGui: Remove support for loading legacy settings files AND add VideoScaler to the...
authorsr55 <sr55.hb@outlook.com>
Thu, 3 Jan 2019 19:38:46 +0000 (19:38 +0000)
committersr55 <sr55.hb@outlook.com>
Thu, 3 Jan 2019 19:39:54 +0000 (19:39 +0000)
win/CS/HandBrakeWPF/Services/UserSettingService.cs

index e4ac3c7d6a71551fa668e11be91c5f0bd593eab0..3c71854a30782a64f3a4697b214038eb886e3b36 100644 (file)
@@ -12,12 +12,12 @@ namespace HandBrakeWPF.Services
     using System;\r
     using System.Collections.Generic;\r
     using System.Collections.Specialized;\r
-    using System.Diagnostics;\r
     using System.IO;\r
     using System.Linq;\r
     using System.Reflection;\r
     using System.Xml.Serialization;\r
 \r
+    using HandBrake.Interop.Model;\r
     using HandBrake.Interop.Utilities;\r
 \r
     using HandBrakeWPF.Collections;\r
@@ -198,11 +198,6 @@ namespace HandBrakeWPF.Services
                         this.userSettings = deserialisedSettings;\r
                     }\r
                 }\r
-                else\r
-                {\r
-                    Dictionary<string, object> deserialisedSettings = this.GetLegacySettings(); // Check for Legacy files\r
-                    this.userSettings = deserialisedSettings ?? new SerializableDictionary<string, object>();\r
-                }\r
 \r
                 // Add any missing / new settings\r
                 SerializableDictionary<string, object> defaults = this.GetDefaults();\r
@@ -214,6 +209,7 @@ namespace HandBrakeWPF.Services
 \r
                 // Legacy Settings forced Reset.\r
                 this.userSettings[UserSettingConstants.ShowAdvancedTab] = false;\r
+                this.userSettings[UserSettingConstants.ScalingMode] = VideoScaler.Lanczos;\r
             }\r
             catch (Exception exc)\r
             {\r
@@ -262,52 +258,5 @@ namespace HandBrakeWPF.Services
 \r
             return new SerializableDictionary<string, object>();\r
         }\r
-\r
-        private SerializableDictionary<string, object> GetLegacySettings()\r
-        {\r
-            // TODO can be removed after 1.2 releases. Useful for 1 version to upgrade users settings to the new format.\r
-            SerializableDictionary<string, object> oldAppSettings = null;\r
-\r
-            try\r
-            {\r
-                string legacyReleaseFile = Path.Combine(DirectoryUtilities.GetUserStoragePath(false), "settings.xml");\r
-                string legacyNightlyFile = Path.Combine(DirectoryUtilities.GetUserStoragePath(true), "settings.xml");\r
-\r
-                if (VersionHelper.IsNightly())\r
-                {\r
-                    if (File.Exists(legacyNightlyFile))\r
-                    {\r
-                        using (StreamReader reader = new StreamReader(legacyNightlyFile))\r
-                        {\r
-                            XmlSerializer serializer =\r
-                                new XmlSerializer(typeof(SerializableDictionary<string, object>));\r
-                            oldAppSettings = (SerializableDictionary<string, object>)serializer.Deserialize(reader);\r
-                        }\r
-\r
-                        File.Delete(legacyNightlyFile);\r
-                    }\r
-                }\r
-                else\r
-                {\r
-                    if (File.Exists(legacyReleaseFile))\r
-                    {\r
-                        using (StreamReader reader = new StreamReader(legacyReleaseFile))\r
-                        {\r
-                            XmlSerializer serializer =\r
-                                new XmlSerializer(typeof(SerializableDictionary<string, object>));\r
-                            oldAppSettings = (SerializableDictionary<string, object>)serializer.Deserialize(reader);\r
-                        }\r
-\r
-                        File.Delete(legacyReleaseFile);\r
-                    }\r
-                }\r
-            }\r
-            catch (Exception exc)\r
-            {\r
-                Debug.WriteLine(exc);\r
-            }\r
-\r
-            return oldAppSettings;\r
-        }\r
     }\r
 }
\ No newline at end of file