[Vala] Vala/DBus with dict object


I am trying to invoke some ConsoleKit methods and I succeed on
almost every method, but not OpenSessionWithParameters.
It has the signature a(sv) (1). I donĀ“t know what I am doing wrong.
I created a method with the same signature and it worked.

It works with python/dbus.

The code is:
using GLib;

public class Sessiondb.Main : Object {
    private const string CK_NAME = "org.freedesktop.ConsoleKit";
    private const string CK_PATH = "/org/freedesktop/ConsoleKit";
    private const string CK_INTERFACE = "org.freedesktop.ConsoleKit";
    private const string CK_MANAGER_PATH = "/org/freedesktop/ConsoleKit/Manager";
    private const string CK_MANAGER_INTERFACE = "org.freedesktop.ConsoleKit.Manager";
    private const string CK_SEAT_INTERFACE = "org.freedesktop.ConsoleKit.Seat";
    private const string CK_SESSION_INTERFACE = "org.freedesktop.ConsoleKit.Session";

    private dynamic DBus.Object ckmanager;

    public Main () {
    public void run () {
        try {
            var conn = DBus.Bus.get (DBus.BusType.SYSTEM);

            this.ckmanager = conn.get_object ("org.freedesktop.ConsoleKit", "/org/freedesktop/ConsoleKit/Manager", "org.freedesktop.ConsoleKit.Manager");

            HashTable<string,Value?> parameters = new HashTable<string,Value?>(str_hash,str_equal);

            Value sessiontype = Value (typeof(string));
            sessiontype.set_string ("sessiondb");
            parameters.insert("session-type" , sessiontype);

            string cookie = ckmanager.OpenSessionWithParameters (parameters);

            stderr.printf ("finished: %s \n", cookie);

        } catch (Error e) {
            stderr.printf ("Oops: %s\n", e.message);
    static int main (string[] args) {
        var main = new Main ();
        main.run ();
        return 0;

The error is Method "OpenSessionWithParameters" with signature "a{sv}" on interface "org.freedesktop.ConsoleKit.Manager" doesn't exist.


(1) http://people.freedesktop.org/~mccann/doc/ConsoleKit/ConsoleKit.html#Manager.OpenSessionWithParameters

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]