From d6bd8b5613f3b113bd44ff918a78252db45e2ebd Mon Sep 17 00:00:00 2001 From: signedav Date: Sat, 7 Oct 2023 23:21:19 +0200 Subject: [PATCH] it didn't converted the path to absolute, because the file was not recognized --- QgisModelBaker/gui/validate.py | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/QgisModelBaker/gui/validate.py b/QgisModelBaker/gui/validate.py index 6781f5892..75ed76dbf 100644 --- a/QgisModelBaker/gui/validate.py +++ b/QgisModelBaker/gui/validate.py @@ -684,15 +684,13 @@ def _relative_path(self, path): return path def _absolute_path(self, path): - if ( - os.path.isfile(path) - and QgsProject.instance().homePath() - and not os.path.isabs(path) - ): - # if it's a saved project and the path is not not absolute - return os.path.join(path, QgsProject.instance().homePath(), path) - else: - return path + if QgsProject.instance().homePath() and not os.path.isabs(path): + # if it's a saved project and the path is not absolute + absolute_path = os.path.join(path, QgsProject.instance().homePath(), path) + if os.path.isfile(absolute_path): + return absolute_path + # otherwise most possibly it's an ilidata link + return path def _validator_stdout(self, txt): lines = txt.strip().split("\n")