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( return utility::filterToContainedFilePaths(
filePaths, filePaths,
utility::toSet(indexedPaths),
std::set<FilePath>(), std::set<FilePath>(),
utility::toSet(indexedPaths),
excludeFilters excludeFilters
); );
} }
+9 -16
View File
@@ -1,36 +1,29 @@
#include "utility/utilitySourceGroupCxx.h" #include "utility/utilitySourceGroupCxx.h"
std::set<FilePath> utility::filterToContainedFilePaths( std::set<FilePath> utility::filterToContainedFilePaths(
const std::set<FilePath> filePaths, const std::set<FilePath>& filePaths,
const std::set<FilePath>& indexedSourcePaths, const std::set<FilePath>& indexedFilePaths,
const std::set<FilePath>& indexedHeaderPaths, const std::set<FilePath>& indexedFileOrDirectoryPaths,
const std::vector<FilePathFilter> excludeFilters) const std::vector<FilePathFilter>& excludeFilters)
{ {
std::set<FilePath> containedFilePaths; std::set<FilePath> containedFilePaths;
for (const FilePath& filePath : filePaths) for (const FilePath& filePath : filePaths)
{ {
bool isInIndexedPaths = false; 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; isInIndexedPaths = true;
break; break;
} }
} }
}
if (!isInIndexedPaths) if (!isInIndexedPaths && indexedFilePaths.find(filePath) != indexedFilePaths.end())
{
for (const FilePath& indexedSourcePath : indexedSourcePaths)
{
if (indexedSourcePath == filePath)
{ {
isInIndexedPaths = true; isInIndexedPaths = true;
break;
}
}
} }
if (isInIndexedPaths) if (isInIndexedPaths)
+4 -4
View File
@@ -10,10 +10,10 @@
namespace utility namespace utility
{ {
std::set<FilePath> filterToContainedFilePaths( std::set<FilePath> filterToContainedFilePaths(
const std::set<FilePath> filePaths, const std::set<FilePath>& filePaths,
const std::set<FilePath>& indexedSourcePaths, const std::set<FilePath>& indexedFilePaths,
const std::set<FilePath>& indexedHeaderPaths, const std::set<FilePath>& indexedFileOrDirectoryPaths,
const std::vector<FilePathFilter> excludeFilters); const std::vector<FilePathFilter>& excludeFilters);
} }
#endif // UTILITY_SOURCE_GROUP_CXX_H #endif // UTILITY_SOURCE_GROUP_CXX_H