Commit bdb5b008 authored by Daniel Teske's avatar Daniel Teske
Browse files

Qt4Project code model: Also include files from cumulative parse



Task-number: QTCREATORBUG-7321
Change-Id: I3232c8618d13830caf5a511765eea80df9c7449b
Reviewed-by: Orgad Shaneh's avatarOrgad Shaneh <orgads@gmail.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
Reviewed-by: default avatarEike Ziller <eike.ziller@nokia.com>
parent ca516cf3
......@@ -1856,18 +1856,9 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
newVarValues[DefinesVar] = m_readerExact->values(QLatin1String("DEFINES"));
newVarValues[IncludePathVar] = includePaths(m_readerExact);
newVarValues[CppFlagsVar] = m_readerExact->values("QMAKE_CXXFLAGS");
newVarValues[CppHeaderVar] = m_readerExact->absoluteFileValues(QLatin1String("HEADERS"),
m_projectDir,
QStringList() << m_projectDir,
0);
newVarValues[CppSourceVar] = m_readerExact->absoluteFileValues(QLatin1String("SOURCES"),
m_projectDir,
QStringList() << m_projectDir,
0);
newVarValues[ObjCSourceVar] = m_readerExact->absoluteFileValues(QLatin1String("OBJECTIVE_SOURCES"),
m_projectDir,
QStringList() << m_projectDir,
0);
newVarValues[CppHeaderVar] = fileListForVar(m_readerExact, m_readerCumulative, QLatin1String("HEADERS"), m_projectDir);
newVarValues[CppSourceVar] = fileListForVar(m_readerExact, m_readerCumulative, QLatin1String("SOURCES"), m_projectDir);
newVarValues[ObjCSourceVar] = fileListForVar(m_readerExact, m_readerCumulative, QLatin1String("OBJECTIVE_SOURCES"), m_projectDir);
newVarValues[UiDirVar] = QStringList() << uiDirPath(m_readerExact);
newVarValues[MocDirVar] = QStringList() << mocDirPath(m_readerExact);
newVarValues[PkgConfigVar] = m_readerExact->values(QLatin1String("PKGCONFIG"));
......@@ -1918,6 +1909,23 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
m_readerCumulative = 0;
}
QStringList Qt4ProFileNode::fileListForVar(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative,
const QString &varName, const QString &projectDir) const
{
QStringList result;
result = readerExact->absoluteFileValues(varName,
projectDir,
QStringList() << projectDir,
0);
if (readerCumulative)
result += readerCumulative->absoluteFileValues(varName,
projectDir,
QStringList() << projectDir,
0);
result.removeDuplicates();
return result;
}
// This function is triggered after a build, and updates the state ui files
// It does so by storing a modification time for each ui file we know about.
......
......@@ -393,6 +393,8 @@ private:
void createUiCodeModelSupport();
QStringList updateUiFiles();
QStringList fileListForVar(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative,
const QString &varName, const QString &projectDir) const;
QString uiDirPath(QtSupport::ProFileReader *reader) const;
QString mocDirPath(QtSupport::ProFileReader *reader) const;
QStringList includePaths(QtSupport::ProFileReader *reader) 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