mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
* commandline:
* DiscImageChef.Settings/Settings.cs: Corrected a share violation when the preferences file exists but it's not ours.
This commit is contained in:
@@ -1,3 +1,8 @@
|
||||
2017-05-14 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Settings.cs: Corrected a share violation when the
|
||||
preferences file exists but it's not ours.
|
||||
|
||||
2016-09-05 Natalia Portillo <claunia@claunia.com>
|
||||
|
||||
* Settings.cs: Added filters.
|
||||
|
||||
@@ -167,6 +167,9 @@ namespace DiscImageChef.Settings
|
||||
reportsPath = null;
|
||||
}
|
||||
|
||||
FileStream prefsFs = null;
|
||||
StreamReader prefsSr = null;
|
||||
|
||||
try
|
||||
{
|
||||
switch(ptID)
|
||||
@@ -183,7 +186,9 @@ namespace DiscImageChef.Settings
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
NSDictionary parsedPreferences = (NSDictionary)BinaryPropertyListParser.Parse(new FileInfo(preferencesFilePath));
|
||||
prefsFs = new FileStream(preferencesFilePath, FileMode.Open, FileAccess.Read);
|
||||
|
||||
NSDictionary parsedPreferences = (NSDictionary)BinaryPropertyListParser.Parse(prefsFs);
|
||||
if(parsedPreferences != null)
|
||||
{
|
||||
NSObject obj;
|
||||
@@ -288,13 +293,18 @@ namespace DiscImageChef.Settings
|
||||
}
|
||||
else
|
||||
Current.Stats.VerifyStats = false;
|
||||
|
||||
}
|
||||
}
|
||||
else
|
||||
Current.Stats = null;
|
||||
|
||||
prefsFs.Close();
|
||||
}
|
||||
else
|
||||
{
|
||||
prefsFs.Close();
|
||||
|
||||
SetDefaultSettings();
|
||||
SaveSettings();
|
||||
}
|
||||
@@ -357,14 +367,18 @@ namespace DiscImageChef.Settings
|
||||
}
|
||||
|
||||
XmlSerializer xs = new XmlSerializer(Current.GetType());
|
||||
StreamReader sr = new StreamReader(settingsPath);
|
||||
Current = (DicSettings)xs.Deserialize(sr);
|
||||
prefsSr = new StreamReader(settingsPath);
|
||||
Current = (DicSettings)xs.Deserialize(prefsSr);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
catch
|
||||
{
|
||||
if(prefsFs != null)
|
||||
prefsFs.Close();
|
||||
if(prefsSr != null)
|
||||
prefsSr.Close();
|
||||
SetDefaultSettings();
|
||||
SaveSettings();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user