struct list_head node;
};
+static const char *vkc_type_to_string(enum vkc_type t)
+{
+ switch (t) {
+ case VKC_BOOL:
+ return "bool";
+ case VKC_INT:
+ return "int";
+ case VKC_DOUBLE:
+ return "double";
+ case VKC_STRING:
+ return "string";
+ default:
+ return "unknown";
+ }
+}
+
static int activation_event_match(struct epc_event_handler *handler,
struct epc_event *ev)
{
static int vconf_field_cmp(struct vkc_value *a, struct vkc_value *b)
{
if (a->type != b->type)
- return 0;
+ return -1;
switch (a->type){
case VKC_BOOL:
{
struct vconf_key_changed_event *ev = to_vconf_key_changed_event(event);
struct vconf_key_changed_event_data *ev_data = r->ev_data;
+ int ret;
if (ev_data->key_name && strcmp(ev_data->key_name, ev->key_name))
return 0;
- if (r->match_oldval && !vconf_field_cmp(&ev_data->oldval, &ev->oldval))
- return 0;
+ if (r->match_oldval) {
+ ret = vconf_field_cmp(&ev_data->oldval, &ev->oldval);
+ if (ret < 0) {
+ log_error("vconf type mismatch - oldval for key %s: %s instead of %s",
+ ev_data->key_name,
+ vkc_type_to_string(ev->oldval.type),
+ vkc_type_to_string(ev_data->oldval.type));
+ }
- if (r->match_newval && !vconf_field_cmp(&ev_data->newval, &ev->newval))
- return 0;
+ if (ret <= 0)
+ return 0;
+ }
+
+ if (r->match_newval) {
+ ret = vconf_field_cmp(&ev_data->newval, &ev->newval);
+ if (ret < 0) {
+ log_error("vconf type mismatch - newval for key %s: %s instead of %s",
+ ev_data->key_name,
+ vkc_type_to_string(ev->newval.type),
+ vkc_type_to_string(ev_data->newval.type));
+ }
+
+ if (ret <= 0)
+ return 0;
+ }
return 1;
}