Commit 967cebce authored by Daniel Teske's avatar Daniel Teske

Qt4ProjectManager: Skip files that are actually directories

Since the cumulative parsing now parses for loops, we get bogus data
in creator's own .pro files.

Task-number: QTCREATORBUG-10045
Change-Id: I627772f221cc5c928458788feb036cdd93b25a08
Reviewed-by: default avatarRobert Loehning <robert.loehning@digia.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@digia.com>
parent 3a23264e
......@@ -599,6 +599,7 @@ void Qt4PriFileNode::update(ProFile *includeFileExact, QtSupport::ProFileReader
folders[i] = QDir::cleanPath(projectDir + QLatin1Char('/') + folders.at(i));
}
folders.removeDuplicates();
m_recursiveEnumerateFiles.clear();
// Remove non existing items and non folders
......@@ -620,7 +621,6 @@ void Qt4PriFileNode::update(ProFile *includeFileExact, QtSupport::ProFileReader
}
}
folders.removeDuplicates();
watchFolders(folders.toSet());
foreach (const QString &folder, folders) {
......@@ -638,6 +638,7 @@ void Qt4PriFileNode::update(ProFile *includeFileExact, QtSupport::ProFileReader
const QVector<Qt4NodeStaticData::FileTypeData> &fileTypes = qt4NodeStaticData()->fileTypeData;
// update files
QFileInfo tmpFi;
for (int i = 0; i < fileTypes.size(); ++i) {
FileType type = fileTypes.at(i).type;
QStringList qmakeVariables = varNames(type);
......@@ -647,14 +648,20 @@ void Qt4PriFileNode::update(ProFile *includeFileExact, QtSupport::ProFileReader
if (includeFileExact) {
QStringList vPathsExact = fullVPaths(baseVPathsExact, readerExact, qmakeVariable, projectDir);
QStringList tmp = readerExact->absoluteFileValues(qmakeVariable, projectDir, vPathsExact, includeFileExact);
foreach (const QString &t, tmp)
newFilePaths += Utils::FileName::fromString(t);
foreach (const QString &t, tmp) {
tmpFi.setFile(t);
if (tmpFi.isFile())
newFilePaths += Utils::FileName::fromString(t);
}
}
if (includeFileCumlative) {
QStringList vPathsCumulative = fullVPaths(baseVPathsCumulative, readerCumulative, qmakeVariable, projectDir);
QStringList tmp = readerCumulative->absoluteFileValues(qmakeVariable, projectDir, vPathsCumulative, includeFileCumlative);
foreach (const QString &t, tmp)
newFilePaths += Utils::FileName::fromString(t);
foreach (const QString &t, tmp) {
tmpFi.setFile(t);
if (tmpFi.isFile())
newFilePaths += Utils::FileName::fromString(t);
}
}
}
......@@ -662,6 +669,7 @@ void Qt4PriFileNode::update(ProFile *includeFileExact, QtSupport::ProFileReader
m_recursiveEnumerateFiles.subtract(newFilePaths);
}
for (int i = 0; i < fileTypes.size(); ++i) {
FileType type = fileTypes.at(i).type;
QSet<Utils::FileName> newFilePaths = filterFilesProVariables(type, foundFiles[type]);
......@@ -1314,7 +1322,7 @@ QStringList Qt4PriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerExac
result << (var + files);
}
}
result.removeDuplicates();
return result;
}
......
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