diff --git a/qtgui/projectname.py b/qtgui/projectname.py index a9fc72b..e3a7236 100644 --- a/qtgui/projectname.py +++ b/qtgui/projectname.py @@ -75,7 +75,8 @@ class ProjectNameWidget(QtWidgets.QDialog): if currentText.endswith("/"): currentText = currentText[:-1] - path = pathlib.Path(api.sessionRoot(), currentText) + fullpath = pathlib.Path(api.sessionRoot(), currentText) + path = pathlib.Path(currentText) errorMessage = "" if currentText == "": @@ -84,9 +85,9 @@ class ProjectNameWidget(QtWidgets.QDialog): errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Name must be a relative path.") elif pathlib.PurePosixPath(path).match("../*") or pathlib.PurePosixPath(path).match("*..*"): errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Moving to parent directory not allowed.") - elif "/" in currentText and path.parent.exists() and not os.access(path.parent, os.W_OK): + elif "/" in currentText and fullpath.parent.exists() and not os.access(fullpath.parent, os.W_OK): errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Writing in this directory is not permitted.") - elif path.exists(): + elif fullpath.exists(): errorMessage = QtCore.QCoreApplication.translate("ProjectNameWidget", "Name is already in use.") ok = self.ui.buttonBox.button(QtWidgets.QDialogButtonBox.Ok)