diff --git a/core/kdeconnectplugin.cpp b/core/kdeconnectplugin.cpp index ae3847739..bc3acf84f 100644 --- a/core/kdeconnectplugin.cpp +++ b/core/kdeconnectplugin.cpp @@ -71,7 +71,7 @@ QString KdeConnectPlugin::dbusPath() const void KdeConnectPlugin::receivePacket(const NetworkPacket &np) { - qCWarning(KDECONNECT_CORE) << metaObject()->className() << "tried to send an recieve an unhandled packet type" << np.type(); + qCWarning(KDECONNECT_CORE) << metaObject()->className() << "received a packet of type" << np.type() << "but doesn't implement receivePacket"; } QString KdeConnectPlugin::iconName() const { diff --git a/plugins/battery/batteryplugin.cpp b/plugins/battery/batteryplugin.cpp index 82c9f78c1..fcf395c9c 100644 --- a/plugins/battery/batteryplugin.cpp +++ b/plugins/battery/batteryplugin.cpp @@ -108,10 +108,6 @@ void BatteryPlugin::slotChargeChanged() void BatteryPlugin::receivePacket(const NetworkPacket &np) { - if (PACKET_TYPE_BATTERY != np.type()) { - return; - } - m_isCharging = np.get(QStringLiteral("isCharging"), false); m_charge = np.get(QStringLiteral("currentCharge"), -1); const int thresholdEvent = np.get(QStringLiteral("thresholdEvent"), (int)ThresholdNone); diff --git a/plugins/clipboard/clipboardplugin.cpp b/plugins/clipboard/clipboardplugin.cpp index ba7b6fd42..7b1685079 100644 --- a/plugins/clipboard/clipboardplugin.cpp +++ b/plugins/clipboard/clipboardplugin.cpp @@ -88,6 +88,7 @@ void ClipboardPlugin::receivePacket(const NetworkPacket &np) qint64 packetTime = np.get(QStringLiteral("timestamp")); // If the packetTime is 0, it means the timestamp is unknown (so do nothing). if (packetTime == 0 || packetTime < ClipboardListener::instance()->updateTimestamp()) { + qCWarning(KDECONNECT_PLUGIN_CLIPBOARD) << "Ignoring clipboard without timestamp"; return; } diff --git a/plugins/connectivity-report/connectivity_reportplugin.cpp b/plugins/connectivity-report/connectivity_reportplugin.cpp index 4d3846c4e..5338aaf4b 100644 --- a/plugins/connectivity-report/connectivity_reportplugin.cpp +++ b/plugins/connectivity-report/connectivity_reportplugin.cpp @@ -32,10 +32,6 @@ int ConnectivityReportPlugin::cellularNetworkStrength() const void ConnectivityReportPlugin::receivePacket(const NetworkPacket &np) { - if (PACKET_TYPE_CONNECTIVITY_REPORT != np.type()) { - return; - } - auto subscriptions = np.get(QStringLiteral("signalStrengths"), QVariantMap()); if (!subscriptions.isEmpty()) { auto networkInfo = subscriptions.first().toMap(); diff --git a/plugins/contacts/contactsplugin.cpp b/plugins/contacts/contactsplugin.cpp index d2570c216..a2a901ec0 100644 --- a/plugins/contacts/contactsplugin.cpp +++ b/plugins/contacts/contactsplugin.cpp @@ -53,9 +53,6 @@ void ContactsPlugin::receivePacket(const NetworkPacket &np) handleResponseUIDsTimestamps(np); } else if (np.type() == PACKET_TYPE_CONTACTS_RESPONSE_VCARDS) { handleResponseVCards(np); - } else { - // Is this check necessary? - qCDebug(KDECONNECT_PLUGIN_CONTACTS) << "Unknown packet type received from device: " << device()->name() << ". Maybe you need to upgrade KDE Connect?"; } } diff --git a/plugins/notifications/notificationsplugin.cpp b/plugins/notifications/notificationsplugin.cpp index befccc657..785be8c4b 100644 --- a/plugins/notifications/notificationsplugin.cpp +++ b/plugins/notifications/notificationsplugin.cpp @@ -35,8 +35,9 @@ void NotificationsPlugin::connected() void NotificationsPlugin::receivePacket(const NetworkPacket &np) { - if (np.get(QStringLiteral("request"))) - return; + if (np.get(QStringLiteral("request"))) { + qCWarning(KDECONNECT_PLUGIN_NOTIFICATION) << "Unexpected notification request. Maybe the paired client is very old?"; + } if (np.get(QStringLiteral("isCancel"))) { QString id = np.get(QStringLiteral("id")); diff --git a/plugins/sftp/sftpplugin.cpp b/plugins/sftp/sftpplugin.cpp index 7d5281ef6..9e8b3d2e4 100644 --- a/plugins/sftp/sftpplugin.cpp +++ b/plugins/sftp/sftpplugin.cpp @@ -126,7 +126,7 @@ void SftpPlugin::receivePacket(const NetworkPacket &np) const QStringList keysList = np.body().keys(); const auto keys = QSet(keysList.begin(), keysList.end()); if (!(fields_c - keys).isEmpty() && !np.has(QStringLiteral("errorMessage"))) { - // packet is invalid + qCWarning(KDECONNECT_PLUGIN_SFTP) << "Invalid sftp packet received"; return; }