[gnome-calendar] window: sources are unique



commit b04720135f818918ffc9d4cc21f5aa20df600923
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Sat May 16 16:33:46 2015 -0400

    window: sources are unique
    
    There's no need to loop through the rest of the list once the ESource has been
    found

 src/gcal-window.c |   10 ++++------
 1 files changed, 4 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 6d53c18..abf60fa 100644
--- a/src/gcal-window.c
+++ b/src/gcal-window.c
@@ -880,23 +880,21 @@ remove_source (GcalManager *manager,
                gpointer     user_data)
 {
   GcalWindowPrivate *priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data));
-  GtkWidget *row;
   GList *children, *aux;
 
   children = gtk_container_get_children (GTK_CONTAINER (priv->calendar_listbox));
-  row = NULL;
 
   for (aux = children; aux != NULL; aux = aux->next)
     {
       ESource *child_source = g_object_get_data (G_OBJECT (aux->data), "source");
 
       if (child_source != NULL && child_source == source)
-        row = aux->data;
+        {
+          gtk_widget_destroy (aux->data);
+          break;
+        }
     }
 
-  if (row != NULL)
-    gtk_widget_destroy (row);
-
   g_list_free (children);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]