From 1e9a0f68085b162f817ff5091c6d1e564cb5eccf Mon Sep 17 00:00:00 2001 From: Albert Vaca Cintora Date: Fri, 5 Jul 2019 00:13:55 +0200 Subject: [PATCH] Add braces --- core/device.cpp | 3 ++- plugins/sendnotifications/notificationslistener.cpp | 6 ++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/core/device.cpp b/core/device.cpp index 32e23a899..e3fcd32a9 100644 --- a/core/device.cpp +++ b/core/device.cpp @@ -275,8 +275,9 @@ void Device::addLink(const NetworkPacket& identityPacket, DeviceLink* link) setName(identityPacket.get(QStringLiteral("deviceName"))); d->m_deviceType = str2type(identityPacket.get(QStringLiteral("deviceType"))); - if (d->m_deviceLinks.contains(link)) + if (d->m_deviceLinks.contains(link)) { return; + } d->m_protocolVersion = identityPacket.get(QStringLiteral("protocolVersion"), -1); if (d->m_protocolVersion != NetworkPacket::s_protocolVersion) { diff --git a/plugins/sendnotifications/notificationslistener.cpp b/plugins/sendnotifications/notificationslistener.cpp index 250953a43..76221535d 100644 --- a/plugins/sendnotifications/notificationslistener.cpp +++ b/plugins/sendnotifications/notificationslistener.cpp @@ -103,8 +103,9 @@ void NotificationsListener::loadApplications() const QVariantList list = m_plugin->config()->getList(QStringLiteral("applications")); for (const auto& a : list) { NotifyingApplication app = a.value(); - if (!m_applications.contains(app.name)) + if (!m_applications.contains(app.name)) { m_applications.insert(app.name, app); + } } //qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Loaded" << applications.size() << " applications"; } @@ -212,8 +213,9 @@ uint NotificationsListener::Notify(const QString& appName, uint replacesId, list << QVariant::fromValue(a); m_plugin->config()->setList(QStringLiteral("applications"), list); //qCDebug(KDECONNECT_PLUGIN_SENDNOTIFICATION) << "Added new application to config:" << app; - } else + } else { app = m_applications.value(appName); + } if (!app.active) return 0;