PythonEditor: Use new convenience function to set up run workers

Change-Id: I2c7b0c57a077794756643862c242c499d93295c9
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2018-05-29 13:02:25 +02:00
parent a91a270f8f
commit 99631bcdb4

View File

@@ -311,6 +311,7 @@ public:
{
registerRunConfiguration<PythonRunConfiguration>("PythonEditor.RunConfiguration.");
addSupportedProjectType(PythonProjectId);
addRunWorkerFactory<SimpleTargetRunner>(ProjectExplorer::Constants::NORMAL_RUN_MODE);
}
};
@@ -623,12 +624,6 @@ bool PythonEditorPlugin::initialize(const QStringList &arguments, QString *error
ProjectManager::registerProjectType<PythonProject>(PythonMimeType);
auto constraint = [](RunConfiguration *runConfiguration) {
auto aspect = runConfiguration->extraAspect<InterpreterAspect>();
return aspect && !aspect->value().isEmpty();
};
RunControl::registerWorker<SimpleTargetRunner>(ProjectExplorer::Constants::NORMAL_RUN_MODE, constraint);
return true;
}