Use QStringList::join to print notifications capabilities

This commit is contained in:
Nicholas Guriev 2020-01-20 08:13:20 +03:00 committed by John Preston
parent 965a01a4cd
commit 8fab9167be
1 changed files with 4 additions and 11 deletions

View File

@ -52,19 +52,19 @@ std::vector<QString> GetServerInformation(
return serverInformation;
}
std::vector<QString> GetCapabilities(
QStringList GetCapabilities(
const std::shared_ptr<QDBusInterface> &notificationInterface) {
QDBusReply<QStringList> capabilitiesReply = notificationInterface
->call(qsl("GetCapabilities"));
if (capabilitiesReply.isValid()) {
return capabilitiesReply.value().toVector().toStdVector();
return capabilitiesReply.value();
} else {
LOG(("Native notification error: %1")
.arg(capabilitiesReply.error().message()));
}
return std::vector<QString>();
return {};
}
QVersionNumber ParseSpecificationVersion(
@ -303,14 +303,7 @@ Manager::Private::Private(Manager *manager, Type type)
}
if (!capabilities.empty()) {
const auto capabilitiesString = std::accumulate(
capabilities.begin(),
capabilities.end(),
QString{},
[](auto &s, auto &p) {
return s + (p + qstr(", "));
}).chopped(2);
const auto capabilitiesString = capabilities.join(", ");
LOG(("Notification daemon capabilities: %1").arg(capabilitiesString));
}
}