logic: Fixed source files indexed multiple times when in multiple source groups

This commit is contained in:
Eberhard Graether
2017-05-30 12:17:18 +02:00
parent 561284ef5a
commit f760b873b4
7 changed files with 53 additions and 28 deletions
+11 -4
View File
@@ -71,7 +71,8 @@ void SourceGroupJava::fetchAllSourceFilePaths()
m_allSourceFilePaths = fileManager.getAllSourceFilePaths();
}
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJava::getIndexerCommands(const bool fullRefresh)
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJava::getIndexerCommands(
std::set<FilePath>* filesToIndex, bool fullRefresh)
{
std::vector<FilePath> classPath = getClassPath();
@@ -93,12 +94,18 @@ std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJava::getIndexerCommands
}
}
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
const std::set<FilePath>& sourceFilePathsToIndex = (fullRefresh ? getAllSourceFilePaths() : getSourceFilePathsToIndex());
std::vector<std::shared_ptr<IndexerCommand>> indexerCommands;
for (const FilePath& sourcePath: sourceFilePathsToIndex)
{
indexerCommands.push_back(std::make_shared<IndexerCommandJava>(sourcePath, indexedPaths, excludedPaths, classPath));
if (filesToIndex->find(sourcePath) != filesToIndex->end())
{
indexerCommands.push_back(
std::make_shared<IndexerCommandJava>(sourcePath, indexedPaths, excludedPaths, classPath));
filesToIndex->erase(sourcePath);
}
}
return indexerCommands;
+2 -1
View File
@@ -19,7 +19,8 @@ public:
virtual void fetchAllSourceFilePaths();
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const bool fullRefresh);
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(
std::set<FilePath>* filesToIndex, bool fullRefresh);
private:
bool prepareJavaEnvironment();