]> git.0d.be Git - empathy.git/commitdiff
Add a func to activate any event
authorXavier Claessens <xclaesse@src.gnome.org>
Tue, 13 May 2008 16:26:26 +0000 (16:26 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Tue, 13 May 2008 16:26:26 +0000 (16:26 +0000)
svn path=/trunk/; revision=1098

src/empathy-status-icon.c

index f33447033d581aa8dd31abc5e65ad95fd3dd290c..9d8a8c8c2ce15d8ddc5a0837a6f65ee329b85b8b 100644 (file)
@@ -198,6 +198,27 @@ status_icon_delete_event_cb (GtkWidget         *widget,
        return TRUE;
 }
 
+static void
+status_icon_event_activate (EmpathyStatusIcon *icon,
+                           StatusIconEvent   *event)
+{
+       EmpathyStatusIconPriv *priv = GET_PRIV (icon);
+
+       if (event->func) {
+               event->func (icon, event->user_data);
+       }
+
+       priv->events = g_slist_remove (priv->events, event);
+       status_icon_event_free (event);
+       status_icon_update_tooltip (icon);
+       status_icon_update_icon (icon);
+
+       if (!priv->events && priv->blink_timeout) {
+               g_source_remove (priv->blink_timeout);
+               priv->blink_timeout = 0;
+       }
+}
+
 static void
 status_icon_activate_cb (GtkStatusIcon     *status_icon,
                         EmpathyStatusIcon *icon)
@@ -207,21 +228,7 @@ status_icon_activate_cb (GtkStatusIcon     *status_icon,
        DEBUG ("Activated: %s", priv->events ? "event" : "toggle");
 
        if (priv->events) {
-               StatusIconEvent *event;
-
-               event = priv->events->data;
-               if (event->func) {
-                       event->func (icon, event->user_data);
-               }
-               status_icon_event_free (event);
-               priv->events = g_slist_remove (priv->events, event);
-               status_icon_update_tooltip (icon);
-               status_icon_update_icon (icon);
-
-               if (!priv->events && priv->blink_timeout) {
-                       g_source_remove (priv->blink_timeout);
-                       priv->blink_timeout = 0;
-               }
+               status_icon_event_activate (icon, priv->events->data);
        } else {
                status_icon_toggle_visibility (icon);
        }