logic: Fixed files within indexed directories always refreshed in empty C/C++ source groups

This commit is contained in:
Eberhard Graether
2018-08-21 16:49:01 +02:00
parent 5f6747d6a1
commit b64fda77b5
3 changed files with 17 additions and 24 deletions
+1 -1
View File
@@ -34,8 +34,8 @@ std::set<FilePath> SourceGroupCxxEmpty::filterToContainedFilePaths(const std::se
return utility::filterToContainedFilePaths(
filePaths,
utility::toSet(indexedPaths),
std::set<FilePath>(),
utility::toSet(indexedPaths),
excludeFilters
);
}
+12 -19
View File
@@ -1,36 +1,29 @@
#include "utility/utilitySourceGroupCxx.h"
std::set<FilePath> utility::filterToContainedFilePaths(
const std::set<FilePath> filePaths,
const std::set<FilePath>& indexedSourcePaths,
const std::set<FilePath>& indexedHeaderPaths,
const std::vector<FilePathFilter> excludeFilters)
const std::set<FilePath>& filePaths,
const std::set<FilePath>& indexedFilePaths,
const std::set<FilePath>& indexedFileOrDirectoryPaths,
const std::vector<FilePathFilter>& excludeFilters)
{
std::set<FilePath> containedFilePaths;
for (const FilePath& filePath : filePaths)
{
bool isInIndexedPaths = false;
for (const FilePath& indexedFileOrDirectoryPath : indexedFileOrDirectoryPaths)
{
for (const FilePath& indexedHeaderPath : indexedHeaderPaths)
if (indexedFileOrDirectoryPath == filePath || indexedFileOrDirectoryPath.contains(filePath))
{
if (indexedHeaderPath == filePath || indexedHeaderPath.contains(filePath))
{
isInIndexedPaths = true;
break;
}
isInIndexedPaths = true;
break;
}
}
if (!isInIndexedPaths)
if (!isInIndexedPaths && indexedFilePaths.find(filePath) != indexedFilePaths.end())
{
for (const FilePath& indexedSourcePath : indexedSourcePaths)
{
if (indexedSourcePath == filePath)
{
isInIndexedPaths = true;
break;
}
}
isInIndexedPaths = true;
}
if (isInIndexedPaths)
+4 -4
View File
@@ -10,10 +10,10 @@
namespace utility
{
std::set<FilePath> filterToContainedFilePaths(
const std::set<FilePath> filePaths,
const std::set<FilePath>& indexedSourcePaths,
const std::set<FilePath>& indexedHeaderPaths,
const std::vector<FilePathFilter> excludeFilters);
const std::set<FilePath>& filePaths,
const std::set<FilePath>& indexedFilePaths,
const std::set<FilePath>& indexedFileOrDirectoryPaths,
const std::vector<FilePathFilter>& excludeFilters);
}
#endif // UTILITY_SOURCE_GROUP_CXX_H