forked from qt-creator/qt-creator
Python: use new runconfiguration aspect update mechanism
Change-Id: I60807350460e75172bf4744beeb1474755ff4187 Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
@@ -279,13 +279,19 @@ PythonRunConfiguration::PythonRunConfiguration(Target *target, Core::Id id)
|
||||
return cmd;
|
||||
});
|
||||
|
||||
connect(target, &Target::buildSystemUpdated,
|
||||
this, &PythonRunConfiguration::updateTargetInformation);
|
||||
setUpdater([this, scriptAspect] {
|
||||
const BuildTargetInfo bti = buildTargetInfo();
|
||||
const QString script = bti.targetFilePath.toUserOutput();
|
||||
setDefaultDisplayName(tr("Run %1").arg(script));
|
||||
scriptAspect->setValue(script);
|
||||
});
|
||||
|
||||
connect(target, &Target::buildSystemUpdated, this, &RunConfiguration::update);
|
||||
}
|
||||
|
||||
void PythonRunConfiguration::doAdditionalSetup(const RunConfigurationCreationInfo &)
|
||||
{
|
||||
updateTargetInformation();
|
||||
update();
|
||||
}
|
||||
|
||||
void PythonRunConfiguration::updateLanguageServer()
|
||||
@@ -325,14 +331,6 @@ QString PythonRunConfiguration::interpreter() const
|
||||
return aspect<InterpreterAspect>()->currentInterpreter().command.toString();
|
||||
}
|
||||
|
||||
void PythonRunConfiguration::updateTargetInformation()
|
||||
{
|
||||
const BuildTargetInfo bti = buildTargetInfo();
|
||||
const QString script = bti.targetFilePath.toUserOutput();
|
||||
setDefaultDisplayName(tr("Run %1").arg(script));
|
||||
aspect<MainScriptAspect>()->setValue(script);
|
||||
}
|
||||
|
||||
PythonRunConfigurationFactory::PythonRunConfigurationFactory()
|
||||
{
|
||||
registerRunConfiguration<PythonRunConfiguration>("PythonEditor.RunConfiguration.");
|
||||
|
@@ -51,8 +51,6 @@ private:
|
||||
bool supportsDebugger() const;
|
||||
QString mainScript() const;
|
||||
QString arguments() const;
|
||||
|
||||
void updateTargetInformation();
|
||||
};
|
||||
|
||||
class PythonRunConfigurationFactory : public ProjectExplorer::RunConfigurationFactory
|
||||
|
Reference in New Issue
Block a user