[Vala] Hiding the setter of a property on D-Bus



Hi!

I have got a D-Bus server which exports some properties over D-Bus.
The properties should be read-only over D-Bus but writable on the server side to trigger a property changed over D-Bus.
I already tried variations of the following, but that did not work:


private bool _connected;

public bool Connected {
    get { return _connected; }

    [DBus (visible = false)]
    set { _connected = value; }
}

Is there a way to accomplish this?

Currently I only see the following workaround:
remove the setter and provide a different set-method for _connected and call notify_property( "Connected" )


Thanks!

Christopher

--
Scanned by MailScanner.




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