summaryrefslogtreecommitdiff
path: root/src/plugins/python
diff options
context:
space:
mode:
authorhjk <hjk@qt.io>2019-10-23 08:47:05 +0200
committerhjk <hjk@qt.io>2019-10-25 09:01:52 +0000
commit6a878c72930a55702e0d42ad2f72dd1471c31cd2 (patch)
tree2c7dcd53c6d18468bafb0d0b6524bb2d3f433fa2 /src/plugins/python
parent5b815d22a39e7849767b05b34aff7be3eba5ca33 (diff)
downloadqt-creator-6a878c72930a55702e0d42ad2f72dd1471c31cd2.tar.gz
ProjectExplorer: Use a functor for BuildSystem creation
... instead of creating the BuildSystem direct. This will help the shift of BuildSystem owner ship as a Project will have potentially multiple BuildSystem instances (one per BuildConfiguration), but still be responsible for creating them with the Targets. Change-Id: I2dd71c7687ed41af9e42c874b3f932ce704e7ee3 Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Diffstat (limited to 'src/plugins/python')
-rw-r--r--src/plugins/python/pythonproject.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/plugins/python/pythonproject.cpp b/src/plugins/python/pythonproject.cpp
index 2b3892c7a8..921f66b043 100644
--- a/src/plugins/python/pythonproject.cpp
+++ b/src/plugins/python/pythonproject.cpp
@@ -57,7 +57,7 @@ namespace Internal {
class PythonBuildSystem : public BuildSystem
{
public:
- PythonBuildSystem(PythonProject *project);
+ explicit PythonBuildSystem(Project *project);
bool supportsAction(Node *context, ProjectAction action, const Node *node) const override;
bool addFiles(Node *, const QStringList &filePaths, QStringList *) override;
@@ -191,7 +191,7 @@ PythonProject::PythonProject(const FilePath &fileName)
setDisplayName(fileName.toFileInfo().completeBaseName());
setNeedsBuildConfigurations(false);
- setBuildSystem(std::make_unique<PythonBuildSystem>(this));
+ setBuildSystemCreator([](Project *p) { return new PythonBuildSystem(p); });
}
void PythonBuildSystem::refresh()
@@ -433,10 +433,10 @@ bool PythonProject::setupTarget(Target *t)
return res;
}
-PythonBuildSystem::PythonBuildSystem(PythonProject *project)
+PythonBuildSystem::PythonBuildSystem(Project *project)
: BuildSystem(project)
{
- connect(project, &PythonProject::projectFileIsDirty, this, [this]() { refresh(); });
+ connect(project, &Project::projectFileIsDirty, this, [this]() { refresh(); });
QTimer::singleShot(0, this, &PythonBuildSystem::refresh);
}