aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/gui
diff options
context:
space:
mode:
authorChris Toshok <toshok@ximian.com>2001-11-10 08:48:43 +0800
committerChris Toshok <toshok@src.gnome.org>2001-11-10 08:48:43 +0800
commit845369568d2f9af34a1a6e7e4ba08b0f0cd6964d (patch)
tree6d4963c8722d7d025597f1ab6a2583e92de0c929 /addressbook/gui
parentdc452a0d2339cdb9539a826bfa470ffce2d16766 (diff)
downloadgsoc2013-evolution-845369568d2f9af34a1a6e7e4ba08b0f0cd6964d.tar
gsoc2013-evolution-845369568d2f9af34a1a6e7e4ba08b0f0cd6964d.tar.gz
gsoc2013-evolution-845369568d2f9af34a1a6e7e4ba08b0f0cd6964d.tar.bz2
gsoc2013-evolution-845369568d2f9af34a1a6e7e4ba08b0f0cd6964d.tar.lz
gsoc2013-evolution-845369568d2f9af34a1a6e7e4ba08b0f0cd6964d.tar.xz
gsoc2013-evolution-845369568d2f9af34a1a6e7e4ba08b0f0cd6964d.tar.zst
gsoc2013-evolution-845369568d2f9af34a1a6e7e4ba08b0f0cd6964d.zip
[ Fixes Ximian bug #14646 ] new function. if the default_book failed to
2001-11-09 Chris Toshok <toshok@ximian.com> [ Fixes Ximian bug #14646 ] * gui/component/addressbook.c (addressbook_default_book_open): new function. if the default_book failed to load, load the local addressbook in its place. addressbook_load_default_book): if we're loading the default_book uri, use addressbook_default_book_open as the open_response. * backend/ebook/e-book.c (e_book_load_uri_step): reset the load_state to NotLoaded so we can attempt another load_uri on the book if it fails. svn path=/trunk/; revision=14654
Diffstat (limited to 'addressbook/gui')
-rw-r--r--addressbook/gui/component/addressbook.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/addressbook/gui/component/addressbook.c b/addressbook/gui/component/addressbook.c
index 3826978f64..10ef247d06 100644
--- a/addressbook/gui/component/addressbook.c
+++ b/addressbook/gui/component/addressbook.c
@@ -668,6 +668,28 @@ addressbook_load_uri (EBook *book, const char *uri,
return rv;
}
+typedef struct {
+ gpointer closure;
+ EBookCallback open_response;
+} DefaultBookClosure;
+
+static void
+addressbook_default_book_open (EBook *book, EBookStatus status, gpointer closure)
+{
+ DefaultBookClosure *default_book_closure = closure;
+ gpointer user_closure = default_book_closure->closure;
+ EBookCallback user_response = default_book_closure->open_response;
+
+ g_free (default_book_closure);
+
+ if (status != E_BOOK_STATUS_SUCCESS) {
+ e_book_load_local_address_book (book, user_response, user_closure);
+ }
+ else {
+ user_response (book, status, user_closure);
+ }
+}
+
gboolean
addressbook_load_default_book (EBook *book, EBookCallback open_response, gpointer closure)
{
@@ -686,7 +708,11 @@ addressbook_load_default_book (EBook *book, EBookCallback open_response, gpointe
CORBA_exception_free (&ev);
if (val) {
- rv = addressbook_load_uri (book, val, open_response, closure);
+ DefaultBookClosure *default_book_closure = g_new (DefaultBookClosure, 1);
+ default_book_closure->closure = closure;
+ default_book_closure->open_response = open_response;
+ rv = addressbook_load_uri (book, val,
+ addressbook_default_book_open, default_book_closure);
g_free (val);
}
else {