diff options
| author | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-18 22:35:12 -0400 |
|---|---|---|
| committer | isanae <14251494+isanae@users.noreply.github.com> | 2019-07-22 07:33:38 -0400 |
| commit | f95479b981b41f51a3ecf055c73f42440766e5d7 (patch) | |
| tree | 4626fcd8db75d83f90a3e897836eccd69b9c3b8d /src/shared/util.cpp | |
| parent | c84240b75906fdc1f2ef8b41f4f3c00421dc61fa (diff) | |
log guid for security products
Diffstat (limited to 'src/shared/util.cpp')
| -rw-r--r-- | src/shared/util.cpp | 41 |
1 files changed, 24 insertions, 17 deletions
diff --git a/src/shared/util.cpp b/src/shared/util.cpp index 441b64bd..4ee4b766 100644 --- a/src/shared/util.cpp +++ b/src/shared/util.cpp @@ -1264,7 +1264,7 @@ std::vector<SecurityProduct> Environment::getSecurityProductsFromWMI() const map.insert({
guid,
- {QString::fromStdWString(name), provider, active, upToDate}});
+ {guid, QString::fromStdWString(name), provider, active, upToDate}});
};
{
@@ -1334,7 +1334,7 @@ std::optional<SecurityProduct> Environment::getWindowsFirewall() const }
return SecurityProduct(
- "Windows Firewall", WSC_SECURITY_PROVIDER_FIREWALL, true, true);
+ {}, "Windows Firewall", WSC_SECURITY_PROVIDER_FIREWALL, true, true);
}
@@ -1907,9 +1907,9 @@ std::optional<bool> WindowsInfo::getElevated() const SecurityProduct::SecurityProduct(
- QString name, int provider,
+ QUuid guid, QString name, int provider,
bool active, bool upToDate) :
- m_name(std::move(name)), m_provider(provider),
+ m_guid(std::move(guid)), m_name(std::move(name)), m_provider(provider),
m_active(active), m_upToDate(upToDate)
{
}
@@ -1938,10 +1938,27 @@ QString SecurityProduct::toString() const {
QString s;
- s += m_name + " ";
+ s += m_name + " (" + providerToString() + ")";
+ if (!m_active) {
+ s += ", inactive";
+ }
+
+ if (!m_upToDate) {
+ s += ", definitions outdated";
+ }
+
+ if (!m_guid.isNull()) {
+ s += ", " + m_guid.toString(QUuid::QUuid::WithoutBraces);
+ }
+
+ return s;
+}
+QString SecurityProduct::providerToString() const
+{
QStringList ps;
+
if (m_provider & WSC_SECURITY_PROVIDER_FIREWALL) {
ps.push_back("firewall");
}
@@ -1971,20 +1988,10 @@ QString SecurityProduct::toString() const }
if (ps.empty()) {
- s += "(doesn't provide anything)";
- } else {
- s += "(" + ps.join("|") + ")";
- }
-
- if (!m_active) {
- s += ", inactive";
- }
-
- if (!m_upToDate) {
- s += ", definitions outdated";
+ return "doesn't provider anything";
}
- return s;
+ return ps.join("|");
}
|
