Commit 2f333b10 authored by Tobias Hunger's avatar Tobias Hunger Committed by Tim Jenssen

qmake: add displayname method to Qmake*File

Change-Id: I90e6ef357f050953f51ae9cad4eb1c1d2daf4e5a
Reviewed-by: Tim Jenssen's avatarTim Jenssen <tim.jenssen@qt.io>
parent 6505a697
......@@ -42,7 +42,6 @@
#include <projectexplorer/projectexplorer.h>
#include <projectexplorer/target.h>
#include <qtsupport/profilereader.h>
#include <resourceeditor/resourcenode.h>
#include <utils/algorithm.h>
#include <utils/qtcprocess.h>
......@@ -266,11 +265,21 @@ FileName QmakePriFile::directoryPath() const
return filePath().parentDir();
}
QString QmakePriFile::displayName() const
{
return filePath().toFileInfo().completeBaseName();
}
QmakePriFile *QmakePriFile::parent() const
{
return m_parent;
}
QmakeProject *QmakePriFile::project() const
{
return m_project;
}
QVector<QmakePriFile *> QmakePriFile::children() const
{
return m_children;
......@@ -1202,7 +1211,9 @@ bool QmakeProFile::isParent(QmakeProFile *node)
QString QmakeProFile::displayName() const
{
if (!m_displayName.isEmpty())
return m_displayName;
return QmakePriFile::displayName();
}
bool QmakeProFile::isDebugAndRelease() const
......@@ -1704,9 +1715,7 @@ void QmakeProFile::applyEvaluate(QmakeEvalResult *evalResult)
if (m_varValues != result->newVarValues)
m_varValues = result->newVarValues;
const QString projectName = singleVariableValue(Variable::QmakeProjectName);
m_displayName = projectName.isEmpty() ? filePath().toFileInfo().completeBaseName()
: projectName;
m_displayName = singleVariableValue(Variable::QmakeProjectName);
} // result == EvalOk
setParseInProgress(false);
......
......@@ -114,8 +114,10 @@ public:
Utils::FileName filePath() const;
Utils::FileName directoryPath() const;
virtual QString displayName() const;
QmakePriFile *parent() const;
QmakeProject *project() const;
QVector<QmakePriFile *> children() const;
void makeEmpty();
......@@ -269,7 +271,7 @@ public:
~QmakeProFile() override;
bool isParent(QmakeProFile *node);
QString displayName() const;
QString displayName() const final;
ProjectType projectType() 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