BUG-2114 & BUG-1992: Hopefully implemented this more stable as it used to be.

This commit is contained in:
Robin 2017-01-13 19:46:54 +01:00
commit 0b2cbe1c0b
4 changed files with 43 additions and 16 deletions

View file

@ -342,9 +342,8 @@ namespace GreenshotPlugin.Core {
case "OutputFileAsFullpath":
if (IniConfig.IsPortable) {
return Path.Combine(Application.StartupPath, @"..\..\Documents\Pictures\Greenshots\dummy.png");
} else {
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),"dummy.png");
}
return Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.Desktop),"dummy.png");
case "OutputFilePath":
if (IniConfig.IsPortable) {
string pafOutputFilePath = Path.Combine(Application.StartupPath, @"..\..\Documents\Pictures\Greenshots");
@ -515,16 +514,6 @@ namespace GreenshotPlugin.Core {
if (WebRequestReadWriteTimeout < 1) {
WebRequestReadWriteTimeout = 100;
}
// Added for BUG-1992, reset the OutputFilePath / OutputFileAsFullpath if they don't exist (e.g. the configuration is used on a different PC)
if (!Directory.Exists(OutputFilePath))
{
OutputFilePath = GetDefault(nameof(OutputFilePath)) as string;
}
if (!File.Exists(OutputFileAsFullpath))
{
OutputFileAsFullpath = GetDefault(nameof(OutputFileAsFullpath)) as string;
}
}
}
}