diff options
author | Chris Toshok <toshok@ximian.com> | 2003-03-27 13:21:18 +0800 |
---|---|---|
committer | Chris Toshok <toshok@src.gnome.org> | 2003-03-27 13:21:18 +0800 |
commit | cd51875a54f1e77fb433a9b90277047dc580608f (patch) | |
tree | 4e9de6f9c1d89596e6b8766bddca185942029fe1 /addressbook/backend/ebook | |
parent | 15f4e1e0abee33191587d78041af3787cf47ebf2 (diff) | |
download | gsoc2013-evolution-cd51875a54f1e77fb433a9b90277047dc580608f.tar.gz gsoc2013-evolution-cd51875a54f1e77fb433a9b90277047dc580608f.tar.zst gsoc2013-evolution-cd51875a54f1e77fb433a9b90277047dc580608f.zip |
[ fixes bug #19178 ] use e_book_load_address_book_by_uri on the passed in
2003-03-26 Chris Toshok <toshok@ximian.com>
[ 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
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r-- | addressbook/backend/ebook/evolution-ldif-importer.c | 21 | ||||
-rw-r--r-- | addressbook/backend/ebook/evolution-vcard-importer.c | 29 |
2 files changed, 8 insertions, 42 deletions
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; } |