Add braces

This commit is contained in:
Albert Vaca Cintora 2019-07-05 00:13:55 +02:00
parent 85c7bf9a46
commit 1e9a0f6808
2 changed files with 6 additions and 3 deletions

View file

@ -275,8 +275,9 @@ void Device::addLink(const NetworkPacket& identityPacket, DeviceLink* link)
setName(identityPacket.get<QString>(QStringLiteral("deviceName")));
d->m_deviceType = str2type(identityPacket.get<QString>(QStringLiteral("deviceType")));
if (d->m_deviceLinks.contains(link))
if (d->m_deviceLinks.contains(link)) {
return;
}
d->m_protocolVersion = identityPacket.get<int>(QStringLiteral("protocolVersion"), -1);
if (d->m_protocolVersion != NetworkPacket::s_protocolVersion) {

View file

@ -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<NotifyingApplication>();
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<NotifyingApplication>(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;