Author: kelnos Date: 2008-04-13 09:28:32 +0000 (Sun, 13 Apr 2008) New Revision: 26831
Modified: xfconf/trunk/xfconfd/xfconf-daemon.c Log: emit the PropertyChanged signal properly. duh. Modified: xfconf/trunk/xfconfd/xfconf-daemon.c =================================================================== --- xfconf/trunk/xfconfd/xfconf-daemon.c 2008-04-12 18:00:33 UTC (rev 26830) +++ xfconf/trunk/xfconfd/xfconf-daemon.c 2008-04-13 09:28:32 UTC (rev 26831) @@ -82,12 +82,20 @@ GObjectClass parent; } XfconfDaemonClass; +enum +{ + SIG_PROPERTY_CHANGED = 0, + N_SIGS, +}; + static void xfconf_daemon_class_init(XfconfDaemonClass *klass); static void xfconf_daemon_init(XfconfDaemon *instance); static void xfconf_daemon_finalize(GObject *obj); +static guint signals[N_SIGS] = { 0, }; + G_DEFINE_TYPE(XfconfDaemon, xfconf_daemon, G_TYPE_OBJECT) @@ -98,9 +106,15 @@ object_class->finalize = xfconf_daemon_finalize; - g_signal_new("property-changed", XFCONF_TYPE_DAEMON, G_SIGNAL_RUN_LAST, 0, - NULL, NULL, xfconf_marshal_VOID__STRING_STRING, G_TYPE_NONE, - 2, G_TYPE_STRING, G_TYPE_STRING); + signals[SIG_PROPERTY_CHANGED] = g_signal_new("property-changed", + XFCONF_TYPE_DAEMON, + G_SIGNAL_RUN_LAST, + 0, + NULL, NULL, + xfconf_marshal_VOID__STRING_STRING, + G_TYPE_NONE, + 2, G_TYPE_STRING, + G_TYPE_STRING); dbus_g_object_type_install_info(G_TYPE_FROM_CLASS(klass), &dbus_glib_xfconf_object_info); @@ -142,28 +156,8 @@ gpointer user_data) { XfconfDaemon *xfconfd = user_data; - DBusGProxy *signal_proxy; - DBusMessage *msg; - - /* FIXME: this function needs to be rewritten to not suck. cache - * the DBusGProxy? is there a better way to emit signals anyway? */ - - signal_proxy = dbus_g_proxy_new_for_name(xfconfd->dbus_conn, - "org.xfce.Xfconf", - "/org/xfce/Xfconf", - "org.xfce.Xfconf"); - - msg = dbus_message_new_signal("/org/xfce/Xfconf", "org.xfce.Xfconf", - "PropertyChanged"); - dbus_message_append_args(msg, - DBUS_TYPE_STRING, &channel, - DBUS_TYPE_STRING, &property, - DBUS_TYPE_INVALID); - - dbus_g_proxy_send(signal_proxy, msg, NULL); - - g_object_unref(G_OBJECT(signal_proxy)); - dbus_message_unref(msg); + g_signal_emit(G_OBJECT(xfconfd), signals[SIG_PROPERTY_CHANGED], 0, + channel, property); } static gboolean _______________________________________________ Xfce4-commits mailing list Xfce4-commits@xfce.org http://foo-projects.org/mailman/listinfo/xfce4-commits