aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui/component/addressbook-config.c
diff options
context:
space:
mode:
authorChris Toshok <toshok@helixcode.com>2000-12-31 04:12:33 +0800
committerChris Toshok <toshok@src.gnome.org>2000-12-31 04:12:33 +0800
commitb941c6f04cef47d9d9038a5e8e41f60a3819ef84 (patch)
tree8d95612d96f9a1dbd3fa62c62fcb1bf9a3c21d99 /addressbook/gui/component/addressbook-config.c
parentc4dfc8669bf21acf8c06cc7f79d0864c8e3d4fab (diff)
downloadgsoc2013-evolution-b941c6f04cef47d9d9038a5e8e41f60a3819ef84.tar.gz
gsoc2013-evolution-b941c6f04cef47d9d9038a5e8e41f60a3819ef84.tar.zst
gsoc2013-evolution-b941c6f04cef47d9d9038a5e8e41f60a3819ef84.zip
copy the dialog's source, destroy the dialog after we're done, and make
2000-12-30 Chris Toshok <toshok@helixcode.com> * gui/component/addressbook-config.c (edit_source_clicked): copy the dialog's source, destroy the dialog after we're done, and make sure to update both columns in the clist. (add_source_clicked): copy the dialog's source, and destroy the dialog when we're done. (addressbook_source_dialog_destroy): free up all the dialog's memory. * gui/component/addressbook.c (set_prop): allow file: uri's that point to files, not just dirs that contain addressbook.db. The rule is the addressbook file has to end in .db. * gui/component/addressbook-storage.c (file_source_foreach): contactserver => contactfile. cut and paste error. (addressbook_storage_init_source_uri): use file://%s to build the uri. * gui/component/e-ldap-server-dialog.[ch]: forgot to remove these in my last commit. svn path=/trunk/; revision=7199
Diffstat (limited to 'addressbook/gui/component/addressbook-config.c')
-rw-r--r--addressbook/gui/component/addressbook-config.c33
1 files changed, 29 insertions, 4 deletions
diff --git a/addressbook/gui/component/addressbook-config.c b/addressbook/gui/component/addressbook-config.c
index 57e21340c7..ae15b7aaf1 100644
--- a/addressbook/gui/component/addressbook-config.c
+++ b/addressbook/gui/component/addressbook-config.c
@@ -552,6 +552,26 @@ addressbook_source_dialog_ok_clicked (GtkWidget *widget, AddressbookSourceDialog
dialog->source = addressbook_source_dialog_get_source (dialog);
}
+static void
+addressbook_source_dialog_destroy (AddressbookSourceDialog *dialog)
+{
+ GList *s;
+
+ for (s = dialog->source_pages; s; s = s->next) {
+ AddressbookSourcePageItem *source_item = s->data;
+
+ g_list_foreach (source_item->auths, (GFunc)g_free, NULL);
+ g_list_free (source_item->auths);
+ g_free (source_item);
+ }
+
+ g_list_free (dialog->source_pages);
+
+ if (dialog->source)
+ addressbook_source_free (dialog->source);
+ g_free (dialog);
+}
+
static AddressbookSourceDialog*
addressbook_source_dialog (AddressbookSource *source, GtkWidget *parent)
{
@@ -715,7 +735,7 @@ add_source_clicked (GtkWidget *widget, AddressbookDialog *dialog)
sdialog = addressbook_config_source (NULL, dialog->dialog);
if (sdialog->id == 0) {
/* Ok was clicked */
- AddressbookSource *source = sdialog->source;
+ AddressbookSource *source = addressbook_source_copy(sdialog->source);
gint row;
gchar *text[2];
@@ -727,6 +747,8 @@ add_source_clicked (GtkWidget *widget, AddressbookDialog *dialog)
gnome_property_box_changed (GNOME_PROPERTY_BOX (dialog->dialog));
update_sensitivity (dialog);
}
+
+ addressbook_source_dialog_destroy (sdialog);
}
static void
@@ -740,12 +762,16 @@ edit_source_clicked (GtkWidget *widget, AddressbookDialog *dialog)
sdialog = addressbook_config_source (source, dialog->dialog);
if (sdialog->id == 0) {
/* Ok was clicked */
- source = sdialog->source;
- e_utf8_gtk_clist_set_text (GTK_CLIST (dialog->clistSources), dialog->source_row, 0, source->uri);
+ source = addressbook_source_copy(sdialog->source);
+
+ e_utf8_gtk_clist_set_text (GTK_CLIST (dialog->clistSources), dialog->source_row, 0, source->name);
+ e_utf8_gtk_clist_set_text (GTK_CLIST (dialog->clistSources), dialog->source_row, 1, source->uri);
gtk_clist_set_row_data (GTK_CLIST (dialog->clistSources), dialog->source_row, source);
gnome_property_box_changed (GNOME_PROPERTY_BOX (dialog->dialog));
update_sensitivity (dialog);
}
+
+ addressbook_source_dialog_destroy (sdialog);
}
static void
@@ -786,7 +812,6 @@ static void
addressbook_dialog_close (GnomePropertyBox *property_box, AddressbookDialog *dialog)
{
gtk_object_unref (GTK_OBJECT (dialog->gui));
- /* more stuff dude */
g_free (dialog);
}