aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJon Trowbridge <trow@ximian.com>2001-03-07 01:57:34 +0800
committerJon Trowbridge <trow@src.gnome.org>2001-03-07 01:57:34 +0800
commit0fdd199a2b2edccaec296602d3c93121455d2550 (patch)
tree67565dde221486dee8706924b75f8edd775e86e0
parente5fbbdf9c1b9460fea229a1a80dc6bb4f28c9823 (diff)
downloadgsoc2013-evolution-0fdd199a2b2edccaec296602d3c93121455d2550.tar
gsoc2013-evolution-0fdd199a2b2edccaec296602d3c93121455d2550.tar.gz
gsoc2013-evolution-0fdd199a2b2edccaec296602d3c93121455d2550.tar.bz2
gsoc2013-evolution-0fdd199a2b2edccaec296602d3c93121455d2550.tar.lz
gsoc2013-evolution-0fdd199a2b2edccaec296602d3c93121455d2550.tar.xz
gsoc2013-evolution-0fdd199a2b2edccaec296602d3c93121455d2550.tar.zst
gsoc2013-evolution-0fdd199a2b2edccaec296602d3c93121455d2550.zip
Added. Just encapsulates opening
2001-03-06 Jon Trowbridge <trow@ximian.com> * backend/ebook/e-book.c (e_book_load_local_address_book): Added. Just encapsulates opening file://~username/evolution/local/Contactes/addressbook.db, so that path doesn't need to be hardwired in throughout the code. svn path=/trunk/; revision=8570
-rw-r--r--addressbook/ChangeLog7
-rw-r--r--addressbook/backend/ebook/e-book.c24
-rw-r--r--addressbook/backend/ebook/e-book.h11
3 files changed, 40 insertions, 2 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 027dfb3e6c..16cd8cf5be 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,10 @@
+2001-03-06 Jon Trowbridge <trow@ximian.com>
+
+ * backend/ebook/e-book.c (e_book_load_local_address_book): Added.
+ Just encapsulates opening
+ file://~username/evolution/local/Contactes/addressbook.db, so that
+ path doesn't need to be hardwired in throughout the code.
+
2001-03-06 Benjamin Kahn <xkahn@cybersites.com>
* contact-editor/e-contact-quick-add.c (clicked_cb):
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index 438445aa9a..a4dd4e196f 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -11,6 +11,8 @@
#include <config.h>
#include <gtk/gtksignal.h>
#include <gtk/gtkmarshal.h>
+#include <libgnome/gnome-defs.h>
+#include <libgnome/gnome-util.h>
#include <liboaf/liboaf.h>
#include "addressbook.h"
@@ -512,6 +514,28 @@ e_book_unload_uri (EBook *book)
book->priv->load_state = URINotLoaded;
}
+gboolean
+e_book_load_local_address_book (EBook *book, EBookCallback open_response, gpointer closure)
+{
+ gchar *filename;
+ gchar *uri;
+ gboolean rv;
+
+ g_return_val_if_fail (book != NULL, FALSE);
+ g_return_val_if_fail (E_IS_BOOK (book), FALSE);
+ g_return_val_if_fail (open_response != NULL, FALSE);
+
+ filename = gnome_util_prepend_user_home ("evolution/local/Contacts/addressbook.db");
+ uri = g_strdup_printf ("file://%s", filename);
+
+ rv = e_book_load_uri (book, uri, open_response, closure);
+
+ g_free (filename);
+ g_free (uri);
+
+ return rv;
+}
+
char *
e_book_get_static_capabilities (EBook *book)
{
diff --git a/addressbook/backend/ebook/e-book.h b/addressbook/backend/ebook/e-book.h
index 6a68e010e4..d992f63471 100644
--- a/addressbook/backend/ebook/e-book.h
+++ b/addressbook/backend/ebook/e-book.h
@@ -53,16 +53,23 @@ typedef void (*EBookFieldsCallback) (EBook *book, EBookStatus status, EList *fie
/* Creating a new addressbook. */
EBook *e_book_new (void);
+
gboolean e_book_load_uri (EBook *book,
const char *uri,
EBookCallback open_response,
gpointer closure);
void e_book_unload_uri (EBook *book);
+
+gboolean e_book_load_local_address_book (EBook *book,
+ EBookCallback open_response,
+ gpointer closure);
+
char *e_book_get_static_capabilities (EBook *book);
gboolean e_book_get_supported_fields (EBook *book,
- EBookFieldsCallback cb,
- gpointer closure);
+ EBookFieldsCallback cb,
+ gpointer closure);
+
/* User authentication. */
void e_book_authenticate_user (EBook *book,