From 337155137426e1a07049f59f8a7ec63ec4b94c80 Mon Sep 17 00:00:00 2001 From: Jasmine Hassan Date: Sat, 27 Oct 2012 06:14:17 +0200 Subject: [connect-dialog] fixes for the handling of iconized entries http://git.gnome.org/browse/nautilus/commit/?id=1c826ed78bde5f34fd4a0f72d788b8d0824d6099 --- src/caja-connect-server-dialog.c | 26 ++++++++++++++------------ 1 file changed, 14 insertions(+), 12 deletions(-) diff --git a/src/caja-connect-server-dialog.c b/src/caja-connect-server-dialog.c index ee5416bf..1c759820 100644 --- a/src/caja-connect-server-dialog.c +++ b/src/caja-connect-server-dialog.c @@ -227,17 +227,19 @@ static void iconize_entry (CajaConnectServerDialog *dialog, GtkWidget *entry) { - dialog->details->iconized_entries = - g_list_prepend (dialog->details->iconized_entries, entry); + if (!g_list_find (dialog->details->iconized_entries, entry)) { + dialog->details->iconized_entries = + g_list_prepend (dialog->details->iconized_entries, entry); - gtk_entry_set_icon_from_stock (GTK_ENTRY (entry), - GTK_ENTRY_ICON_SECONDARY, - GTK_STOCK_DIALOG_WARNING); + gtk_entry_set_icon_from_stock (GTK_ENTRY (entry), + GTK_ENTRY_ICON_SECONDARY, + GTK_STOCK_DIALOG_WARNING); - gtk_widget_grab_focus (entry); + gtk_widget_grab_focus (entry); - g_signal_connect (entry, "changed", - G_CALLBACK (iconized_entry_changed_cb), dialog); + g_signal_connect (entry, "changed", + G_CALLBACK (iconized_entry_changed_cb), dialog); + } } static void @@ -709,10 +711,10 @@ caja_connect_server_dialog_finalize (GObject *object) abort_mount_operation (dialog); - g_list_foreach (dialog->details->iconized_entries, - (GFunc) iconized_entry_restore, dialog); - g_list_free (dialog->details->iconized_entries); - dialog->details->iconized_entries = NULL; + if (dialog->details->iconized_entries != NULL) { + g_list_free (dialog->details->iconized_entries); + dialog->details->iconized_entries = NULL; + } G_OBJECT_CLASS (caja_connect_server_dialog_parent_class)->finalize (object); } -- cgit v1.2.1