logic: added option to execute custom indexer commands in parallel

This commit is contained in:
mlangkabel
2019-01-21 13:28:51 +01:00
parent 85bd0d39c3
commit 3eb9211520
10 changed files with 289 additions and 60 deletions
@@ -7,6 +7,7 @@ SourceGroupSettingsCustomCommand::SourceGroupSettingsCustomCommand(
const std::string& id, const ProjectSettings* projectSettings
)
: SourceGroupSettings(id, SOURCE_GROUP_CUSTOM_COMMAND, projectSettings)
, m_runInParallel(false)
{
}
@@ -26,6 +27,7 @@ void SourceGroupSettingsCustomCommand::load(std::shared_ptr<const ConfigManager>
SourceGroupSettingsWithExcludeFilters::load(config, key);
setCustomCommand(config->getValueOrDefault(key + "/custom_command", std::wstring()));
setRunInParallel(config->getValueOrDefault(key + "/run_in_parallel", false));
}
void SourceGroupSettingsCustomCommand::save(std::shared_ptr<ConfigManager> config)
@@ -39,6 +41,7 @@ void SourceGroupSettingsCustomCommand::save(std::shared_ptr<ConfigManager> confi
SourceGroupSettingsWithExcludeFilters::save(config, key);
config->setValue(key + "/custom_command", getCustomCommand());
config->setValue(key + "/run_in_parallel", getRunInParallel());
}
bool SourceGroupSettingsCustomCommand::equals(std::shared_ptr<SourceGroupSettings> other) const
@@ -66,6 +69,16 @@ void SourceGroupSettingsCustomCommand::setCustomCommand(const std::wstring& cust
m_customCommand = customCommand;
}
bool SourceGroupSettingsCustomCommand::getRunInParallel() const
{
return m_runInParallel;
}
void SourceGroupSettingsCustomCommand::setRunInParallel(bool runInParallel)
{
m_runInParallel = runInParallel;
}
std::vector<std::wstring> SourceGroupSettingsCustomCommand::getDefaultSourceExtensions() const
{
return {};
@@ -25,10 +25,14 @@ public:
const std::wstring& getCustomCommand() const;
void setCustomCommand(const std::wstring& customCommand);
bool getRunInParallel() const;
void setRunInParallel(bool runInParallel);
private:
std::vector<std::wstring> getDefaultSourceExtensions() const override;
std::wstring m_customCommand;
bool m_runInParallel;
};
#endif // SOURCE_GROUP_SETTINGS_CUSTOM_COMMAND_H