Commit 8cbe009c authored by Daniel Teske's avatar Daniel Teske

QmakeProject: Use QMAKE_PROJECT_NAME to set the display name

Of both nodes and run configurations.

Change-Id: I04cae590561f3c7b355a3385856dca13ebcd7acf
Task-number: QTCREATORBUG-13950
Reviewed-by: default avatarTobias Hunger <tobias.hunger@theqtcompany.com>
parent 326dec96
......@@ -111,6 +111,14 @@ QVariantMap QmakeAndroidRunConfiguration::toMap() const
QString QmakeAndroidRunConfiguration::defaultDisplayName()
{
auto project = static_cast<QmakeProject *>(target()->project());
const QmakeProjectManager::QmakeProFileNode *root = project->rootQmakeProjectNode();
if (root) {
const QmakeProjectManager::QmakeProFileNode *node = root->findProFileFor(m_proFilePath);
if (node) // should always be found
return node->displayName();
}
return QFileInfo(pathFromId(id())).completeBaseName();
}
......@@ -145,6 +153,9 @@ void QmakeAndroidRunConfiguration::proFileUpdated(QmakeProjectManager::QmakeProF
m_parseInProgress = parseInProgress;
if (enabled != isEnabled() || reason != disabledReason())
emit enabledChanged();
if (!parseInProgress)
setDefaultDisplayName(defaultDisplayName());
}
Utils::FileName QmakeAndroidRunConfiguration::proFilePath() const
......
......@@ -140,6 +140,7 @@ void DesktopQmakeRunConfiguration::proFileUpdated(QmakeProFileNode *pro, bool su
if (!parseInProgress) {
emit effectiveTargetInformationChanged();
setDefaultDisplayName(defaultDisplayName());
LocalEnvironmentAspect *aspect = extraAspect<LocalEnvironmentAspect>();
QTC_ASSERT(aspect, return);
aspect->buildEnvironmentHasChanged();
......@@ -539,6 +540,14 @@ Utils::FileName DesktopQmakeRunConfiguration::proFilePath() const
QString DesktopQmakeRunConfiguration::defaultDisplayName()
{
auto project = static_cast<QmakeProject *>(target()->project());
const QmakeProFileNode *root = project->rootQmakeProjectNode();
if (root) {
const QmakeProFileNode *node = root->findProFileFor(m_proFilePath);
if (node) // should always be found
return node->displayName();
}
QString defaultName;
if (!m_proFilePath.isEmpty())
defaultName = m_proFilePath.toFileInfo().completeBaseName();
......
......@@ -1965,6 +1965,7 @@ EvalResult *QmakeProFileNode::evaluate(const EvalInput &input)
result->newVarValues[AndroidPackageSourceDir] = input.readerExact->values(QLatin1String("ANDROID_PACKAGE_SOURCE_DIR"));
result->newVarValues[AndroidExtraLibs] = input.readerExact->values(QLatin1String("ANDROID_EXTRA_LIBS"));
result->newVarValues[IsoIconsVar] = input.readerExact->values(QLatin1String("ISO_ICONS"));
result->newVarValues[QmakeProjectName] = input.readerExact->values(QLatin1String("QMAKE_PROJECT_NAME"));
result->isDeployable = false;
if (result->projectType == ApplicationTemplate) {
......@@ -2234,6 +2235,12 @@ void QmakeProFileNode::applyEvaluate(EvalResult *evalResult)
if (m_varValues != result->newVarValues)
m_varValues = result->newVarValues;
const QString projectName = singleVariableValue(QmakeProjectName);
if (projectName.isEmpty())
setDisplayName(m_projectFilePath.toFileInfo().completeBaseName());
else
setDisplayName(projectName);
} // result == EvalOk
setParseInProgress(false);
......
......@@ -111,7 +111,8 @@ enum QmakeVariable {
AndroidDeploySettingsFile,
AndroidPackageSourceDir,
AndroidExtraLibs,
IsoIconsVar
IsoIconsVar,
QmakeProjectName
};
namespace Internal {
......
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