c - DBus Glib Send Signal - No signals being emitted -


I am trying to send a signal to the session message bus I use the D-Pat Debus Debugger with no problem Unfortunately, D-leg does not allow you to connect the debug to the signal, in the replacement I am using dbus-monitor "type = 'signal'" I am going to see what has been sent so far except what I send It works.

My impression is that when a call dbus_g_connection_register_g_object (connection, path, object); It registers all the methods, properties and signals within your self confidence xml file. This can be true because I will not complain about the signals associated with DBUS before joining them.

I g_signal_emit_by_name (self, "application_identifier_changed", "some new mad support", NULL); . This function within the app itself, I can connect to the signal and triggers it, though nothing in DBS Monitor shows I should remember a few simple.

The files contained in this are:
main.c

  Ent main (int arguments, four * argv []) {GINT result; GError * Error = Null; GObject * obj = NULL; Gtk_init (& amp; argc, & amp; argv); Gchar * bus_name = g_strdup_printf ("org.maskwa.PowerviewApplicationPresence_% d", getpid ()); Dbus = dbus_g_bus_get (DBUS_BUS_SESSION, and error); If (null! = Error) {g_error ( "error Dibs connection% s set, error & gt; message); G_error_free (error); return 1;} // dbus_connection_setup_with_g_main (dbus_g_connection_get_connection (dbus), NULL); proxy = dbus_g_proxy_new_for_name (dbus, DBUS_SERVICE_DBUS, DBUS_PATH_DBUS, DBUS_INTERFACE_DBUS); Org_freedesktop_DBus_request_name (proxy, Bs_nam, DBUS_NAME_FLAG_DO_NOT_QUEUE, and results, and error); Obj = g_object_new (POWERVIEW_TYPE_APPLICATION_PRESENCE, NULL); Dbus_g_connection_register_g_object (dbus, "/ org / maskwa / powerview_application_presence", OBG) ; Gtk_main (); if (NULL! = Bus_name) g_free (bus_name); return 0;}  

powerview-application-presence.gob:

  % Headertop {#include & lt; dbus / dbus-g lib.h & gt; #include "main.h"%}% powerview-application-presence-glue.h "%} class Powerview: Application: live appearance: Object {class_init (square) {dbus_g_object_type_install_info (POWERVIEW_TYPE_APPLICATION_PRESENCE, and amp ; Dbus_glib_powerview_application_presence_object_info); } Public void get_application_ identifier (self, gchar ** OUT_aid, GError ** error) {g_print ( "% p powerview_application_presence_get_application_identifier () \ n", self); * OUT_aid = g_strdup ("tld.domain.pong"); } Public void get_display_name (self, gchar ** OUT_display_name, GError ** error) {g_print ( "% p powerview_application_presence_get_display_name () \ n", self); * OUT_display_name = g_strdup ("test app"); G_signal_emit_by_name (self, "application_identifier_changed", "some new crazy support", NULL); } No one in the signal (POINTER) void application_identifier_changed (self, gchar ** new_aid) {g_print ("application_identifier_changed () \ n"); } Last no no hint (POINTER) zero display_name_changed (self, gchar ** new_display_name) {}}  

powerview-application-present-instance.xml

  & Lt ;! DOCTYPE node PUBLIC "- // freedesktop // DTD D-Bus object Intokeshn 1.0 // EN" "http://www.freedesktop.org/standards/dbus/1.0/introspect.dtd"> & Lt ;! - Actiteepi://dbuskfreedesktopkorg/do/dbus-spesifikeshnkhtml#introspekshn-formet Actiteepi://dbuskfreedesktopkorg/do/dbus-spesifikeshnkhtml#masej-protocol-signtures- - & gt; & Lt; Node name = "/" & gt; & Lt; Interface name = "org.maskwa.PowerviewApplicationPresence" & gt; & Lt; Method Name = "GetApplicationIdentifier" & gt; & Lt; Arg type = "s" name = "OUT_aid" direction = "out" /> & Lt; / Method & gt; & Lt; Signal name = "Application identifier changed" & gt; & Lt; RG type = "s" name = "new_aid" /> & Lt; / Sign & gt; & Lt; Method Name = "GetDisplayName" & gt; & Lt; RG type = "s" name = "OUT_display_name" direction = "out" /> & Lt; / Method & gt; & Lt; Signal name = "DisplayNameChanged" & gt; & Lt; RG type = "s" name = "new_display_name" /> & Lt; / Sign & gt; & Lt; / Interface & gt; & Lt; / Node & gt;         

I found the source of this issue. Code> powerview-application-presence.gob , The signal was not the last (signal) in the last code (POINTER) (code) .


Comments

Popular posts from this blog

oracle - The fastest way to check if some records in a database table? -

php - multilevel menu with multilevel array -

jQuery UI: Datepicker month format -