Use service in el callback to ignore not relevant events
authorArtem Garmash <artemgarmash@gmail.com>
Sat, 6 Feb 2010 21:34:04 +0000 (23:34 +0200)
committerArtem Garmash <artem.garmash@nokia.com>
Sun, 27 Jun 2010 19:13:46 +0000 (22:13 +0300)
src/el-home-applet.c

index c21f681..0e683f9 100644 (file)
@@ -1041,7 +1041,7 @@ make_query (RTComEl *el, gint event_id)
                 rtcom_el_query_prepare (query,
                                         "is-read", FALSE, RTCOM_EL_OP_EQUAL,
                                         "service", conv_services, RTCOM_EL_OP_IN_STRV,
-                                        /* "event-type", conv_event_types, RTCOM_EL_OP_IN_STRV, */
+                                        "event-type", conv_event_types, RTCOM_EL_OP_IN_STRV,
                                         NULL);
         }
         it = rtcom_el_get_events (el, query);
@@ -1440,20 +1440,21 @@ new_event_cb (RTComEl      *backend,
               ELHomeApplet *self)
 {
         g_warning ("%s %s %s %s", local_uid, remote_uid, remote_ebook_uid, service);
-#if 0
-        const gchar** conv_service = conv_services;
+
+        if (service && service[0] != '\0') {
+                const gchar** conv_service = conv_services;
                 g_warning ("%s", service);
-        do {
-                g_warning ("%s", *conv_service);
-                if (!g_strcmp0 (*conv_service, service)) {
-                        add_new_idle (self);
-                        return;
+                do {
+                        g_warning ("%s", *conv_service);
+                        if (!g_strcmp0 (*conv_service, service)) {
+                                add_new_idle (self);
+                                return;
+                        }
                 }
+                while(*++conv_service);
         }
-        while(*++conv_service);
-#else
-        add_new_idle (self);
-#endif
+        else
+                add_new_idle (self);
 }
 
 static gboolean