Commit 6c64a0d9 authored by Daniel Teske's avatar Daniel Teske

Qt4RunConfigurationFactory: Simplfy code

Change-Id: I4ed28ef19d5799e1e2818752b3bd169984d6f9ad
Reviewed-by: default avatarTobias Hunger <tobias.hunger@digia.com>
parent af254e47
...@@ -649,16 +649,12 @@ bool Qt4RunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, cons ...@@ -649,16 +649,12 @@ bool Qt4RunConfigurationFactory::canCreate(ProjectExplorer::Target *parent, cons
ProjectExplorer::RunConfiguration *Qt4RunConfigurationFactory::doCreate(ProjectExplorer::Target *parent, const Core::Id id) ProjectExplorer::RunConfiguration *Qt4RunConfigurationFactory::doCreate(ProjectExplorer::Target *parent, const Core::Id id)
{ {
Qt4RunConfiguration *rc = new Qt4RunConfiguration(parent, id); Qt4RunConfiguration *rc = new Qt4RunConfiguration(parent, id);
QList<Qt4ProFileNode *> profiles = static_cast<Qt4Project *>(parent->project())->applicationProFiles(); const Qt4ProFileNode *node = static_cast<Qt4Project *>(parent->project())->rootQt4ProjectNode()->findProFileFor(rc->proFilePath());
foreach (Qt4ProFileNode *node, profiles) { if (node) // should always be found
if (node->path() != rc->proFilePath())
continue;
rc->setRunMode(node->variableValue(ConfigVar).contains(QLatin1String("console")) rc->setRunMode(node->variableValue(ConfigVar).contains(QLatin1String("console"))
&& !node->variableValue(QtVar).contains(QLatin1String("testlib")) && !node->variableValue(QtVar).contains(QLatin1String("testlib"))
? ProjectExplorer::LocalApplicationRunConfiguration::Console ? ProjectExplorer::LocalApplicationRunConfiguration::Console
: ProjectExplorer::LocalApplicationRunConfiguration::Gui); : ProjectExplorer::LocalApplicationRunConfiguration::Gui);
break;
}
return rc; return rc;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment