Commit d67a8551 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

QmakePM: Enable "Run in Terminal" by default for console apps

Broken by be4aba7d

.

Task-number: QTCREATORBUG-15632
Change-Id: Iccc7f03c3d0cf0295fd235c23240345e713c1b20
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 048a5cb6
......@@ -135,12 +135,6 @@ void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool su
setDefaultDisplayName(defaultDisplayName());
extraAspect<LocalEnvironmentAspect>()->buildEnvironmentHasChanged();
}
auto terminalAspect = extraAspect<TerminalAspect>();
if (!terminalAspect->isUserSet()) {
terminalAspect->setUseTerminal(pro->variableValue(ConfigVar).contains(QLatin1String("console"))
&& !pro->variableValue(QtVar).contains(QLatin1String("testlib")));
}
}
void DesktopQmakeRunConfiguration::proFileEvaluated()
......@@ -295,6 +289,9 @@ void DesktopQmakeRunConfigurationWidget::effectiveTargetInformationChanged()
auto aspect = m_qmakeRunConfiguration->extraAspect<WorkingDirectoryAspect>();
aspect->setDefaultWorkingDirectory(FileName::fromString(m_qmakeRunConfiguration->baseWorkingDirectory()));
aspect->pathChooser()->setBaseFileName(m_qmakeRunConfiguration->target()->project()->projectDirectory());
auto terminalAspect = m_qmakeRunConfiguration->extraAspect<TerminalAspect>();
if (!terminalAspect->isUserSet())
terminalAspect->setUseTerminal(m_qmakeRunConfiguration->isConsoleApplication());
m_ignoreChange = false;
}
......@@ -377,6 +374,15 @@ QString DesktopQmakeRunConfiguration::baseWorkingDirectory() const
return QString();
}
bool DesktopQmakeRunConfiguration::isConsoleApplication() const
{
if (QmakeProFileNode *node = projectNode()) {
return node->variableValue(ConfigVar).contains(QLatin1String("console"))
&& !node->variableValue(QtVar).contains(QLatin1String("testlib"));
}
return false;
}
void DesktopQmakeRunConfiguration::addToBaseEnvironment(Environment &env) const
{
if (m_isUsingDyldImageSuffix)
......
......@@ -99,6 +99,7 @@ private:
QPair<QString, QString> extractWorkingDirAndExecutable(const QmakeProFileNode *node) const;
QString baseWorkingDirectory() const;
QString defaultDisplayName();
bool isConsoleApplication() const;
QmakeProject *qmakeProject() const;
QmakeProFileNode *projectNode() const;
......
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