forked from qt-creator/qt-creator
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:
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user