diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp index 02eafcbcff3..49216b2d6a3 100644 --- a/src/plugins/python/pythonproject.cpp +++ b/src/plugins/python/pythonproject.cpp @@ -5,6 +5,8 @@ #include "pythonbuildsystem.h" #include "pythonconstants.h" +#include "pythonkitaspect.h" +#include "pythontr.h" #include @@ -27,15 +29,12 @@ PythonProject::PythonProject(const FilePath &fileName) setBuildSystemCreator([](Target *t) { return new PythonBuildSystem(t); }); } -Project::RestoreResult PythonProject::fromMap(const Store &map, QString *errorMessage) +Tasks PythonProject::projectIssues(const Kit *k) const { - Project::RestoreResult res = Project::fromMap(map, errorMessage); - if (res == RestoreResult::Ok) { - if (!activeTarget()) - addTargetForDefaultKit(); - } - - return res; + if (PythonKitAspect::python(k)) + return {}; + return {BuildSystemTask{Task::Error, + Tr::tr("No python interpreter set for kit %1").arg(k->displayName())}}; } PythonProjectNode::PythonProjectNode(const FilePath &path) diff --git a/src/plugins/python/pythonproject.h b/src/plugins/python/pythonproject.h index f59b2b831bc..038ee64a15e 100644 --- a/src/plugins/python/pythonproject.h +++ b/src/plugins/python/pythonproject.h @@ -37,10 +37,7 @@ class PythonProject : public ProjectExplorer::Project public: explicit PythonProject(const Utils::FilePath &filename); - bool needsConfiguration() const final { return false; } - -private: - RestoreResult fromMap(const Utils::Store &map, QString *errorMessage) override; + ProjectExplorer::Tasks projectIssues(const ProjectExplorer::Kit *k) const override; }; } // Python::Internal