diff options
author | sr55 <[email protected]> | 2019-01-03 19:38:46 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2019-01-03 19:39:54 +0000 |
commit | 29eb7166e6577974d786edbe868afbb346d2e2d2 (patch) | |
tree | 0569243a8afe434fbd93200b85490e6b5fe12ed2 /win/CS/HandBrakeWPF/Services/UserSettingService.cs | |
parent | f2075c0522ab11b1a67a65b3bdc4e9ff10d5635a (diff) |
WinGui: Remove support for loading legacy settings files AND add VideoScaler to the reset legacy settings list to avoid crash issues. Fixes #1782
Diffstat (limited to 'win/CS/HandBrakeWPF/Services/UserSettingService.cs')
-rw-r--r-- | win/CS/HandBrakeWPF/Services/UserSettingService.cs | 55 |
1 files changed, 2 insertions, 53 deletions
diff --git a/win/CS/HandBrakeWPF/Services/UserSettingService.cs b/win/CS/HandBrakeWPF/Services/UserSettingService.cs index e4ac3c7d6..3c71854a3 100644 --- a/win/CS/HandBrakeWPF/Services/UserSettingService.cs +++ b/win/CS/HandBrakeWPF/Services/UserSettingService.cs @@ -12,12 +12,12 @@ namespace HandBrakeWPF.Services using System;
using System.Collections.Generic;
using System.Collections.Specialized;
- using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Reflection;
using System.Xml.Serialization;
+ using HandBrake.Interop.Model;
using HandBrake.Interop.Utilities;
using HandBrakeWPF.Collections;
@@ -198,11 +198,6 @@ namespace HandBrakeWPF.Services this.userSettings = deserialisedSettings;
}
}
- else
- {
- Dictionary<string, object> deserialisedSettings = this.GetLegacySettings(); // Check for Legacy files
- this.userSettings = deserialisedSettings ?? new SerializableDictionary<string, object>();
- }
// Add any missing / new settings
SerializableDictionary<string, object> defaults = this.GetDefaults();
@@ -214,6 +209,7 @@ namespace HandBrakeWPF.Services // Legacy Settings forced Reset.
this.userSettings[UserSettingConstants.ShowAdvancedTab] = false;
+ this.userSettings[UserSettingConstants.ScalingMode] = VideoScaler.Lanczos;
}
catch (Exception exc)
{
@@ -262,52 +258,5 @@ namespace HandBrakeWPF.Services return new SerializableDictionary<string, object>();
}
-
- private SerializableDictionary<string, object> GetLegacySettings()
- {
- // TODO can be removed after 1.2 releases. Useful for 1 version to upgrade users settings to the new format.
- SerializableDictionary<string, object> oldAppSettings = null;
-
- try
- {
- string legacyReleaseFile = Path.Combine(DirectoryUtilities.GetUserStoragePath(false), "settings.xml");
- string legacyNightlyFile = Path.Combine(DirectoryUtilities.GetUserStoragePath(true), "settings.xml");
-
- if (VersionHelper.IsNightly())
- {
- if (File.Exists(legacyNightlyFile))
- {
- using (StreamReader reader = new StreamReader(legacyNightlyFile))
- {
- XmlSerializer serializer =
- new XmlSerializer(typeof(SerializableDictionary<string, object>));
- oldAppSettings = (SerializableDictionary<string, object>)serializer.Deserialize(reader);
- }
-
- File.Delete(legacyNightlyFile);
- }
- }
- else
- {
- if (File.Exists(legacyReleaseFile))
- {
- using (StreamReader reader = new StreamReader(legacyReleaseFile))
- {
- XmlSerializer serializer =
- new XmlSerializer(typeof(SerializableDictionary<string, object>));
- oldAppSettings = (SerializableDictionary<string, object>)serializer.Deserialize(reader);
- }
-
- File.Delete(legacyReleaseFile);
- }
- }
- }
- catch (Exception exc)
- {
- Debug.WriteLine(exc);
- }
-
- return oldAppSettings;
- }
}
}
\ No newline at end of file |