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>
|
2016-09-05 Natalia Portillo <claunia@claunia.com>
|
||||||
|
|
||||||
* Settings.cs: Added filters.
|
* Settings.cs: Added filters.
|
||||||
|
|||||||
@@ -167,6 +167,9 @@ namespace DiscImageChef.Settings
|
|||||||
reportsPath = null;
|
reportsPath = null;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
FileStream prefsFs = null;
|
||||||
|
StreamReader prefsSr = null;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
switch(ptID)
|
switch(ptID)
|
||||||
@@ -183,7 +186,9 @@ namespace DiscImageChef.Settings
|
|||||||
SaveSettings();
|
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)
|
if(parsedPreferences != null)
|
||||||
{
|
{
|
||||||
NSObject obj;
|
NSObject obj;
|
||||||
@@ -288,13 +293,18 @@ namespace DiscImageChef.Settings
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
Current.Stats.VerifyStats = false;
|
Current.Stats.VerifyStats = false;
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
Current.Stats = null;
|
Current.Stats = null;
|
||||||
|
|
||||||
|
prefsFs.Close();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
prefsFs.Close();
|
||||||
|
|
||||||
SetDefaultSettings();
|
SetDefaultSettings();
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
@@ -357,14 +367,18 @@ namespace DiscImageChef.Settings
|
|||||||
}
|
}
|
||||||
|
|
||||||
XmlSerializer xs = new XmlSerializer(Current.GetType());
|
XmlSerializer xs = new XmlSerializer(Current.GetType());
|
||||||
StreamReader sr = new StreamReader(settingsPath);
|
prefsSr = new StreamReader(settingsPath);
|
||||||
Current = (DicSettings)xs.Deserialize(sr);
|
Current = (DicSettings)xs.Deserialize(prefsSr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
catch
|
catch
|
||||||
{
|
{
|
||||||
|
if(prefsFs != null)
|
||||||
|
prefsFs.Close();
|
||||||
|
if(prefsSr != null)
|
||||||
|
prefsSr.Close();
|
||||||
SetDefaultSettings();
|
SetDefaultSettings();
|
||||||
SaveSettings();
|
SaveSettings();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user