View Single Post
qwerty12's Avatar
Posts: 4,274 | Thanked: 5,358 times | Joined on Sep 2007 @ Looking at y'all and sighing
#7
Originally Posted by Lullen View Post
I got it working by removing the service file + remove in the .pro file. Thanks

Since this thread got to be about dbus I have a question about sending a method to lock the screen

my code is:
lock = QDBusMessage::createMethodCall("com.nokia.mce",
"/com/nokia/mce/request",
"com.nokia.mce.request",
"req_tklock_mode_change");
QList<QVariant> args;
args.append("locked");
lock.setArguments(args);
QDBusConnection::sessionBus().send(lock);

and nothing happends.

In wiki I found this but it is for the terminal
dbus-send --system --type=method_call --dest=com.nokia.mce /com/nokia/mce/request com.nokia.mce.request.req_tklock_mode_change string:"locked"

Thanks again!
I know absolutely zilch about QDBus (I do D-Bus GLib in C and Vala), but that dbus-send command is calling the MCE service on the System bus whilst your QDBus code is asking on the Session bus, where MCE does not register itself.

P.S. The mce-dev package provides headers defining the service name et al. if you don't want to hardcode anything: maemo.org/api_refs/5.0/5.0-final/mce-dev/
 

The Following 3 Users Say Thank You to qwerty12 For This Useful Post: