From 44f6bbf2607cdc8bdac204e3ee9d987fb75d9243 Mon Sep 17 00:00:00 2001 From: Eike Ziller Date: Mon, 26 Feb 2024 09:00:08 +0100 Subject: [PATCH] Python: Wrap some file paths and kit name with quotes Change-Id: If147eae864013d410239d69184cdb9a4bc4479eb Reviewed-by: Leena Miettinen --- src/plugins/python/pythonkitaspect.cpp | 15 +++++++++------ src/plugins/python/pythonproject.cpp | 5 +++-- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/src/plugins/python/pythonkitaspect.cpp b/src/plugins/python/pythonkitaspect.cpp index 2c700f58ae5..26ad44bad48 100644 --- a/src/plugins/python/pythonkitaspect.cpp +++ b/src/plugins/python/pythonkitaspect.cpp @@ -108,15 +108,17 @@ public: result << BuildSystemTask(Task::Error, Tr::tr("No Python setup.")); } else if (!path.exists()) { result << BuildSystemTask(Task::Error, - Tr::tr("Python %1 not found.").arg(path.toUserOutput())); + Tr::tr("Python \"%1\" not found.").arg(path.toUserOutput())); } else if (!path.isExecutableFile()) { result << BuildSystemTask(Task::Error, - Tr::tr("Python %1 not executable.").arg(path.toUserOutput())); + Tr::tr("Python \"%1\" is not executable.") + .arg(path.toUserOutput())); } else { if (!pipIsUsable(path)) { result << BuildSystemTask( Task::Warning, - Tr::tr("Python %1 does not contain a usable pip. Pip is used to install python " + Tr::tr("Python \"%1\" does not contain a usable pip. Pip is used to install " + "python " "packages from the Python Package Index, like PySide and the python " "language server. If you want to use any of that functionality " "ensure pip is installed for that python.") @@ -125,9 +127,10 @@ public: if (!venvIsUsable(path)) { result << BuildSystemTask( Task::Warning, - Tr::tr("Python %1 does not contain a usable venv. venv is the recommended way " - "to isolate a development environment for a project from the globally " - "installed python.") + Tr::tr( + "Python \"%1\" does not contain a usable venv. venv is the recommended way " + "to isolate a development environment for a project from the globally " + "installed python.") .arg(path.toUserOutput())); } } diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index 49216b2d6a3..129782773d3 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -33,8 +33,9 @@ Tasks PythonProject::projectIssues(const Kit *k) const { if (PythonKitAspect::python(k)) return {}; - return {BuildSystemTask{Task::Error, - Tr::tr("No python interpreter set for kit %1").arg(k->displayName())}}; + return { + BuildSystemTask{Task::Error, + Tr::tr("No python interpreter set for kit \"%1\"").arg(k->displayName())}}; } PythonProjectNode::PythonProjectNode(const FilePath &path)