Commit 1ce87500 authored by Samoilenko Yuri's avatar Samoilenko Yuri
Browse files

simple bugfixes

parent 22718a0b
......@@ -31,7 +31,6 @@
#include "libkdeconnect/devicesmodel.h"
#include "libkdeconnect/notificationsmodel.h"
#include "batteryinterface.h"
Q_EXPORT_PLUGIN2(kdeconnectdeclarativeplugin, KdeConnectDeclarativePlugin);
......@@ -61,8 +60,6 @@ void KdeConnectDeclarativePlugin::registerTypes(const char* uri)
qmlRegisterType<DevicesModel>("org.kde.kdeconnect", 1, 0, "DevicesModel");
qmlRegisterType<NotificationsModel>("org.kde.kdeconnect", 1, 0, "NotificationsModel");
qmlRegisterType<BatteryInterface>("org.kde.kdeconnect", 1, 0, "BatteryInterface");
qmlRegisterType<DBusAsyncResponse>("org.kde.kdeconnect", 1, 0, "DBusAsyncResponse");
}
......
......@@ -35,16 +35,16 @@ private:
class DBusAsyncResponse : public QObject
{
Q_OBJECT
Q_PROPERTY(QVariant pendingCall WRITE setPendingCall)
Q_PROPERTY(bool autoDelete WRITE setAutodelete)
Q_PROPERTY(bool autoDelete READ autodelete WRITE setAutodelete)
public:
DBusAsyncResponse(QObject* parent = 0) : QObject(parent), m_autodelete(false) {}
virtual ~DBusAsyncResponse() {};
void setPendingCall(QVariant e);
Q_INVOKABLE void setPendingCall(QVariant e);
void setAutodelete(bool b) {m_autodelete = b;};
bool autodelete() const {return m_autodelete;}
Q_SIGNALS:
void success(QVariant result);
......
......@@ -31,7 +31,7 @@ QtObject {
property bool available: false
property bool state: false
property int charge: -1
property string displayString: (state) ? ("Charging, " + charge) : ("Discharging, " + charge)
property string displayString: (available) ? ((state) ? ("Charging, " + charge) : ("Discharging, " + charge)) : "No Info"
property variant device: DeviceDbusInterfaceFactory.create(deviceId)
property variant battery: null
......@@ -55,8 +55,8 @@ QtObject {
battery.stateChanged.connect(function(charging) {root.state = charging})
battery.chargeChanged.connect(function(charge) {root.charge = charge})
startupCheck1.pendingCall = battery.isCharging()
startupCheck2.pendingCall = battery.charge()
startupCheck1.setPendingCall(battery.isCharging())
startupCheck2.setPendingCall(battery.charge())
}
else {
battery = null
......
......@@ -48,7 +48,7 @@ QtObject {
sftp.mounted.connect(mounted)
sftp.unmounted.connect(unmounted)
startupCheck.pendingCall = sftp.isMounted()
startupCheck.setPendingCall(sftp.isMounted())
}
function browse() {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment