Bugzilla – Attachment 120931 Details for
Bug 145416
hal: copy_property doesn't work with strlist
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
IDP Log In
|
Forgot Password
[patch]
patch againt git master to support copy_property on strlist
hal-add-copy_property_for_strlist.diff (text/plain), 3.07 KB, created by
Danny Al-Gaaf
on 2007-02-24 16:39:52 UTC
(
hide
)
Description:
patch againt git master to support copy_property on strlist
Filename:
MIME Type:
Creator:
Danny Al-Gaaf
Created:
2007-02-24 16:39:52 UTC
Size:
3.07 KB
patch
obsolete
>diff --git a/hald/device.c b/hald/device.c >index a28eb80..d8f53f6 100644 >--- a/hald/device.c >+++ b/hald/device.c >@@ -1146,6 +1146,47 @@ hal_device_property_set_double (HalDevic > } > > gboolean >+hal_device_property_set_strlist (HalDevice *device, const char *key, >+ GSList *value) >+{ >+ HalProperty *prop; >+ GSList *l; >+ >+ /* check if property already exists */ >+ prop = hal_device_property_find (device, key); >+ >+ if (prop != NULL) { >+ if (hal_property_get_type (prop) != HAL_PROPERTY_TYPE_STRLIST) >+ return FALSE; >+ >+ /* don't bother setting the same value TODO: CHECK IF THIS WORK */ >+ if (hal_property_get_strlist (prop) == value) >+ return TRUE; >+ >+ hal_property_strlist_clear (prop); >+ for (l = value ; l != NULL; l = l->next) { >+ hal_property_strlist_append (prop, l->data); >+ } >+ >+ g_signal_emit (device, signals[PROPERTY_CHANGED], 0, >+ key, FALSE, FALSE); >+ >+ } else { >+ prop = hal_property_new (HAL_PROPERTY_TYPE_STRLIST); >+ for (l = value ; l != NULL; l = l->next) { >+ hal_property_strlist_append (prop, l->data); >+ } >+ g_hash_table_insert (device->private->props, g_strdup (key), prop); >+ >+ g_signal_emit (device, signals[PROPERTY_CHANGED], 0, >+ key, FALSE, TRUE); >+ } >+ >+ return TRUE; >+} >+ >+ >+gboolean > hal_device_copy_property (HalDevice *from_device, const char *from, HalDevice *to_device, const char *to) > { > gboolean rc; >@@ -1174,6 +1215,11 @@ hal_device_copy_property (HalDevice *fro > rc = hal_device_property_set_double ( > to_device, to, hal_device_property_get_double (from_device, from)); > break; >+ case HAL_PROPERTY_TYPE_STRLIST: >+ rc = hal_device_property_set_strlist( >+ to_device, to, hal_device_property_get_strlist (from_device, from)); >+ break; >+ break; > } > } > >diff --git a/hald/device.h b/hald/device.h >index da7a0f8..5bab299 100644 >--- a/hald/device.h >+++ b/hald/device.h >@@ -163,6 +163,9 @@ gboolean hal_device_property_set_bo > gboolean hal_device_property_set_double (HalDevice *device, > const char *key, > double value); >+gboolean hal_device_property_set_strlist (HalDevice *device, >+ const char *key, >+ GSList *value); > gboolean hal_device_property_strlist_append (HalDevice *device, > const char *key, > const char *value); >diff --git a/doc/spec/hal-spec-fdi-files.xml b/doc/spec/hal-spec-fdi-files.xml >index 667171a..81656bc 100644 >--- a/doc/spec/hal-spec-fdi-files.xml >+++ b/doc/spec/hal-spec-fdi-files.xml >@@ -166,7 +166,9 @@ > <literal>strlist</literal> - For <literal><merge></literal> the value is > copied to the property and the current property will be overwritten. For > <literal><append></literal> and <literal><prepend></literal> the >- value is append or prepend to the list as new item. >+ value is append or prepend to the list as new item. Usage of >+ <literal><copy_property></literal> overwrite the complete list with the >+ value of the given property to copy from. > </para> > </listitem> > <listitem>
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
Actions:
View
|
Diff
Attachments on
bug 145416
: 120931