forked from qt-creator/qt-creator
Qt4ProjectManager: Fix codemodel not finding source files in VPATH
Due to not using VPATH for resolving the absolute paths. Task-number: QTCREATORBUG-7441 Change-Id: Ifd76e6e782195b6371aac49ed257534184149805 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@nokia.com> Reviewed-by: Daniel Teske <daniel.teske@nokia.com>
This commit is contained in:
@@ -1980,9 +1980,15 @@ 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] = 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[CppHeaderVar] = fileListForVar(m_readerExact, m_readerCumulative,
|
||||
QLatin1String("HEADERS"), m_projectDir,
|
||||
ProjectExplorer::HeaderType);
|
||||
newVarValues[CppSourceVar] = fileListForVar(m_readerExact, m_readerCumulative,
|
||||
QLatin1String("SOURCES"), m_projectDir,
|
||||
ProjectExplorer::SourceType);
|
||||
newVarValues[ObjCSourceVar] = fileListForVar(m_readerExact, m_readerCumulative,
|
||||
QLatin1String("OBJECTIVE_SOURCES"), m_projectDir,
|
||||
ProjectExplorer::SourceType);
|
||||
newVarValues[UiDirVar] = QStringList() << uiDirPath(m_readerExact);
|
||||
newVarValues[MocDirVar] = QStringList() << mocDirPath(m_readerExact);
|
||||
newVarValues[PkgConfigVar] = m_readerExact->values(QLatin1String("PKGCONFIG"));
|
||||
@@ -2036,18 +2042,24 @@ void Qt4ProFileNode::applyEvaluate(EvalResult evalResult, bool async)
|
||||
}
|
||||
|
||||
QStringList Qt4ProFileNode::fileListForVar(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative,
|
||||
const QString &varName, const QString &projectDir) const
|
||||
const QString &varName, const QString &projectDir, FileType type) const
|
||||
{
|
||||
QStringList baseVPathsExact = baseVPaths(readerExact, projectDir);
|
||||
QStringList vPathsExact = fullVPaths(baseVPathsExact, readerExact, type, varName, projectDir);
|
||||
|
||||
QStringList result;
|
||||
result = readerExact->absoluteFileValues(varName,
|
||||
projectDir,
|
||||
QStringList() << projectDir,
|
||||
vPathsExact,
|
||||
0);
|
||||
if (readerCumulative)
|
||||
if (readerCumulative) {
|
||||
QStringList baseVPathsCumulative = baseVPaths(readerCumulative, projectDir);
|
||||
QStringList vPathsCumulative = fullVPaths(baseVPathsCumulative, readerCumulative, type, varName, projectDir);
|
||||
result += readerCumulative->absoluteFileValues(varName,
|
||||
projectDir,
|
||||
QStringList() << projectDir,
|
||||
vPathsCumulative,
|
||||
0);
|
||||
}
|
||||
result.removeDuplicates();
|
||||
return result;
|
||||
}
|
||||
|
@@ -423,7 +423,7 @@ private:
|
||||
QStringList updateUiFiles();
|
||||
|
||||
QStringList fileListForVar(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative,
|
||||
const QString &varName, const QString &projectDir) const;
|
||||
const QString &varName, const QString &projectDir, FileType type) const;
|
||||
QString uiDirPath(QtSupport::ProFileReader *reader) const;
|
||||
QString mocDirPath(QtSupport::ProFileReader *reader) const;
|
||||
QStringList includePaths(QtSupport::ProFileReader *reader) const;
|
||||
|
Reference in New Issue
Block a user