Bug 16427

Summary: PropertyModified not sent as per spec
Product: hal Reporter: Johan Bilien <jobi>
Component: haldAssignee: David Zeuthen (not reading bugmail) <zeuthen>
Status: RESOLVED FIXED QA Contact:
Severity: normal    
Priority: medium CC: danny.kukawka
Version: unspecified   
Hardware: Other   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: fix for hald_dbus.h and spec

Description Johan Bilien 2008-06-19 07:57:31 UTC
The latest spec (0.5.10) says

"Int num_changes, Array of struct {String property_name, Bool added, Bool removed}"

as the signature of the Device::PropertyModified signal.

But hald sends the booleans in this order: removed, added.

The code is a bit confusing too as the prototype does not agree with the declaration:

hald_dbus.c:
void
device_send_signal_property_modified (HalDevice *device, const char *key,
                                      dbus_bool_t added, dbus_bool_t removed)


hald_dbus.h:
void device_send_signal_property_modified (HalDevice *device,
                                           const char *key,
                                           dbus_bool_t removed,
                                           dbus_bool_t added);
Comment 1 Danny Kukawka 2008-06-26 10:40:04 UTC
Created attachment 17396 [details]
fix for hald_dbus.h and spec

Patch including fix for hald_dbus.h and spec. I wouldn't change the code to send the signal as in the spec, because IMO everyone already use it as it currently is.
Comment 2 Johan Bilien 2008-06-26 13:42:37 UTC
-            <entry>Int num_changes, Array of struct {String property_name, Bool added, Bool removed}</entry>
+            <entry>Int num_changes, Array of struct {String property_name, Bool removed, Bool added}</entry>


-					   dbus_bool_t removed,
-					   dbus_bool_t added);
+					   dbus_bool_t added,
+					   dbus_bool_t removed);

makes the prototype not agree with the spec again :)

I think you meant to change the .c
Comment 3 Danny Kukawka 2008-06-26 14:51:40 UTC
(In reply to comment #2)
> makes the prototype not agree with the spec again :)
> 
> I think you meant to change the .c

No, why? The spec is about the DBus signal and not about the internal code of hald_dbus.c which is never visible for external user.

I change the .h file to what the code already do and change the spec to reflect the current behavior of HAL via DBus

Comment 4 Danny Kukawka 2008-08-11 02:44:19 UTC
Commited to git 

Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.