[gnome-calendar/calendar-editor] window: sources are unique
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/calendar-editor] window: sources are unique
- Date: Sat, 16 May 2015 20:35:19 +0000 (UTC)
commit 1f0b7e80c164704a09709b9d051d523fb02ef09e
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 9f5b520..5c64712 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]