hal/hald hald_dbus.c,1.24,1.25
David Zeuthen
david at freedesktop.org
Tue Feb 22 10:46:58 PST 2005
Update of /cvs/hal/hal/hald
In directory gabe:/tmp/cvs-serv8267/hald
Modified Files:
hald_dbus.c
Log Message:
2005-02-22 David Zeuthen <davidz at redhat.com>
* hald/hald_dbus.c (device_property_atomic_update_end): Send changes
as an array to ensure that PropertyModified signal always has two
parameters
(device_send_signal_property_modified): -do-
* libhal/libhal.c (filter_func): Fix up to receive PropertyModified
in the new format
Index: hald_dbus.c
===================================================================
RCS file: /cvs/hal/hal/hald/hald_dbus.c,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- hald_dbus.c 22 Feb 2005 16:23:28 -0000 1.24
+++ hald_dbus.c 22 Feb 2005 18:46:56 -0000 1.25
@@ -1856,6 +1856,7 @@
if (atomic_count == 0 && num_pending_updates > 0) {
DBusMessage *message;
DBusMessageIter iter;
+ DBusMessageIter iter_array;
for (pu_iter = pending_updates_head;
pu_iter != NULL; pu_iter = pu_iter_next) {
@@ -1882,22 +1883,39 @@
dbus_message_iter_init_append (message, &iter);
dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32,
&num_updates_this);
+
+ dbus_message_iter_open_container (&iter,
+ DBUS_TYPE_ARRAY,
+ DBUS_STRUCT_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_STRING_AS_STRING
+ DBUS_TYPE_BOOLEAN_AS_STRING
+ DBUS_TYPE_BOOLEAN_AS_STRING
+ DBUS_STRUCT_END_CHAR_AS_STRING,
+ &iter_array);
+
for (pu_iter2 = pu_iter; pu_iter2 != NULL;
pu_iter2 = pu_iter2->next) {
if (strcmp (pu_iter2->udi, pu_iter->udi) == 0) {
+ DBusMessageIter iter_struct;
+ dbus_message_iter_open_container (&iter_array,
+ DBUS_TYPE_STRUCT,
+ NULL,
+ &iter_struct);
dbus_message_iter_append_basic
- (&iter,
+ (&iter_struct,
DBUS_TYPE_STRING,
&(pu_iter2->key));
dbus_message_iter_append_basic
- (&iter,
+ (&iter_struct,
DBUS_TYPE_BOOLEAN,
&(pu_iter2->removed));
dbus_message_iter_append_basic
- (&iter,
+ (&iter_struct,
DBUS_TYPE_BOOLEAN,
&(pu_iter2->added));
+ dbus_message_iter_close_container (&iter_array, &iter_struct);
+
/* signal this is already processed */
if (pu_iter2 != pu_iter) {
g_free (pu_iter2->udi);
@@ -1906,6 +1924,8 @@
}
}
+ dbus_message_iter_close_container (&iter, &iter_array);
+
if (!dbus_connection_send
(dbus_connection, message, NULL))
@@ -1955,6 +1975,8 @@
num_pending_updates++;
} else {
dbus_int32_t i;
+ DBusMessageIter iter_struct;
+ DBusMessageIter iter_array;
message = dbus_message_new_signal (udi,
"org.freedesktop.Hal.Device",
@@ -1963,11 +1985,28 @@
dbus_message_iter_init_append (message, &iter);
i = 1;
dbus_message_iter_append_basic (&iter, DBUS_TYPE_INT32, &i);
+
+ dbus_message_iter_open_container (&iter,
+ DBUS_TYPE_ARRAY,
+ DBUS_STRUCT_BEGIN_CHAR_AS_STRING
+ DBUS_TYPE_STRING_AS_STRING
+ DBUS_TYPE_BOOLEAN_AS_STRING
+ DBUS_TYPE_BOOLEAN_AS_STRING
+ DBUS_STRUCT_END_CHAR_AS_STRING,
+ &iter_array);
+
+ dbus_message_iter_open_container (&iter_array,
+ DBUS_TYPE_STRUCT,
+ NULL,
+ &iter_struct);
+
dbus_message_iter_append_basic (&iter, DBUS_TYPE_STRING, &key);
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN,
- &removed);
- dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN,
- &added);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &removed);
+ dbus_message_iter_append_basic (&iter, DBUS_TYPE_BOOLEAN, &added);
+
+ dbus_message_iter_close_container (&iter_array, &iter_struct);
+ dbus_message_iter_close_container (&iter, &iter_array);
+
if (!dbus_connection_send (dbus_connection, message, NULL))
DIE (("error broadcasting message"));
More information about the hal-commit
mailing list