- fix: Application failed to save config and didn't exit when the folder %LOCALAPPDATA%\ChanSort doesn't exist

This commit is contained in:
hbeham
2019-07-25 18:02:17 +02:00
parent 6786dc5615
commit 55a7a1a048
3 changed files with 17 additions and 4 deletions

View File

@@ -2516,10 +2516,17 @@ namespace ChanSort.Ui
private void MainForm_FormClosing(object sender, FormClosingEventArgs e)
{
if (this.PromptSaveAndContinue())
this.SaveSettings();
else
e.Cancel = true;
try
{
if (this.PromptSaveAndContinue())
this.SaveSettings();
else
e.Cancel = true;
}
catch
{
// ignore - always allow to exit
}
}
#endregion

View File

@@ -57,6 +57,9 @@ namespace ChanSort.Ui.Properties
public void Save()
{
var folder = Path.GetDirectoryName(ConfigFilePath);
Directory.CreateDirectory(folder);
using (var stream = new FileStream(ConfigFilePath, FileMode.Create))
using (var writer = new StreamWriter(stream, System.Text.Encoding.UTF8))
{

View File

@@ -1,6 +1,9 @@
ChanSort Change Log
===================
2019-07-25
- fix: Application failed to save config and didn't exit when the folder %LOCALAPPDATA%\ChanSort doesn't exist
2019-07-20
- user settings are now persisted across releases in %LOCALAPPDATA%\ChanSort\config.xml
- fixed Sony sdb.xml DVB-T channel lists