[Vala] Using GDBus to Listen to Messages



Hello,

I've been experimenting with the prowl protocol and transferring
notifications from a linux system to an iDevice with it. I've thus far come
up with a python proof of concept. I wanted to rewrite this into Vala as an
exercise for myself mostly.

A little background first on how I capture the notifications. I basically
use the message filter feature of DBus to get the notifications, filtering
for interface=org.freedesktop.Notifications and member=Notify.

This is how I've done so using Python: http://codepad.org/dauMCxXY

At first with Vala I came up with this using dbus-glib:
http://codepad.org/JiFvX4vK

But I've since found out that dbus-glib has been deprecated and is not
recommended for use. The alternative being GDBus. Thus I attempted to create
an equivalent program using it: http://codepad.org/RorMIB4O

Unfortunately, this does not work as expected, as in not capturing the
notifications as desired. I'm not sure how to this using GDBus. I've asked
around in #vala on GIMPNet as well as #gtk.


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