ProjectExplorer: Un-tighten the RunConfiguration::isConfigured() check

Only report a run configuration as unconfigured if it has a fundamental
problem that should inhibit automatic creation.
Adapt the potentially reported issue in QdbRunConfiguration accordingly.
The concrete reason is that for cmake projects, deployment information
is only available after deployment has happened, so the on-device
exutable is not known right away.

Task-number: QTCREATORBUG-24685
Change-Id: Ibe49649ebb001d3ba2b752c9c335687da9c08ce7
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Christian Kandeler
2020-11-18 13:54:35 +01:00
parent 45429a3c44
commit ccf5daa16d
3 changed files with 8 additions and 3 deletions

View File

@@ -125,8 +125,8 @@ Tasks QdbRunConfiguration::checkForIssues() const
{
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."));
tasks << BuildSystemTask(Task::Warning, tr("The remote executable must be set "
"in order to run on a Boot2Qt device."));
}
return tasks;
}

View File

@@ -221,6 +221,11 @@ QWidget *RunConfiguration::createConfigurationWidget()
return detailsWidget;
}
bool RunConfiguration::isConfigured() const
{
return !Utils::anyOf(checkForIssues(), [](const Task &t) { return t.type == Task::Error; });
}
void RunConfiguration::addAspectFactory(const AspectFactory &aspectFactory)
{
theAspectFactories.push_back(aspectFactory);

View File

@@ -134,7 +134,7 @@ public:
QWidget *createConfigurationWidget();
bool isConfigured() const { return checkForIssues().isEmpty(); }
bool isConfigured() const;
virtual Tasks checkForIssues() const { return {}; }
using CommandLineGetter = std::function<Utils::CommandLine()>;