Don't try to check service icon when empty
authorArtem Garmash <artemgarmash@gmail.com>
Sun, 31 Jan 2010 21:40:09 +0000 (23:40 +0200)
committerArtem Garmash <artem.garmash@nokia.com>
Sun, 27 Jun 2010 19:13:45 +0000 (22:13 +0300)
src/el-home-applet.c

index 9b0179c..efbf69d 100644 (file)
@@ -1104,26 +1104,29 @@ read_event (ELHomeApplet *self)
 
         it = make_query (priv->eventlogger, -1);
         show_event (self, it);
-        start_aggregator (self);
-
-        if (g_strcmp0 (priv->local_id, "ring/tel/ring") == 0) {
-                icon_name = "general_sms";
-        }
-        else{
-                McAccount *account;
-                account = osso_abook_account_manager_lookup_by_name (NULL,
-                                                                     priv->local_id);
-                if (account) {
-                        McProfile *profile = mc_profile_lookup (mc_account_compat_get_profile (account));
-                        icon_name = mc_profile_get_icon_name (profile);
+
+        if (priv->event_id >= 0) {
+                start_aggregator (self);
+
+                if (g_strcmp0 (priv->local_id, "ring/tel/ring") == 0) {
+                        icon_name = "general_sms";
+                }
+                else{
+                        McAccount *account;
+                        account = osso_abook_account_manager_lookup_by_name (NULL,
+                                                                             priv->local_id);
+                        if (account) {
+                                McProfile *profile = mc_profile_lookup (mc_account_compat_get_profile (account));
+                                icon_name = mc_profile_get_icon_name (profile);
+                        }
                 }
-        }
 
-        if (icon_name) {
-                gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon),
-                                              icon_name,
-                                              HILDON_ICON_SIZE_XSMALL);
-                gtk_widget_show (priv->icon);
+                if (icon_name) {
+                        gtk_image_set_from_icon_name (GTK_IMAGE (priv->icon),
+                                                      icon_name,
+                                                      HILDON_ICON_SIZE_XSMALL);
+                        gtk_widget_show (priv->icon);
+                }
         }
 
         if (it) g_object_unref (it);
@@ -1382,7 +1385,7 @@ button_press_event_cb (GtkWidget      *widget,
 {
         ELHomeAppletPrivate *priv = self->priv;
 
-        if (priv->event_id > 0) {
+        if (priv->event_id >= 0) {
                 if (event->y < CONTENT_OFFSET_Y_TOP + HEADER_HEIGHT) {
                         if (priv->aggregator &&
                             osso_abook_waitable_is_ready
@@ -1466,7 +1469,7 @@ button_release_event_cb (GtkWidget      *widget,
 
         switch (priv->active) {
         case SELECTED_BODY:
-                if (priv->event_id > 0) {
+                if (priv->event_id >= 0) {
                         reset_scroll (self);
                         open_conversation (self);
                 }