forked from qt-creator/qt-creator
ProjectExplorer: Rework RunConfiguration::isConfigured()
The old code had a number of problems:
- There was one function isConfigured() to report whether the
run config has issues, and a second one, ensureConfigured(),
needed to be called to retrieve the details. At least one subclass
implementor forgot to re-implement the first one, so the second
one was never called.
- The ensureConfigured() function could show a dialog and thereby
delay execution of the run configuration, leading to additional
state and a more complicated execution logic. Also, the dialog
duplicated the run configuration UI.
We now have only one function returning a list of Task objects. If the
list is not empty, we present them to the user in a non-blocking way and
abort the execution.
Change-Id: I5f2a8126a2c1bd2ca51345b9e37b979bfc0c0b98
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
@@ -100,17 +100,14 @@ QdbRunConfiguration::QdbRunConfiguration(Target *target, Core::Id id)
|
||||
setDefaultDisplayName(tr("Run on Boot2Qt Device"));
|
||||
}
|
||||
|
||||
ProjectExplorer::RunConfiguration::ConfigurationState QdbRunConfiguration::ensureConfigured(QString *errorMessage)
|
||||
Tasks QdbRunConfiguration::checkForIssues() const
|
||||
{
|
||||
QString remoteExecutable = aspect<ExecutableAspect>()->executable().toString();
|
||||
if (remoteExecutable.isEmpty()) {
|
||||
if (errorMessage) {
|
||||
*errorMessage = tr("The remote executable must be set "
|
||||
"in order to run on a Boot2Qt device.");
|
||||
}
|
||||
return UnConfigured;
|
||||
Tasks tasks;
|
||||
if (aspect<ExecutableAspect>()->executable().toString().isEmpty()) {
|
||||
tasks << createConfigurationIssue(tr("The remote executable must be set "
|
||||
"in order to run on a Boot2Qt device."));
|
||||
}
|
||||
return Configured;
|
||||
return tasks;
|
||||
}
|
||||
|
||||
QString QdbRunConfiguration::defaultDisplayName() const
|
||||
|
||||
Reference in New Issue
Block a user