Module: check_mk
Branch: master
Commit: 7250fafbf2b67d074a771fe4cb60bc9717b7414c
URL:
http://git.mathias-kettner.de/git/?p=check_mk.git;a=commit;h=7250fafbf2b67d…
Author: Jukka Aro <ja(a)mathias-kettner.de>
Date: Fri Mar 16 15:31:25 2018 +0100
Win-agent: reduce no of constructor params 3
SectionGroup always has ',' as its separator, so there is no need to
parameterize this.
---
agents/windows/SectionManager.cc | 4 ++--
agents/windows/build_version | 2 +-
agents/windows/sections/SectionGroup.cc | 3 +--
agents/windows/sections/SectionGroup.h | 6 ++----
agents/windows/sections/SectionSkype.cc | 2 +-
5 files changed, 7 insertions(+), 10 deletions(-)
diff --git a/agents/windows/SectionManager.cc b/agents/windows/SectionManager.cc
index 739f74a..dc90e01 100644
--- a/agents/windows/SectionManager.cc
+++ b/agents/windows/SectionManager.cc
@@ -154,7 +154,7 @@ void SectionManager::loadStaticSections(Configuration &config,
->withToggleIfMissing());
addSection((new SectionGroup("wmi_cpuload", "wmi_cpuload", _env,
_logger,
- _winapi, true, true, ','))
+ _winapi, true, true))
->withToggleIfMissing()
->withSubSection(
(new SectionWMI("system_perf", "system_perf",
_env,
@@ -167,7 +167,7 @@ void SectionManager::loadStaticSections(Configuration &config,
addSection(
(new SectionGroup("msexch", "msexch", _env, _logger, _winapi,
false,
- false, ','))
+ false))
->withToggleIfMissing()
->withSubSection(
(new SectionWMI("msexch_activesync",
"msexch_activesync", _env,
diff --git a/agents/windows/build_version b/agents/windows/build_version
index b589279..90a4e98 100644
--- a/agents/windows/build_version
+++ b/agents/windows/build_version
@@ -1 +1 @@
-3182
+3184
diff --git a/agents/windows/sections/SectionGroup.cc
b/agents/windows/sections/SectionGroup.cc
index 37177d2..81b6383 100644
--- a/agents/windows/sections/SectionGroup.cc
+++ b/agents/windows/sections/SectionGroup.cc
@@ -29,10 +29,9 @@ SectionGroup::SectionGroup(const std::string &outputName,
const std::string &configName,
const Environment &env, Logger *logger,
const WinApiAdaptor &winapi, bool nested,
- bool show_header, char separator)
+ bool show_header)
: Section(outputName, configName, env, logger, winapi)
, _nested(nested)
- , _separator(separator)
, _show_header(show_header) {}
SectionGroup *SectionGroup::withSubSection(Section *section) {
diff --git a/agents/windows/sections/SectionGroup.h
b/agents/windows/sections/SectionGroup.h
index 156364a..f401bc7 100644
--- a/agents/windows/sections/SectionGroup.h
+++ b/agents/windows/sections/SectionGroup.h
@@ -43,8 +43,7 @@ class SectionGroup : public Section {
public:
SectionGroup(const std::string &outputName, const std::string &configName,
const Environment &env, Logger *logger,
- const WinApiAdaptor &winapi, bool nested, bool show_header,
- char separator);
+ const WinApiAdaptor &winapi, bool nested, bool show_header);
/**
* add a section that will be printed as part of this group
@@ -65,7 +64,7 @@ protected:
std::ostream &out, const std::optional<std::string> &remoteIP)
override;
private:
- unsigned char separator() const override { return _separator; }
+ unsigned char separator() const override { return ','; }
bool showHeader() const override { return _show_header; }
std::vector<std::unique_ptr<Section>> _subsections;
@@ -74,7 +73,6 @@ private:
bool _fail_if_missing{false};
const bool _nested;
time_t _disabled_until{0};
- const unsigned char _separator;
const bool _show_header;
};
diff --git a/agents/windows/sections/SectionSkype.cc
b/agents/windows/sections/SectionSkype.cc
index d7005ba..98aa6cc 100644
--- a/agents/windows/sections/SectionSkype.cc
+++ b/agents/windows/sections/SectionSkype.cc
@@ -30,7 +30,7 @@
SectionSkype::SectionSkype(const Environment &env, Logger *logger,
const WinApiAdaptor &winapi)
- : SectionGroup("skype", "skype", env, logger, winapi, true, true,
',')
+ : SectionGroup("skype", "skype", env, logger, winapi, true,
true)
, _nameNumberMap(_logger, _winapi) {
withToggleIfMissing();