Commit b56b1b1f authored by Daniel Teske's avatar Daniel Teske

QmakeProject: Use QMAKE_EXT_H to generate correct ui_h paths

So that the code model can find the right files for ui files
that haven't been build.

Change-Id: I438a3ab9806c8ff6c47e5e188228a31ffb917bdf
Task-number: QTCREATORBUG-14910
Reviewed-by: default avatarEike Ziller <eike.ziller@theqtcompany.com>
parent d0e510f3
......@@ -1934,6 +1934,7 @@ EvalResult *QmakeProFileNode::evaluate(const EvalInput &input)
result->newVarValues[ObjCHeaderVar] = fileListForVar(input.readerExact, input.readerCumulative,
QLatin1String("OBJECTIVE_HEADERS"), input.projectDir, input.buildDirectory);
result->newVarValues[UiDirVar] = QStringList() << uiDirPath(input.readerExact, input.buildDirectory);
result->newVarValues[UiHeaderExtensionVar] = QStringList() << input.readerExact->value(QLatin1String("QMAKE_EXT_H"));
result->newVarValues[MocDirVar] = QStringList() << mocDirPath(input.readerExact, input.buildDirectory);
result->newVarValues[ResourceVar] = fileListForVar(input.readerExact, input.readerCumulative,
QLatin1String("RESOURCES"), input.projectDir, input.buildDirectory);
......@@ -2481,13 +2482,15 @@ Utils::FileName QmakeProFileNode::uiDirectory(const Utils::FileName &buildDir) c
return buildDir;
}
QString QmakeProFileNode::uiHeaderFile(const Utils::FileName &uiDir, const FileName &formFile)
QString QmakeProFileNode::uiHeaderFile(const Utils::FileName &uiDir, const FileName &formFile,
const QString &extension)
{
if (uiDir.isEmpty())
return QString();
Utils::FileName uiHeaderFilePath = uiDir;
uiHeaderFilePath.appendPath(QLatin1String("ui_") + formFile.toFileInfo().completeBaseName() + QLatin1String(".h"));
uiHeaderFilePath.appendPath(QLatin1String("ui_") + formFile.toFileInfo().completeBaseName()
+ extension);
return QDir::cleanPath(uiHeaderFilePath.toString());
}
......@@ -2506,8 +2509,9 @@ void QmakeProFileNode::updateUiFiles(const QString &buildDir)
// Find the UiDir, there can only ever be one
const Utils::FileName uiDir = uiDirectory(Utils::FileName::fromString(buildDir));
const QString uiExtensions = singleVariableValue(UiHeaderExtensionVar);
foreach (const FileNode *uiFile, uiFiles) {
QString headerFile = uiHeaderFile(uiDir, uiFile->path());
QString headerFile = uiHeaderFile(uiDir, uiFile->path(), uiExtensions);
if (!headerFile.isEmpty())
m_uiFiles.insert(uiFile->path().toString(), headerFile);
}
......
......@@ -91,6 +91,7 @@ enum QmakeVariable {
ResourceVar,
ExactResourceVar,
UiDirVar,
UiHeaderExtensionVar,
MocDirVar,
PkgConfigVar,
PrecompiledHeaderVar,
......@@ -338,7 +339,8 @@ public:
QString buildDir(QmakeBuildConfiguration *bc = 0) const;
Utils::FileName uiDirectory(const Utils::FileName &buildDir) const;
static QString uiHeaderFile(const Utils::FileName &uiDir, const Utils::FileName &formFile);
static QString uiHeaderFile(const Utils::FileName &uiDir, const Utils::FileName &formFile,
const QString &extension);
QHash<QString, QString> uiFiles() const;
QmakeProFileNode *findProFileFor(const Utils::FileName &string) const;
......
......@@ -899,7 +899,7 @@ QString QmakeProject::generatedUiHeader(const FileName &formFile) const
if (const QmakeProFileNode *pro = proFileNodeOf(m_rootProjectNode, FormType, formFile))
return QmakeProFileNode::uiHeaderFile(
pro->uiDirectory(Utils::FileName::fromString(pro->buildDir())),
formFile);
formFile, pro->singleVariableValue(QmakeVariable::UiHeaderExtensionVar));
return QString();
}
......
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