|
Lines 1146-1151
hal_device_property_set_double (HalDevic
Link Here
|
| 1146 |
} |
1146 |
} |
| 1147 |
|
1147 |
|
| 1148 |
gboolean |
1148 |
gboolean |
|
|
1149 |
hal_device_property_set_strlist (HalDevice *device, const char *key, |
| 1150 |
GSList *value) |
| 1151 |
{ |
| 1152 |
HalProperty *prop; |
| 1153 |
GSList *l; |
| 1154 |
|
| 1155 |
/* check if property already exists */ |
| 1156 |
prop = hal_device_property_find (device, key); |
| 1157 |
|
| 1158 |
if (prop != NULL) { |
| 1159 |
if (hal_property_get_type (prop) != HAL_PROPERTY_TYPE_STRLIST) |
| 1160 |
return FALSE; |
| 1161 |
|
| 1162 |
/* don't bother setting the same value TODO: CHECK IF THIS WORK */ |
| 1163 |
if (hal_property_get_strlist (prop) == value) |
| 1164 |
return TRUE; |
| 1165 |
|
| 1166 |
hal_property_strlist_clear (prop); |
| 1167 |
for (l = value ; l != NULL; l = l->next) { |
| 1168 |
hal_property_strlist_append (prop, l->data); |
| 1169 |
} |
| 1170 |
|
| 1171 |
g_signal_emit (device, signals[PROPERTY_CHANGED], 0, |
| 1172 |
key, FALSE, FALSE); |
| 1173 |
|
| 1174 |
} else { |
| 1175 |
prop = hal_property_new (HAL_PROPERTY_TYPE_STRLIST); |
| 1176 |
for (l = value ; l != NULL; l = l->next) { |
| 1177 |
hal_property_strlist_append (prop, l->data); |
| 1178 |
} |
| 1179 |
g_hash_table_insert (device->private->props, g_strdup (key), prop); |
| 1180 |
|
| 1181 |
g_signal_emit (device, signals[PROPERTY_CHANGED], 0, |
| 1182 |
key, FALSE, TRUE); |
| 1183 |
} |
| 1184 |
|
| 1185 |
return TRUE; |
| 1186 |
} |
| 1187 |
|
| 1188 |
|
| 1189 |
gboolean |
| 1149 |
hal_device_copy_property (HalDevice *from_device, const char *from, HalDevice *to_device, const char *to) |
1190 |
hal_device_copy_property (HalDevice *from_device, const char *from, HalDevice *to_device, const char *to) |
| 1150 |
{ |
1191 |
{ |
| 1151 |
gboolean rc; |
1192 |
gboolean rc; |
|
Lines 1174-1179
hal_device_copy_property (HalDevice *fro
Link Here
|
| 1174 |
rc = hal_device_property_set_double ( |
1215 |
rc = hal_device_property_set_double ( |
| 1175 |
to_device, to, hal_device_property_get_double (from_device, from)); |
1216 |
to_device, to, hal_device_property_get_double (from_device, from)); |
| 1176 |
break; |
1217 |
break; |
|
|
1218 |
case HAL_PROPERTY_TYPE_STRLIST: |
| 1219 |
rc = hal_device_property_set_strlist( |
| 1220 |
to_device, to, hal_device_property_get_strlist (from_device, from)); |
| 1221 |
break; |
| 1222 |
break; |
| 1177 |
} |
1223 |
} |
| 1178 |
} |
1224 |
} |
| 1179 |
|
1225 |
|