diff --git a/plasmoid/declarativeplugin/responsewaiter.cpp b/plasmoid/declarativeplugin/responsewaiter.cpp index e86d41b7c..d03ca6b68 100644 --- a/plasmoid/declarativeplugin/responsewaiter.cpp +++ b/plasmoid/declarativeplugin/responsewaiter.cpp @@ -5,6 +5,7 @@ #include #include #include +#include #include "responsewaiter.h" @@ -73,22 +74,21 @@ void DBusResponse::onCallFinished(QDBusPendingCallWatcher* watcher) qDebug() << "ocf 2"; if (call->isError()) { - qDebug() << "ocf 3"; - - -// onError failure = watcher->property("onError").value(); -// failure(call->error().message()); } else { - qDebug() << "ocf 4444"; + qDebug() << "ocf 4444:" << this; // onComplete success = watcher->property("onComplete").value(); - - QDeclarativeExpression *expr = new QDeclarativeExpression(e_->rootContext(), this, "console.debug(this.onError)"); + +// e_->rootContext()->setContextProperty("test_func", m_onSuccess); + + + QDeclarativeExpression *expr = new QDeclarativeExpression(e_->rootContext(), this, "wow"); qDebug() << "ocf 555"; expr->evaluate(); // result = 400 - qDebug() << "ocf 666"; +// qDebug() << "ocf 666" << expr->error(); +// QDBusMessage reply = call->reply(); if (reply.arguments().count() > 0) diff --git a/plasmoid/package/contents/ui/DeviceDelegate.qml b/plasmoid/package/contents/ui/DeviceDelegate.qml index e3b28b2be..343732039 100644 --- a/plasmoid/package/contents/ui/DeviceDelegate.qml +++ b/plasmoid/package/contents/ui/DeviceDelegate.qml @@ -28,17 +28,45 @@ PlasmaComponents.ListItem id: root property string deviceId: model.deviceId property variant sftp: null + + + DBusResponse + { + id: resp + + function wow() { + console.log("wow") + } + } Component.onCompleted: { sftp = SftpDbusInterfaceFactory.create(deviceId) + +// resp.wow() +// resp.wow() +// resp.wow() +// resp.func = bb + + + resp.pendingCall = sftp.isMounted() + var response = DBusResponseFactory.create() - response.onSuccess = function(v) {console.log("gggggggggggggggggg", v)} + response.pendingCall = sftp.isMounted() + + /* + response.onSuccess = bb; +// function (v) { +// console.debug("SUCCESSS"); +// console.debug(v); +// } console.log("o3") response.onError = function(v) {console.log("eeeeee")} console.log("o4") response.pendingCall = sftp.isMounted() - console.log("o5") + console.log("o5")*/ + + // rr.pendingCall = 1; // onCompleted: {