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

@ -115,6 +115,11 @@ namespace Greenshot.Destinations {
pattern = "greenshot ${capturetime}";
}
string filename = FilenameHelper.GetFilenameFromPattern(pattern, CoreConfig.OutputFileFormat, captureDetails);
// Added for BUG-1992, reset the OutputFilePath / OutputFileAsFullpath if they don't exist (e.g. the configuration is used on a different PC)
if (!File.Exists(CoreConfig.OutputFilePath))
{
CoreConfig.OutputFilePath = CoreConfig.GetDefault(nameof(CoreConfig.OutputFilePath)) as string;
}
string filepath = FilenameHelper.FillVariables(CoreConfig.OutputFilePath, false);
try {
fullPath = Path.Combine(filepath, filename);