aboutsummaryrefslogtreecommitdiffstats
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
parentdc452a0d2339cdb9539a826bfa470ffce2d16766 (diff)
downloadgsoc2013-evolution-845369568d2f9af34a1a6e7e4ba08b0f0cd6964d.tar.gz
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
-rw-r--r--addressbook/ChangeLog13
-rw-r--r--addressbook/backend/ebook/e-book.c4
-rw-r--r--addressbook/gui/component/addressbook.c28
3 files changed, 44 insertions, 1 deletions
diff --git a/addressbook/ChangeLog b/addressbook/ChangeLog
index 6f5d0fe9e0..a0fcb2b711 100644
--- a/addressbook/ChangeLog
+++ b/addressbook/ChangeLog
@@ -1,3 +1,16 @@
+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.
+
2001-11-08 Jon Trowbridge <trow@ximian.com>
* gui/component/select-names/e-select-names-bonobo.c
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index e331df149e..c260f3402a 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -555,6 +555,10 @@ e_book_load_uri_step (EBook *book, EBookStatus status, EBookLoadURIData *data)
else {
EBookCallback cb = data->open_response;
gpointer closure = data->closure;
+
+ /* reset the load_state to NotLoaded so people can
+ attempt another load_uri on the book. */
+ book->priv->load_state = URINotLoaded;
g_free (data);
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 {