mirror of
https://github.com/greenshot/greenshot
synced 2025-07-16 10:03:44 -07:00
BUG-2095: Improved the validity check of the OutputFileAsFullpath setting, this should prevent a reset if only the file is not available.
This commit is contained in:
parent
25d9c17bed
commit
c77e77578d
2 changed files with 6 additions and 3 deletions
|
@ -1308,7 +1308,8 @@ namespace Greenshot {
|
|||
switch (clickAction) {
|
||||
case ClickActions.OPEN_LAST_IN_EXPLORER:
|
||||
// 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(_conf.OutputFileAsFullpath))
|
||||
var outputFilePath = Path.GetDirectoryName(_conf.OutputFileAsFullpath);
|
||||
if (outputFilePath == null || (!File.Exists(_conf.OutputFileAsFullpath) && !Directory.Exists(Path.GetDirectoryName(outputFilePath))))
|
||||
{
|
||||
_conf.OutputFileAsFullpath = _conf.GetDefault(nameof(_conf.OutputFileAsFullpath)) as string;
|
||||
}
|
||||
|
@ -1367,7 +1368,8 @@ namespace Greenshot {
|
|||
// Fix for #1470, problems with a drive which is no longer available
|
||||
try {
|
||||
// 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(_conf.OutputFileAsFullpath))
|
||||
var outputFilePath = Path.GetDirectoryName(_conf.OutputFileAsFullpath);
|
||||
if (outputFilePath == null || (!File.Exists(_conf.OutputFileAsFullpath) && !Directory.Exists(Path.GetDirectoryName(outputFilePath))))
|
||||
{
|
||||
_conf.OutputFileAsFullpath = _conf.GetDefault(nameof(_conf.OutputFileAsFullpath)) as string;
|
||||
}
|
||||
|
|
|
@ -69,7 +69,8 @@ namespace GreenshotPlugin.Controls {
|
|||
string initialDirectory = null;
|
||||
try {
|
||||
// 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(conf.OutputFileAsFullpath))
|
||||
var outputFilePath = Path.GetDirectoryName(conf.OutputFileAsFullpath);
|
||||
if (outputFilePath == null || (!File.Exists(conf.OutputFileAsFullpath) && !Directory.Exists(outputFilePath)))
|
||||
{
|
||||
conf.OutputFileAsFullpath = conf.GetDefault(nameof(conf.OutputFileAsFullpath)) as string;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue