From cd51875a54f1e77fb433a9b90277047dc580608f Mon Sep 17 00:00:00 2001 From: Chris Toshok Date: Thu, 27 Mar 2003 05:21:18 +0000 Subject: [ fixes bug #19178 ] use e_book_load_address_book_by_uri on the passed in 2003-03-26 Chris Toshok [ fixes bug #19178 ] * backend/ebook/evolution-ldif-importer.c (ebook_open): use e_book_load_address_book_by_uri on the passed in uri. (load_file_fn): pass the uri. * backend/ebook/evolution-vcard-importer.c (ebook_open): use e_book_load_address_book_by_uri on the passed in uri. (load_file_fn): pass the uri. svn path=/trunk/; revision=20543 --- addressbook/ChangeLog | 11 ++++++++ .../backend/ebook/evolution-ldif-importer.c | 21 +++------------- .../backend/ebook/evolution-vcard-importer.c | 29 +++------------------- 3 files changed, 19 insertions(+), 42 deletions(-) diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog index ad110a7284..994e429dfb 100644 --- a/addressbook/ChangeLog +++ b/addressbook/ChangeLog @@ -1,3 +1,14 @@ +2003-03-26 Chris Toshok + + [ fixes bug #19178 ] + * backend/ebook/evolution-ldif-importer.c (ebook_open): use + e_book_load_address_book_by_uri on the passed in uri. + (load_file_fn): pass the uri. + + * backend/ebook/evolution-vcard-importer.c (ebook_open): use + e_book_load_address_book_by_uri on the passed in uri. + (load_file_fn): pass the uri. + 2003-03-26 Chris Toshok [ fixes bug #34651 ] diff --git a/addressbook/backend/ebook/evolution-ldif-importer.c b/addressbook/backend/ebook/evolution-ldif-importer.c index 08740558c4..7a204daa95 100644 --- a/addressbook/backend/ebook/evolution-ldif-importer.c +++ b/addressbook/backend/ebook/evolution-ldif-importer.c @@ -450,12 +450,8 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure) } static void -ebook_create (LDIFImporter *gci) +ebook_open (LDIFImporter *gci, const char *uri) { -#if 0 - gchar *path, *uri; -#endif - gci->book = e_book_new (); if (!gci->book) { @@ -464,17 +460,8 @@ ebook_create (LDIFImporter *gci) G_GNUC_FUNCTION); return; } -#if 0 - path = g_concat_dir_and_file (g_get_home_dir (), - "evolution/local/Contacts/addressbook.db"); - uri = g_strdup_printf ("file://%s", path); - g_free (path); - - e_book_load_uri (gci->book, uri, book_open_cb, gci); - g_free(uri); -#endif - e_book_load_default_book (gci->book, book_open_cb, gci); + e_book_load_address_book_by_uri (gci->book, uri, book_open_cb, gci); } /* EvolutionImporter methods */ @@ -558,7 +545,7 @@ importer_destroy_cb (gpointer data, static gboolean load_file_fn (EvolutionImporter *importer, const char *filename, - const char *folderpath, + const char *uri, void *closure) { LDIFImporter *gci; @@ -568,7 +555,7 @@ load_file_fn (EvolutionImporter *importer, gci->cardlist = NULL; gci->iterator = NULL; gci->ready = FALSE; - ebook_create (gci); + ebook_open (gci, uri); return TRUE; } diff --git a/addressbook/backend/ebook/evolution-vcard-importer.c b/addressbook/backend/ebook/evolution-vcard-importer.c index 1ce089cb38..b5baebf2d1 100644 --- a/addressbook/backend/ebook/evolution-vcard-importer.c +++ b/addressbook/backend/ebook/evolution-vcard-importer.c @@ -20,7 +20,6 @@ typedef struct { char *filename; - char *folderpath; GList *cardlist; GList *iterator; EBook *book; @@ -44,13 +43,8 @@ book_open_cb (EBook *book, EBookStatus status, gpointer closure) } static void -ebook_create (VCardImporter *gci) +ebook_open (VCardImporter *gci, const char *uri) { -#if 0 - gchar *path, *uri; - gchar *epath; -#endif - gci->book = e_book_new (); if (!gci->book) { @@ -60,21 +54,7 @@ ebook_create (VCardImporter *gci) return; } -#if 0 - path = g_concat_dir_and_file (g_get_home_dir (), "evolution/local"); - uri = g_strdup_printf ("file://%s", path); - g_free (path); - - epath = e_path_to_physical (uri, gci->folderpath); - g_free (uri); - uri = g_strdup_printf ("%s/addressbook.db", epath); - g_free (epath); - - e_book_load_uri (gci->book, uri, book_open_cb, gci); - g_free(uri); -#endif - - e_book_load_default_book (gci->book, book_open_cb, gci); + e_book_load_address_book_by_uri (gci->book, uri, book_open_cb, gci); } /* EvolutionImporter methods */ @@ -188,7 +168,7 @@ importer_destroy_cb (gpointer data, static gboolean load_file_fn (EvolutionImporter *importer, const char *filename, - const char *folderpath, + const char *uri, void *closure) { VCardImporter *gci; @@ -199,11 +179,10 @@ load_file_fn (EvolutionImporter *importer, gci = (VCardImporter *) closure; gci->filename = g_strdup (filename); - gci->folderpath = g_strdup (folderpath); gci->cardlist = NULL; gci->iterator = NULL; gci->ready = FALSE; - ebook_create (gci); + ebook_open (gci, uri); return TRUE; } -- cgit v1.2.3