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

Fix project tree, reported on irc

Reviewed-By: Trust me
Change-Id: Iba035da372a2d005aa1fbf592b29da6b1176c352
Reviewed-on: http://codereview.qt.nokia.com/961

Reviewed-by: default avatarQt Sanity Bot <qt_sanity_bot@ovi.com>
Reviewed-by: default avatarDaniel Teske <daniel.teske@nokia.com>
parent 609354ae
......@@ -619,8 +619,8 @@ void Qt4PriFileNode::update(ProFile *includeFileExact, QtSupport::ProFileReader
for (int i = 0; i < fileTypes.size(); ++i) {
FileType type = fileTypes.at(i).type;
QSet<QString> newFilePaths = filterFiles(type, foundFiles[type]);
newFilePaths += filterFiles(type, m_recursiveEnumerateFiles);
QSet<QString> newFilePaths = filterFilesProVariables(type, foundFiles[type]);
newFilePaths += filterFilesRecursiveEnumerata(type, m_recursiveEnumerateFiles);
// We only need to save this information if
// we are watching folders
......@@ -694,8 +694,8 @@ void Qt4PriFileNode::folderChanged(const QString &folder)
const QVector<Qt4NodeStaticData::FileTypeData> &fileTypes = qt4NodeStaticData()->fileTypeData;
for (int i = 0; i < fileTypes.size(); ++i) {
FileType type = fileTypes.at(i).type;
QSet<QString> add = filterFiles(type, addedFiles);
QSet<QString> remove = filterFiles(type, removedFiles);
QSet<QString> add = filterFilesRecursiveEnumerata(type, addedFiles);
QSet<QString> remove = filterFilesRecursiveEnumerata(type, removedFiles);
if (!add.isEmpty() || !remove.isEmpty()) {
// Scream :)
......@@ -1227,7 +1227,26 @@ QStringList Qt4PriFileNode::dynamicVarNames(QtSupport::ProFileReader *readerExac
return result;
}
QSet<QString> Qt4PriFileNode::filterFiles(ProjectExplorer::FileType fileType, const QSet<QString> &files)
QSet<QString> Qt4PriFileNode::filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<QString> &files)
{
if (fileType != ProjectExplorer::QMLType && fileType != ProjectExplorer::UnknownFileType)
return files;
QSet<QString> result;
if (fileType != ProjectExplorer::QMLType && fileType != ProjectExplorer::UnknownFileType)
return result;
if (fileType == ProjectExplorer::QMLType) {
foreach (const QString &file, files)
if (file.endsWith(".qml"))
result << file;
} else {
foreach (const QString &file, files)
if (!file.endsWith(".qml"))
result << file;
}
return result;
}
QSet<QString> Qt4PriFileNode::filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<QString> &files)
{
QSet<QString> result;
if (fileType != ProjectExplorer::QMLType && fileType != ProjectExplorer::UnknownFileType)
......
......@@ -153,7 +153,8 @@ protected:
void clear();
static QStringList varNames(FileType type);
static QStringList dynamicVarNames(QtSupport::ProFileReader *readerExact, QtSupport::ProFileReader *readerCumulative);
static QSet<QString> filterFiles(ProjectExplorer::FileType fileType, const QSet<QString> &files);
static QSet<QString> filterFilesProVariables(ProjectExplorer::FileType fileType, const QSet<QString> &files);
static QSet<QString> filterFilesRecursiveEnumerata(ProjectExplorer::FileType fileType, const QSet<QString> &files);
enum ChangeType {
AddToProFile,
......
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