[gnome-calendar/calendar-editor] source-dialog: sources are unique
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc: 
- Subject: [gnome-calendar/calendar-editor] source-dialog: sources are unique
- Date: Sat, 16 May 2015 22:14:39 +0000 (UTC)
commit 731f4a4e7e318736bba1076f272dfd9156b55882
Author: Erick Pérez Castellanos <erick red gmail com>
Date:   Sat May 16 17:58:34 2015 -0400
    source-dialog: sources are unique
    
    Destroy the row and break the loop as soon as the source is found
 src/gcal-source-dialog.c |    7 +------
 1 files changed, 1 insertions(+), 6 deletions(-)
---
diff --git a/src/gcal-source-dialog.c b/src/gcal-source-dialog.c
index 7a69a99..6664e6e 100644
--- a/src/gcal-source-dialog.c
+++ b/src/gcal-source-dialog.c
@@ -1637,13 +1637,11 @@ remove_source (GcalManager *manager,
                ESource     *source,
                gpointer     user_data)
 {
-  GtkWidget *row;
   GcalSourceDialogPrivate *priv;
   GList *children, *aux;
 
   priv = GCAL_SOURCE_DIALOG (user_data)->priv;
   children = gtk_container_get_children (GTK_CONTAINER (priv->calendars_listbox));
-  row = NULL;
 
   for (aux = children; aux != NULL; aux = aux->next)
     {
@@ -1651,14 +1649,11 @@ remove_source (GcalManager *manager,
 
       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]