logic: implemented disabling of source groups
* added source group status (enabled/disabled) * fixed bug where the removal of an indexed directory has not affected the files to clear * added lots of const and override keywords in SourceGroupSettings
This commit is contained in:
@@ -328,8 +328,9 @@ add_files(
|
||||
settings/SourceGroupSettingsJavaGradle.h
|
||||
settings/SourceGroupSettingsJavaMaven.cpp
|
||||
settings/SourceGroupSettingsJavaMaven.h
|
||||
settings/SourceGroupStatusType.cpp
|
||||
settings/SourceGroupStatusType.h
|
||||
settings/SourceGroupType.cpp
|
||||
|
||||
settings/SourceGroupType.h
|
||||
|
||||
utility/commandline/CommandlineHelper.cpp
|
||||
|
||||
+72
-29
@@ -34,6 +34,7 @@
|
||||
#include "utility/text/TextAccess.h"
|
||||
#include "utility/utility.h"
|
||||
#include "utility/utilityApp.h"
|
||||
#include "utility/utilityFile.h"
|
||||
#include "utility/utilityString.h"
|
||||
|
||||
Project::Project(std::shared_ptr<ProjectSettings> settings, StorageCache* storageCache, bool hasGUI)
|
||||
@@ -314,7 +315,7 @@ RefreshInfo Project::getRefreshInfo(RefreshMode mode) const
|
||||
|
||||
void Project::buildIndex(const RefreshInfo& info, DialogView* dialogView)
|
||||
{
|
||||
if (info.mode == REFRESH_NONE || (!info.filesToClear.size() && !info.filesToIndex.size()))
|
||||
if (info.mode == REFRESH_NONE || (info.filesToClear.empty() && info.filesToIndex.empty()))
|
||||
{
|
||||
if (m_hasGUI)
|
||||
{
|
||||
@@ -334,20 +335,19 @@ void Project::buildIndex(const RefreshInfo& info, DialogView* dialogView)
|
||||
|
||||
dialogView->showUnknownProgressDialog("Preparing Indexing", "Setting up Indexers");
|
||||
|
||||
if (info.mode == REFRESH_ALL_FILES)
|
||||
{
|
||||
m_storage->clear();
|
||||
}
|
||||
|
||||
m_storageCache->clear();
|
||||
|
||||
m_storage->setProjectSettingsText(TextAccess::createFromFile(getProjectSettingsFilePath())->getText());
|
||||
|
||||
std::shared_ptr<TaskGroupSequence> taskSequential = std::make_shared<TaskGroupSequence>();
|
||||
|
||||
// add task for clearing the database
|
||||
if (info.filesToClear.size())
|
||||
if (info.mode == REFRESH_ALL_FILES)
|
||||
{
|
||||
m_storage->clear();
|
||||
}
|
||||
else if (info.filesToClear.size())
|
||||
{
|
||||
// add task for clearing the database
|
||||
taskSequential->addTask(std::make_shared<TaskCleanStorage>(
|
||||
m_storage.get(),
|
||||
utility::toVector(info.filesToClear)
|
||||
@@ -357,9 +357,12 @@ void Project::buildIndex(const RefreshInfo& info, DialogView* dialogView)
|
||||
std::shared_ptr<IndexerCommandList> indexerCommandList = std::make_shared<IndexerCommandList>();
|
||||
for (const std::shared_ptr<SourceGroup>& sourceGroup : m_sourceGroups)
|
||||
{
|
||||
for (const std::shared_ptr<IndexerCommand>& command : sourceGroup->getIndexerCommands(info.filesToIndex))
|
||||
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
|
||||
{
|
||||
indexerCommandList->addCommand(command);
|
||||
for (const std::shared_ptr<IndexerCommand>& command : sourceGroup->getIndexerCommands(info.filesToIndex))
|
||||
{
|
||||
indexerCommandList->addCommand(command);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -467,7 +470,10 @@ std::set<FilePath> Project::getAllSourceFilePaths() const
|
||||
|
||||
for (const std::shared_ptr<SourceGroup>& sourceGroup: m_sourceGroups)
|
||||
{
|
||||
utility::append(allSourceFilePaths, sourceGroup->getAllSourceFilePaths());
|
||||
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
|
||||
{
|
||||
utility::append(allSourceFilePaths, sourceGroup->getAllSourceFilePaths());
|
||||
}
|
||||
}
|
||||
|
||||
return allSourceFilePaths;
|
||||
@@ -478,22 +484,44 @@ RefreshInfo Project::getRefreshInfoForUpdatedFiles() const
|
||||
std::set<FilePath> unchangedFilePaths;
|
||||
std::set<FilePath> changedFilePaths;
|
||||
|
||||
for (const FileInfo& info: m_storage->getFileInfoForAllFiles())
|
||||
{
|
||||
if (info.path.exists())
|
||||
std::set<FilePath> indexedPaths;
|
||||
for (const std::shared_ptr<SourceGroup>& sourceGroup : m_sourceGroups)
|
||||
{
|
||||
if (didFileChange(info))
|
||||
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
|
||||
{
|
||||
utility::append(indexedPaths, sourceGroup->getIndexedPaths());
|
||||
}
|
||||
}
|
||||
indexedPaths = utility::toSet(utility::getTopLevelPaths(utility::toVector(indexedPaths)));
|
||||
|
||||
for (const FileInfo& info : m_storage->getFileInfoForAllFiles())
|
||||
{
|
||||
bool isInIndexedPaths = false;
|
||||
for (const FilePath& indexedPath : indexedPaths)
|
||||
{
|
||||
if (indexedPath == info.path || indexedPath.contains(info.path))
|
||||
{
|
||||
isInIndexedPaths = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isInIndexedPaths && info.path.exists())
|
||||
{
|
||||
if (didFileChange(info))
|
||||
{
|
||||
changedFilePaths.insert(info.path);
|
||||
}
|
||||
else
|
||||
{
|
||||
unchangedFilePaths.insert(info.path);
|
||||
}
|
||||
}
|
||||
else // file has been removed
|
||||
{
|
||||
changedFilePaths.insert(info.path);
|
||||
}
|
||||
else
|
||||
{
|
||||
unchangedFilePaths.insert(info.path);
|
||||
}
|
||||
}
|
||||
else // file has been removed
|
||||
{
|
||||
changedFilePaths.insert(info.path);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -503,7 +531,7 @@ RefreshInfo Project::getRefreshInfoForUpdatedFiles() const
|
||||
utility::append(filesToClear, m_storage->getReferencing(changedFilePaths));
|
||||
|
||||
// handle referenced paths
|
||||
std::set<FilePath> allSourceFilePaths = getAllSourceFilePaths();
|
||||
const std::set<FilePath> allSourceFilePaths = getAllSourceFilePaths();
|
||||
std::set<FilePath> staticSourceFiles = allSourceFilePaths;
|
||||
for (const FilePath& path: changedFilePaths)
|
||||
{
|
||||
@@ -528,7 +556,7 @@ RefreshInfo Project::getRefreshInfoForUpdatedFiles() const
|
||||
staticSourceFiles.erase(path);
|
||||
}
|
||||
|
||||
std::set<FilePath> filesToAdd = staticSourceFiles;
|
||||
const std::set<FilePath> filesToAdd = staticSourceFiles;
|
||||
|
||||
std::set<FilePath> staticSourceFilePaths;
|
||||
for (const FilePath& path: allSourceFilePaths)
|
||||
@@ -545,7 +573,10 @@ RefreshInfo Project::getRefreshInfoForUpdatedFiles() const
|
||||
|
||||
for (const std::shared_ptr<SourceGroup>& sourceGroup: m_sourceGroups)
|
||||
{
|
||||
utility::append(info.filesToIndex, sourceGroup->getSourceFilePathsToIndex(staticSourceFilePaths));
|
||||
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
|
||||
{
|
||||
utility::append(info.filesToIndex, sourceGroup->getSourceFilePathsToIndex(staticSourceFilePaths));
|
||||
}
|
||||
}
|
||||
|
||||
return info;
|
||||
@@ -565,7 +596,7 @@ RefreshInfo Project::getRefreshInfoForIncompleteFiles() const
|
||||
}
|
||||
}
|
||||
|
||||
if (incompleteFiles.size())
|
||||
if (!incompleteFiles.empty())
|
||||
{
|
||||
utility::append(incompleteFiles, m_storage->getReferencing(incompleteFiles));
|
||||
utility::append(info.filesToClear, incompleteFiles);
|
||||
@@ -578,7 +609,10 @@ RefreshInfo Project::getRefreshInfoForIncompleteFiles() const
|
||||
|
||||
for (const std::shared_ptr<SourceGroup>& sourceGroup: m_sourceGroups)
|
||||
{
|
||||
utility::append(info.filesToIndex, sourceGroup->getSourceFilePathsToIndex(staticSourceFilePaths));
|
||||
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
|
||||
{
|
||||
utility::append(info.filesToIndex, sourceGroup->getSourceFilePathsToIndex(staticSourceFilePaths));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -590,6 +624,12 @@ RefreshInfo Project::getRefreshInfoForAllFiles() const
|
||||
RefreshInfo info;
|
||||
info.mode = REFRESH_ALL_FILES;
|
||||
info.filesToIndex = getAllSourceFilePaths();
|
||||
{
|
||||
for (const FileInfo& fileInfo : m_storage->getFileInfoForAllFiles())
|
||||
{
|
||||
info.filesToClear.insert(fileInfo.path);
|
||||
}
|
||||
}
|
||||
return info;
|
||||
}
|
||||
|
||||
@@ -597,9 +637,12 @@ bool Project::hasCxxSourceGroup() const
|
||||
{
|
||||
for (const std::shared_ptr<SourceGroup>& sourceGroup: m_sourceGroups)
|
||||
{
|
||||
if (sourceGroup->getLanguage() == LANGUAGE_C || sourceGroup->getLanguage() == LANGUAGE_CPP)
|
||||
if (sourceGroup->getStatus() == SOURCE_GROUP_STATUS_ENABLED)
|
||||
{
|
||||
return true;
|
||||
if (sourceGroup->getLanguage() == LANGUAGE_C || sourceGroup->getLanguage() == LANGUAGE_CPP)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
|
||||
@@ -9,6 +9,11 @@ SourceGroup::~SourceGroup()
|
||||
{
|
||||
}
|
||||
|
||||
SourceGroupStatusType SourceGroup::getStatus() const
|
||||
{
|
||||
return getSourceGroupSettings()->getStatus();
|
||||
}
|
||||
|
||||
LanguageType SourceGroup::getLanguage() const
|
||||
{
|
||||
return getLanguageTypeForSourceGroupType(getType());
|
||||
@@ -30,12 +35,22 @@ void SourceGroup::fetchAllSourceFilePaths()
|
||||
m_allSourceFilePaths = fileManager.getAllSourceFilePaths();
|
||||
}
|
||||
|
||||
std::set<FilePath> SourceGroup::getIndexedPaths() const
|
||||
{
|
||||
return findAndAddSymlinkedDirectories(getSourceGroupSettings()->getSourcePathsExpandedAndAbsolute());
|
||||
}
|
||||
|
||||
std::set<FilePath> SourceGroup::getExcludedPaths() const
|
||||
{
|
||||
return findAndAddSymlinkedDirectories(getSourceGroupSettings()->getExcludePathsExpandedAndAbsolute());
|
||||
}
|
||||
|
||||
std::set<FilePath> SourceGroup::getAllSourceFilePaths() const
|
||||
{
|
||||
return m_allSourceFilePaths;
|
||||
}
|
||||
|
||||
std::set<FilePath> SourceGroup::getSourceFilePathsToIndex(const std::set<FilePath>& staticSourceFilePaths)
|
||||
std::set<FilePath> SourceGroup::getSourceFilePathsToIndex(const std::set<FilePath>& staticSourceFilePaths) const
|
||||
{
|
||||
std::set<FilePath> sourceFilePathsToIndex;
|
||||
for (const FilePath& sourceFilePath: m_allSourceFilePaths)
|
||||
@@ -48,17 +63,7 @@ std::set<FilePath> SourceGroup::getSourceFilePathsToIndex(const std::set<FilePat
|
||||
return sourceFilePathsToIndex;
|
||||
}
|
||||
|
||||
std::set<FilePath> SourceGroup::getIndexedPaths()
|
||||
{
|
||||
return findAndAddSymlinkedDirectories(getSourceGroupSettings()->getSourcePathsExpandedAndAbsolute());
|
||||
}
|
||||
|
||||
std::set<FilePath> SourceGroup::getExcludedPaths()
|
||||
{
|
||||
return findAndAddSymlinkedDirectories(getSourceGroupSettings()->getExcludePathsExpandedAndAbsolute());
|
||||
}
|
||||
|
||||
std::set<FilePath> SourceGroup::findAndAddSymlinkedDirectories(const std::vector<FilePath>& paths)
|
||||
std::set<FilePath> SourceGroup::findAndAddSymlinkedDirectories(const std::vector<FilePath>& paths) const
|
||||
{
|
||||
std::set<FilePath> resultPaths;
|
||||
for (const FilePath& path: paths)
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "settings/LanguageType.h"
|
||||
#include "settings/SourceGroupStatusType.h"
|
||||
#include "settings/SourceGroupType.h"
|
||||
#include "utility/file/FilePath.h"
|
||||
|
||||
@@ -18,28 +19,27 @@ public:
|
||||
virtual ~SourceGroup();
|
||||
|
||||
virtual SourceGroupType getType() const = 0;
|
||||
SourceGroupStatusType getStatus() const;
|
||||
LanguageType getLanguage() const;
|
||||
|
||||
virtual bool prepareIndexing();
|
||||
|
||||
void fetchAllSourceFilePaths();
|
||||
|
||||
std::set<FilePath> getIndexedPaths() const;
|
||||
std::set<FilePath> getExcludedPaths() const;
|
||||
std::set<FilePath> getAllSourceFilePaths() const;
|
||||
std::set<FilePath> getSourceFilePathsToIndex(const std::set<FilePath>& staticSourceFilePaths);
|
||||
std::set<FilePath> getSourceFilePathsToIndex(const std::set<FilePath>& staticSourceFilePaths) const;
|
||||
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex) = 0;
|
||||
|
||||
protected:
|
||||
std::set<FilePath> getIndexedPaths();
|
||||
std::set<FilePath> getExcludedPaths();
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex) const = 0;
|
||||
|
||||
std::set<FilePath> m_allSourceFilePaths;
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() = 0;
|
||||
virtual std::shared_ptr<const SourceGroupSettings> getSourceGroupSettings() const = 0;
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const = 0;
|
||||
|
||||
std::set<FilePath> findAndAddSymlinkedDirectories(const std::vector<FilePath>& paths);
|
||||
std::set<FilePath> findAndAddSymlinkedDirectories(const std::vector<FilePath>& paths) const;
|
||||
};
|
||||
|
||||
#endif // SOURCE_GROUP_H
|
||||
|
||||
@@ -9,6 +9,7 @@ SourceGroupSettings::SourceGroupSettings(const std::string& id, SourceGroupType
|
||||
, m_id(id)
|
||||
, m_name(sourceGroupTypeToString(type))
|
||||
, m_type(type)
|
||||
, m_status(SOURCE_GROUP_STATUS_ENABLED)
|
||||
, m_standard("")
|
||||
, m_sourcePaths(std::vector<FilePath>())
|
||||
, m_excludePaths(std::vector<FilePath>())
|
||||
@@ -29,7 +30,8 @@ void SourceGroupSettings::load(std::shared_ptr<const ConfigManager> config)
|
||||
{
|
||||
setName(name);
|
||||
}
|
||||
|
||||
|
||||
setStatus(stringToSourceGroupStatusType(getValue(key + "/status", sourceGroupStatusTypeToString(SOURCE_GROUP_STATUS_ENABLED), config)));
|
||||
setStandard(getValue<std::string>(key + "/standard", "", config));
|
||||
setSourcePaths(getPathValues(key + "/source_paths/source_path", config));
|
||||
setExcludePaths(getPathValues(key + "/exclude_paths/exclude_path", config));
|
||||
@@ -40,6 +42,7 @@ void SourceGroupSettings::save(std::shared_ptr<ConfigManager> config)
|
||||
{
|
||||
const std::string key = s_keyPrefix + getId();
|
||||
|
||||
setValue(key + "/status", sourceGroupStatusTypeToString(getStatus()), config);
|
||||
setValue(key + "/name", getName(), config);
|
||||
setValue(key + "/standard", getStandard(), config);
|
||||
setPathValues(key + "/source_paths/source_path", getSourcePaths(), config);
|
||||
@@ -53,6 +56,7 @@ bool SourceGroupSettings::equals(std::shared_ptr<SourceGroupSettings> other) con
|
||||
m_id == other->m_id &&
|
||||
m_name == other->m_name &&
|
||||
m_type == other->m_type &&
|
||||
m_status == other->m_status &&
|
||||
m_standard == other->m_standard &&
|
||||
utility::isPermutation(m_sourcePaths, other->m_sourcePaths) &&
|
||||
utility::isPermutation(m_excludePaths, other->m_excludePaths) &&
|
||||
@@ -100,6 +104,16 @@ SourceGroupType SourceGroupSettings::getType() const
|
||||
return m_type;
|
||||
}
|
||||
|
||||
SourceGroupStatusType SourceGroupSettings::getStatus() const
|
||||
{
|
||||
return m_status;
|
||||
}
|
||||
|
||||
void SourceGroupSettings::setStatus(SourceGroupStatusType status)
|
||||
{
|
||||
m_status = status;
|
||||
}
|
||||
|
||||
std::string SourceGroupSettings::getStandard() const
|
||||
{
|
||||
if (m_standard.empty())
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
#include <vector>
|
||||
|
||||
#include "settings/ProjectSettings.h"
|
||||
#include "settings/SourceGroupStatusType.h"
|
||||
#include "settings/SourceGroupType.h"
|
||||
|
||||
class ProjectSettings;
|
||||
@@ -35,6 +36,9 @@ public:
|
||||
virtual std::vector<std::string> getAvailableLanguageStandards() const = 0;
|
||||
virtual SourceGroupType getType() const;
|
||||
|
||||
SourceGroupStatusType getStatus() const;
|
||||
void setStatus(SourceGroupStatusType status);
|
||||
|
||||
std::string getStandard() const;
|
||||
void setStandard(const std::string& standard);
|
||||
|
||||
@@ -75,6 +79,7 @@ private:
|
||||
std::string m_id;
|
||||
std::string m_name;
|
||||
const SourceGroupType m_type;
|
||||
SourceGroupStatusType m_status;
|
||||
|
||||
std::string m_standard;
|
||||
std::vector<FilePath> m_sourcePaths;
|
||||
|
||||
@@ -10,12 +10,12 @@ public:
|
||||
SourceGroupSettingsCxx(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings);
|
||||
virtual ~SourceGroupSettingsCxx();
|
||||
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config);
|
||||
virtual void save(std::shared_ptr<ConfigManager> config);
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config) override;
|
||||
virtual void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const;
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
virtual std::vector<std::string> getAvailableLanguageStandards() const;
|
||||
virtual std::vector<std::string> getAvailableLanguageStandards() const override;
|
||||
|
||||
std::vector<FilePath> getHeaderSearchPaths() const;
|
||||
std::vector<FilePath> getHeaderSearchPathsExpandedAndAbsolute() const;
|
||||
@@ -29,8 +29,8 @@ public:
|
||||
void setCompilerFlags(const std::vector<std::string>& compilerFlags);
|
||||
|
||||
private:
|
||||
virtual std::vector<std::string> getDefaultSourceExtensions() const;
|
||||
virtual std::string getDefaultStandard() const;
|
||||
virtual std::vector<std::string> getDefaultSourceExtensions() const override;
|
||||
virtual std::string getDefaultStandard() const override;
|
||||
|
||||
std::vector<FilePath> m_headerSearchPaths;
|
||||
std::vector<FilePath> m_frameworkSearchPaths;
|
||||
|
||||
@@ -10,10 +10,10 @@ public:
|
||||
SourceGroupSettingsCxxCdb(const std::string& id, const ProjectSettings* projectSettings);
|
||||
virtual ~SourceGroupSettingsCxxCdb();
|
||||
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config);
|
||||
virtual void save(std::shared_ptr<ConfigManager> config);
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config) override;
|
||||
virtual void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const;
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
FilePath getCompilationDatabasePath() const;
|
||||
FilePath getCompilationDatabasePathExpandedAndAbsolute() const;
|
||||
|
||||
@@ -15,10 +15,10 @@ public:
|
||||
SourceGroupSettingsCxxEmpty(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings);
|
||||
virtual ~SourceGroupSettingsCxxEmpty();
|
||||
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config);
|
||||
virtual void save(std::shared_ptr<ConfigManager> config);
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config) override;
|
||||
virtual void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const;
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
bool getTargetOptionsEnabled() const;
|
||||
void setTargetOptionsEnabled(bool targetOptionsEnabled);
|
||||
|
||||
@@ -13,12 +13,12 @@ public:
|
||||
SourceGroupSettingsJava(const std::string& id, SourceGroupType type, const ProjectSettings* projectSettings);
|
||||
virtual ~SourceGroupSettingsJava();
|
||||
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config);
|
||||
virtual void save(std::shared_ptr<ConfigManager> config);
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config) override;
|
||||
virtual void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const;
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
virtual std::vector<std::string> getAvailableLanguageStandards() const;
|
||||
virtual std::vector<std::string> getAvailableLanguageStandards() const override;
|
||||
|
||||
bool getUseJreSystemLibrary() const;
|
||||
void setUseJreSystemLibrary(bool useJreSystemLibrary);
|
||||
@@ -28,8 +28,8 @@ public:
|
||||
void setClasspath(const std::vector<FilePath>& classpath);
|
||||
|
||||
private:
|
||||
virtual std::vector<std::string> getDefaultSourceExtensions() const;
|
||||
virtual std::string getDefaultStandard() const;
|
||||
virtual std::vector<std::string> getDefaultSourceExtensions() const override;
|
||||
virtual std::string getDefaultStandard() const override;
|
||||
|
||||
bool m_useJreSystemLibrary;
|
||||
std::vector<FilePath> m_classpath;
|
||||
|
||||
@@ -10,10 +10,10 @@ public:
|
||||
SourceGroupSettingsJavaGradle(const std::string& id, const ProjectSettings* projectSettings);
|
||||
virtual ~SourceGroupSettingsJavaGradle();
|
||||
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config);
|
||||
virtual void save(std::shared_ptr<ConfigManager> config);
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config) override;
|
||||
virtual void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const;
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
FilePath getGradleProjectFilePath() const;
|
||||
FilePath getGradleProjectFilePathExpandedAndAbsolute() const;
|
||||
|
||||
@@ -10,10 +10,10 @@ public:
|
||||
SourceGroupSettingsJavaMaven(const std::string& id, const ProjectSettings* projectSettings);
|
||||
virtual ~SourceGroupSettingsJavaMaven();
|
||||
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config);
|
||||
virtual void save(std::shared_ptr<ConfigManager> config);
|
||||
virtual void load(std::shared_ptr<const ConfigManager> config) override;
|
||||
virtual void save(std::shared_ptr<ConfigManager> config) override;
|
||||
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const;
|
||||
virtual bool equals(std::shared_ptr<SourceGroupSettings> other) const override;
|
||||
|
||||
FilePath getMavenProjectFilePath() const;
|
||||
FilePath getMavenProjectFilePathExpandedAndAbsolute() const;
|
||||
|
||||
@@ -0,0 +1,29 @@
|
||||
#include "settings/SourceGroupStatusType.h"
|
||||
|
||||
std::string sourceGroupStatusTypeToString(SourceGroupStatusType v)
|
||||
{
|
||||
switch (v)
|
||||
{
|
||||
case SOURCE_GROUP_STATUS_ENABLED:
|
||||
return "enabled";
|
||||
case SOURCE_GROUP_STATUS_DISABLED:
|
||||
return "disabled";
|
||||
case SOURCE_GROUP_STATUS_UNKNOWN:
|
||||
break;
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
SourceGroupStatusType stringToSourceGroupStatusType(std::string v)
|
||||
{
|
||||
if (v == sourceGroupStatusTypeToString(SOURCE_GROUP_STATUS_ENABLED))
|
||||
{
|
||||
return SOURCE_GROUP_STATUS_ENABLED;
|
||||
}
|
||||
else if (v == sourceGroupStatusTypeToString(SOURCE_GROUP_STATUS_DISABLED))
|
||||
{
|
||||
return SOURCE_GROUP_STATUS_DISABLED;
|
||||
}
|
||||
|
||||
return SOURCE_GROUP_STATUS_UNKNOWN;
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
#ifndef SOURCE_GROUP_STATUS_TYPE_H
|
||||
#define SOURCE_GROUP_STATUS_TYPE_H
|
||||
|
||||
#include <string>
|
||||
|
||||
enum SourceGroupStatusType
|
||||
{
|
||||
SOURCE_GROUP_STATUS_ENABLED,
|
||||
SOURCE_GROUP_STATUS_DISABLED,
|
||||
SOURCE_GROUP_STATUS_UNKNOWN
|
||||
};
|
||||
|
||||
std::string sourceGroupStatusTypeToString(SourceGroupStatusType v);
|
||||
SourceGroupStatusType stringToSourceGroupStatusType(std::string v);
|
||||
|
||||
#endif // SOURCE_GROUP_STATUS_TYPE_H
|
||||
@@ -26,3 +26,8 @@ std::shared_ptr<SourceGroupSettings> SourceGroupCxx::getSourceGroupSettings()
|
||||
{
|
||||
return getSourceGroupSettingsCxx();
|
||||
}
|
||||
|
||||
std::shared_ptr<const SourceGroupSettings> SourceGroupCxx::getSourceGroupSettings() const
|
||||
{
|
||||
return getSourceGroupSettingsCxx();
|
||||
}
|
||||
|
||||
@@ -15,7 +15,9 @@ public:
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsCxx> getSourceGroupSettingsCxx() = 0;
|
||||
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings();
|
||||
virtual std::shared_ptr<const SourceGroupSettingsCxx> getSourceGroupSettingsCxx() const = 0;
|
||||
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
|
||||
virtual std::shared_ptr<const SourceGroupSettings> getSourceGroupSettings() const override;
|
||||
};
|
||||
|
||||
#endif // SOURCE_GROUP_CXX_H
|
||||
|
||||
@@ -47,7 +47,7 @@ bool SourceGroupCxxCdb::prepareIndexing()
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxCdb::getIndexerCommands(const std::set<FilePath>& filesToIndex)
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxCdb::getIndexerCommands(const std::set<FilePath>& filesToIndex) const
|
||||
{
|
||||
std::shared_ptr<ApplicationSettings> appSettings = ApplicationSettings::getInstance();
|
||||
|
||||
@@ -128,6 +128,11 @@ std::shared_ptr<SourceGroupSettingsCxx> SourceGroupCxxCdb::getSourceGroupSetting
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::shared_ptr<const SourceGroupSettingsCxx> SourceGroupCxxCdb::getSourceGroupSettingsCxx() const
|
||||
{
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupCxxCdb::getAllSourcePaths() const
|
||||
{
|
||||
std::vector<FilePath> sourcePaths;
|
||||
|
||||
@@ -13,14 +13,15 @@ public:
|
||||
SourceGroupCxxCdb(std::shared_ptr<SourceGroupSettingsCxxCdb> settings);
|
||||
virtual ~SourceGroupCxxCdb();
|
||||
|
||||
virtual SourceGroupType getType() const;
|
||||
virtual SourceGroupType getType() const override;
|
||||
|
||||
virtual bool prepareIndexing();
|
||||
virtual bool prepareIndexing() override;
|
||||
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex);
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex) const override;
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsCxx> getSourceGroupSettingsCxx();
|
||||
virtual std::shared_ptr<SourceGroupSettingsCxx> getSourceGroupSettingsCxx() override;
|
||||
virtual std::shared_ptr<const SourceGroupSettingsCxx> getSourceGroupSettingsCxx() const override;
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const;
|
||||
|
||||
std::shared_ptr<SourceGroupSettingsCxxCdb> m_settings;
|
||||
|
||||
@@ -18,7 +18,7 @@ SourceGroupType SourceGroupCxxEmpty::getType() const
|
||||
return m_settings->getType(); // may be either C or Cpp
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxEmpty::getIndexerCommands(const std::set<FilePath>& filesToIndex)
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupCxxEmpty::getIndexerCommands(const std::set<FilePath>& filesToIndex) const
|
||||
{
|
||||
std::shared_ptr<ApplicationSettings> appSettings = ApplicationSettings::getInstance();
|
||||
|
||||
@@ -80,6 +80,11 @@ std::shared_ptr<SourceGroupSettingsCxx> SourceGroupCxxEmpty::getSourceGroupSetti
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::shared_ptr<const SourceGroupSettingsCxx> SourceGroupCxxEmpty::getSourceGroupSettingsCxx() const
|
||||
{
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupCxxEmpty::getAllSourcePaths() const
|
||||
{
|
||||
return m_settings->getSourcePathsExpandedAndAbsolute();
|
||||
|
||||
@@ -13,13 +13,14 @@ public:
|
||||
SourceGroupCxxEmpty(std::shared_ptr<SourceGroupSettingsCxxEmpty> settings);
|
||||
virtual ~SourceGroupCxxEmpty();
|
||||
|
||||
virtual SourceGroupType getType() const;
|
||||
virtual SourceGroupType getType() const override;
|
||||
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex);
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex) const override;
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsCxx> getSourceGroupSettingsCxx();
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const;
|
||||
virtual std::shared_ptr<SourceGroupSettingsCxx> getSourceGroupSettingsCxx() override;
|
||||
virtual std::shared_ptr<const SourceGroupSettingsCxx> getSourceGroupSettingsCxx() const override;
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const override;
|
||||
|
||||
std::shared_ptr<SourceGroupSettingsCxxEmpty> m_settings;
|
||||
};
|
||||
|
||||
@@ -30,7 +30,7 @@ bool SourceGroupJava::prepareIndexing()
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJava::getIndexerCommands(const std::set<FilePath>& filesToIndex)
|
||||
std::vector<std::shared_ptr<IndexerCommand>> SourceGroupJava::getIndexerCommands(const std::set<FilePath>& filesToIndex) const
|
||||
{
|
||||
const std::string languageStandard = getSourceGroupSettingsJava()->getStandard();
|
||||
|
||||
@@ -56,6 +56,11 @@ std::shared_ptr<SourceGroupSettings> SourceGroupJava::getSourceGroupSettings()
|
||||
return getSourceGroupSettingsJava();
|
||||
}
|
||||
|
||||
std::shared_ptr<const SourceGroupSettings> SourceGroupJava::getSourceGroupSettings() const
|
||||
{
|
||||
return getSourceGroupSettingsJava();
|
||||
}
|
||||
|
||||
bool SourceGroupJava::prepareJavaEnvironment()
|
||||
{
|
||||
const std::string errorString = utility::prepareJavaEnvironment();
|
||||
@@ -86,7 +91,7 @@ bool SourceGroupJava::prepareJavaEnvironment()
|
||||
}
|
||||
|
||||
|
||||
std::vector<FilePath> SourceGroupJava::getClassPath()
|
||||
std::vector<FilePath> SourceGroupJava::getClassPath() const
|
||||
{
|
||||
LOG_INFO("Retrieving classpath for indexer commands");
|
||||
std::vector<FilePath> classPath = doGetClassPath();
|
||||
@@ -94,7 +99,7 @@ std::vector<FilePath> SourceGroupJava::getClassPath()
|
||||
return classPath;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupJava::doGetClassPath()
|
||||
std::vector<FilePath> SourceGroupJava::doGetClassPath() const
|
||||
{
|
||||
std::vector<FilePath> classPath;
|
||||
|
||||
@@ -128,7 +133,7 @@ std::vector<FilePath> SourceGroupJava::doGetClassPath()
|
||||
return classPath;
|
||||
}
|
||||
|
||||
std::set<FilePath> SourceGroupJava::fetchRootDirectories()
|
||||
std::set<FilePath> SourceGroupJava::fetchRootDirectories() const
|
||||
{
|
||||
std::shared_ptr<DialogView> dialogView = Application::getInstance()->getDialogView();
|
||||
dialogView->showUnknownProgressDialog("Preparing Project", "Gathering Root\nDirectories");
|
||||
|
||||
@@ -15,21 +15,22 @@ public:
|
||||
SourceGroupJava();
|
||||
virtual ~SourceGroupJava();
|
||||
|
||||
virtual bool prepareIndexing();
|
||||
virtual bool prepareIndexing() override;
|
||||
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex);
|
||||
virtual std::vector<std::shared_ptr<IndexerCommand>> getIndexerCommands(const std::set<FilePath>& filesToIndex) const override;
|
||||
|
||||
protected:
|
||||
virtual std::vector<FilePath> doGetClassPath();
|
||||
virtual std::vector<FilePath> doGetClassPath() const;
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsJava> getSourceGroupSettingsJava() = 0;
|
||||
|
||||
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings();
|
||||
virtual std::shared_ptr<const SourceGroupSettingsJava> getSourceGroupSettingsJava() const = 0;
|
||||
virtual std::shared_ptr<SourceGroupSettings> getSourceGroupSettings() override;
|
||||
virtual std::shared_ptr<const SourceGroupSettings> getSourceGroupSettings() const override;
|
||||
bool prepareJavaEnvironment();
|
||||
|
||||
std::vector<FilePath> getClassPath();
|
||||
std::set<FilePath> fetchRootDirectories();
|
||||
std::vector<FilePath> getClassPath() const;
|
||||
std::set<FilePath> fetchRootDirectories() const;
|
||||
};
|
||||
|
||||
#endif // SOURCE_GROUP_JAVA_H
|
||||
|
||||
@@ -21,6 +21,11 @@ std::shared_ptr<SourceGroupSettingsJava> SourceGroupJavaEmpty::getSourceGroupSet
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::shared_ptr<const SourceGroupSettingsJava> SourceGroupJavaEmpty::getSourceGroupSettingsJava() const
|
||||
{
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupJavaEmpty::getAllSourcePaths() const
|
||||
{
|
||||
return m_settings->getSourcePathsExpandedAndAbsolute();
|
||||
|
||||
@@ -14,11 +14,12 @@ public:
|
||||
SourceGroupJavaEmpty(std::shared_ptr<SourceGroupSettingsJavaEmpty> settings);
|
||||
virtual ~SourceGroupJavaEmpty();
|
||||
|
||||
virtual SourceGroupType getType() const;
|
||||
virtual SourceGroupType getType() const override;
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsJava> getSourceGroupSettingsJava();
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const;
|
||||
virtual std::shared_ptr<SourceGroupSettingsJava> getSourceGroupSettingsJava() override;
|
||||
virtual std::shared_ptr<const SourceGroupSettingsJava> getSourceGroupSettingsJava() const override;
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const override;
|
||||
|
||||
std::shared_ptr<SourceGroupSettingsJavaEmpty> m_settings;
|
||||
};
|
||||
|
||||
@@ -38,7 +38,7 @@ bool SourceGroupJavaGradle::prepareIndexing()
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupJavaGradle::doGetClassPath()
|
||||
std::vector<FilePath> SourceGroupJavaGradle::doGetClassPath() const
|
||||
{
|
||||
std::vector<FilePath> classPath = SourceGroupJava::doGetClassPath();
|
||||
|
||||
@@ -65,6 +65,11 @@ std::shared_ptr<SourceGroupSettingsJava> SourceGroupJavaGradle::getSourceGroupSe
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::shared_ptr<const SourceGroupSettingsJava> SourceGroupJavaGradle::getSourceGroupSettingsJava() const
|
||||
{
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupJavaGradle::getAllSourcePaths() const
|
||||
{
|
||||
std::vector<FilePath> sourcePaths;
|
||||
|
||||
@@ -12,15 +12,16 @@ class SourceGroupJavaGradle : public SourceGroupJava
|
||||
public:
|
||||
SourceGroupJavaGradle(std::shared_ptr<SourceGroupSettingsJavaGradle> settings);
|
||||
virtual ~SourceGroupJavaGradle();
|
||||
virtual SourceGroupType getType() const;
|
||||
virtual bool prepareIndexing();
|
||||
virtual SourceGroupType getType() const override;
|
||||
virtual bool prepareIndexing() override;
|
||||
|
||||
protected:
|
||||
virtual std::vector<FilePath> doGetClassPath();
|
||||
virtual std::vector<FilePath> doGetClassPath() const override;
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsJava> getSourceGroupSettingsJava();
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const;
|
||||
virtual std::shared_ptr<SourceGroupSettingsJava> getSourceGroupSettingsJava() override;
|
||||
virtual std::shared_ptr<const SourceGroupSettingsJava> getSourceGroupSettingsJava() const override;
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const override;
|
||||
bool prepareGradleData();
|
||||
|
||||
std::shared_ptr<SourceGroupSettingsJavaGradle> m_settings;
|
||||
|
||||
@@ -38,7 +38,7 @@ bool SourceGroupJavaMaven::prepareIndexing()
|
||||
return true;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupJavaMaven::doGetClassPath()
|
||||
std::vector<FilePath> SourceGroupJavaMaven::doGetClassPath() const
|
||||
{
|
||||
std::vector<FilePath> classPath = SourceGroupJava::doGetClassPath();
|
||||
|
||||
@@ -65,6 +65,11 @@ std::shared_ptr<SourceGroupSettingsJava> SourceGroupJavaMaven::getSourceGroupSet
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::shared_ptr<const SourceGroupSettingsJava> SourceGroupJavaMaven::getSourceGroupSettingsJava() const
|
||||
{
|
||||
return m_settings;
|
||||
}
|
||||
|
||||
std::vector<FilePath> SourceGroupJavaMaven::getAllSourcePaths() const
|
||||
{
|
||||
std::vector<FilePath> sourcePaths;
|
||||
|
||||
@@ -12,15 +12,16 @@ class SourceGroupJavaMaven: public SourceGroupJava
|
||||
public:
|
||||
SourceGroupJavaMaven(std::shared_ptr<SourceGroupSettingsJavaMaven> settings);
|
||||
virtual ~SourceGroupJavaMaven();
|
||||
virtual SourceGroupType getType() const;
|
||||
virtual bool prepareIndexing();
|
||||
virtual SourceGroupType getType() const override;
|
||||
virtual bool prepareIndexing() override;
|
||||
|
||||
protected:
|
||||
virtual std::vector<FilePath> doGetClassPath();
|
||||
virtual std::vector<FilePath> doGetClassPath() const override;
|
||||
|
||||
private:
|
||||
virtual std::shared_ptr<SourceGroupSettingsJava> getSourceGroupSettingsJava();
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const;
|
||||
virtual std::shared_ptr<SourceGroupSettingsJava> getSourceGroupSettingsJava() override;
|
||||
virtual std::shared_ptr<const SourceGroupSettingsJava> getSourceGroupSettingsJava() const override;
|
||||
virtual std::vector<FilePath> getAllSourcePaths() const override;
|
||||
bool prepareMavenData();
|
||||
|
||||
std::shared_ptr<SourceGroupSettingsJavaMaven> m_settings;
|
||||
|
||||
Reference in New Issue
Block a user