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:
mlangkabel
2018-01-15 14:39:15 +01:00
parent c569f921a2
commit cad064b9da
28 changed files with 268 additions and 112 deletions
+9 -4
View File
@@ -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");
+8 -7
View File
@@ -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();
+4 -3
View File
@@ -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;
+6 -5
View File
@@ -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;
+6 -5
View File
@@ -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;