Code style fixes
This commit is contained in:
parent
0eb3f019c9
commit
d3aba3572b
4 changed files with 7 additions and 5 deletions
|
@ -52,7 +52,7 @@ void TcpDeviceLink::dataReceived()
|
||||||
NetworkPackage np("");
|
NetworkPackage np("");
|
||||||
NetworkPackage::unserialize(package, &np);
|
NetworkPackage::unserialize(package, &np);
|
||||||
|
|
||||||
emit receivedPackage(np);
|
Q_EMIT receivedPackage(np);
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -44,8 +44,8 @@ Q_SIGNALS:
|
||||||
Q_SCRIPTABLE void chargingChange();
|
Q_SCRIPTABLE void chargingChange();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
bool mIsCharging;
|
|
||||||
int mCharge;
|
int mCharge;
|
||||||
|
bool mIsCharging : 1;
|
||||||
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -31,10 +31,9 @@ K_EXPORT_PLUGIN( KdeConnectPluginFactory("kdeconnect_battery", "kdeconnect_batte
|
||||||
|
|
||||||
BatteryPlugin::BatteryPlugin(QObject *parent, const QVariantList &args)
|
BatteryPlugin::BatteryPlugin(QObject *parent, const QVariantList &args)
|
||||||
: KdeConnectPlugin(parent, args)
|
: KdeConnectPlugin(parent, args)
|
||||||
|
, batteryDbusInterface(new BatteryDbusInterface(parent))
|
||||||
{
|
{
|
||||||
|
|
||||||
batteryDbusInterface = new BatteryDbusInterface(parent);
|
|
||||||
|
|
||||||
NetworkPackage np(PACKAGE_TYPE_BATTERY);
|
NetworkPackage np(PACKAGE_TYPE_BATTERY);
|
||||||
np.set("request",true);
|
np.set("request",true);
|
||||||
device()->sendPackage(np);
|
device()->sendPackage(np);
|
||||||
|
@ -61,7 +60,8 @@ bool BatteryPlugin::receivePackage(const NetworkPackage& np)
|
||||||
bool isCharging = np.get<bool>("isCharging");
|
bool isCharging = np.get<bool>("isCharging");
|
||||||
int currentCharge = np.get<int>("currentCharge");
|
int currentCharge = np.get<int>("currentCharge");
|
||||||
|
|
||||||
if (batteryDbusInterface->isCharging() != currentCharge || batteryDbusInterface->isCharging() != isCharging) {
|
if (batteryDbusInterface->isCharging() != currentCharge
|
||||||
|
|| batteryDbusInterface->isCharging() != isCharging) {
|
||||||
|
|
||||||
batteryDbusInterface->updateValues(isCharging, currentCharge);
|
batteryDbusInterface->updateValues(isCharging, currentCharge);
|
||||||
|
|
||||||
|
|
|
@ -56,6 +56,8 @@ KNotification* TelephonyPlugin::createNotification(const NetworkPackage& np)
|
||||||
+ np.get<QString>("phoneNumber","unknown number")
|
+ np.get<QString>("phoneNumber","unknown number")
|
||||||
+ ":\n"
|
+ ":\n"
|
||||||
+ np.get<QString>("messageBody","");
|
+ np.get<QString>("messageBody","");
|
||||||
|
} else if (event == "talking") {
|
||||||
|
return NULL;
|
||||||
} else {
|
} else {
|
||||||
//TODO: return NULL if !debug
|
//TODO: return NULL if !debug
|
||||||
type = "unknownEvent";
|
type = "unknownEvent";
|
||||||
|
|
Loading…
Reference in a new issue