place sidebar: minor change

We generally prefer for loops to iterate over lists.
This commit is contained in:
Matthias Clasen 2015-07-06 21:59:10 -04:00
parent 06f9102840
commit 3cbe6d86af

View File

@ -2317,9 +2317,9 @@ rename_entry_changed (GtkEntry *entry,
gtk_label_set_label (GTK_LABEL (sidebar->rename_error), "");
return;
}
rows = gtk_container_get_children (GTK_CONTAINER (sidebar->list_box));
l = rows;
while (l != NULL && !found)
for (l = rows; l && !found; l = l->next)
{
g_object_get (l->data,
"place-type", &type,
@ -2334,15 +2334,12 @@ rename_entry_changed (GtkEntry *entry,
g_free (uri);
g_free (name);
l = l->next;
}
g_list_free (rows);
gtk_widget_set_sensitive (sidebar->rename_button, !found);
gtk_label_set_label (GTK_LABEL (sidebar->rename_error),
found ? _("This name is already taken") : "");
g_list_free (rows);
}
static void