From d3aba3572bdbf9c1ca6b88312aa7e1b125764c23 Mon Sep 17 00:00:00 2001 From: Albert Vaca Date: Sun, 18 Aug 2013 18:06:56 +0200 Subject: [PATCH] Code style fixes --- daemon/devicelinks/tcpdevicelink.cpp | 2 +- daemon/plugins/battery/batterydbusinterface.h | 2 +- daemon/plugins/battery/batteryplugin.cpp | 6 +++--- daemon/plugins/telephony/telephonyplugin.cpp | 2 ++ 4 files changed, 7 insertions(+), 5 deletions(-) diff --git a/daemon/devicelinks/tcpdevicelink.cpp b/daemon/devicelinks/tcpdevicelink.cpp index 798f805cd..32c2ad96d 100644 --- a/daemon/devicelinks/tcpdevicelink.cpp +++ b/daemon/devicelinks/tcpdevicelink.cpp @@ -52,7 +52,7 @@ void TcpDeviceLink::dataReceived() NetworkPackage np(""); NetworkPackage::unserialize(package, &np); - emit receivedPackage(np); + Q_EMIT receivedPackage(np); } } diff --git a/daemon/plugins/battery/batterydbusinterface.h b/daemon/plugins/battery/batterydbusinterface.h index 56317ff29..4de673174 100644 --- a/daemon/plugins/battery/batterydbusinterface.h +++ b/daemon/plugins/battery/batterydbusinterface.h @@ -44,8 +44,8 @@ Q_SIGNALS: Q_SCRIPTABLE void chargingChange(); private: - bool mIsCharging; int mCharge; + bool mIsCharging : 1; }; diff --git a/daemon/plugins/battery/batteryplugin.cpp b/daemon/plugins/battery/batteryplugin.cpp index b4a9862f8..b5a177a38 100644 --- a/daemon/plugins/battery/batteryplugin.cpp +++ b/daemon/plugins/battery/batteryplugin.cpp @@ -31,10 +31,9 @@ K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_battery", "kdeconnect_batte BatteryPlugin::BatteryPlugin(QObject *parent, const QVariantList &args) : KdeConnectPlugin(parent, args) + , batteryDbusInterface(new BatteryDbusInterface(parent)) { - batteryDbusInterface = new BatteryDbusInterface(parent); - NetworkPackage np(PACKAGE_TYPE_BATTERY); np.set("request",true); device()->sendPackage(np); @@ -61,7 +60,8 @@ bool BatteryPlugin::receivePackage(const NetworkPackage& np) bool isCharging = np.get("isCharging"); int currentCharge = np.get("currentCharge"); - if (batteryDbusInterface->isCharging() != currentCharge || batteryDbusInterface->isCharging() != isCharging) { + if (batteryDbusInterface->isCharging() != currentCharge + || batteryDbusInterface->isCharging() != isCharging) { batteryDbusInterface->updateValues(isCharging, currentCharge); diff --git a/daemon/plugins/telephony/telephonyplugin.cpp b/daemon/plugins/telephony/telephonyplugin.cpp index 71e0dbae9..9be7f20e8 100644 --- a/daemon/plugins/telephony/telephonyplugin.cpp +++ b/daemon/plugins/telephony/telephonyplugin.cpp @@ -56,6 +56,8 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np) + np.get("phoneNumber","unknown number") + ":\n" + np.get("messageBody",""); + } else if (event == "talking") { + return NULL; } else { //TODO: return NULL if !debug type = "unknownEvent";