From f93e9fcf94bd9c5ebc416f31be1cdea04d9c0166 Mon Sep 17 00:00:00 2001 From: Dmitry Vedenko Date: Fri, 16 Jul 2021 12:54:22 +0300 Subject: [PATCH] Fixes #1305. The check for macro directory now only happens if directory is selected and exists, --- src/prefs/DirectoriesPrefs.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/src/prefs/DirectoriesPrefs.cpp b/src/prefs/DirectoriesPrefs.cpp index 8043f0b3d..0d5064e67 100644 --- a/src/prefs/DirectoriesPrefs.cpp +++ b/src/prefs/DirectoriesPrefs.cpp @@ -418,6 +418,10 @@ bool DirectoriesPrefs::Validate() } else { /* If the directory already exists, make sure it is writable */ + if (!FileNames::WritableLocationCheck(mTempText->GetValue())) + { + return false; + } wxLogNull logNo; Temp.AppendDir(wxT("canicreate")); path = Temp.GetPath(); @@ -443,6 +447,19 @@ bool DirectoriesPrefs::Validate() wxOK | wxCENTRE | wxICON_INFORMATION); } + const wxString macroPathString = mMacrosText->GetValue(); + + if (!macroPathString.empty()) + { + const wxFileName macroPath { macroPathString }; + + if (macroPath.DirExists()) + { + if (!FileNames::WritableLocationCheck(macroPathString)) + return false; + } + } + return true; }