aboutsummaryrefslogtreecommitdiffstats
path: root/addressbook/backend/ebook
diff options
context:
space:
mode:
authorJP Rosevear <jpr@helixcode.com>2000-11-10 06:36:27 +0800
committerJP Rosevear <jpr@src.gnome.org>2000-11-10 06:36:27 +0800
commitacedf7a316e779c349f76a73c434019262742c60 (patch)
treea6abb42ce8900e386b9ec9a8864a29addb7f68a7 /addressbook/backend/ebook
parent88d445fac5cc704743da23a2e6099fc5a7a8003a (diff)
downloadgsoc2013-evolution-acedf7a316e779c349f76a73c434019262742c60.tar
gsoc2013-evolution-acedf7a316e779c349f76a73c434019262742c60.tar.gz
gsoc2013-evolution-acedf7a316e779c349f76a73c434019262742c60.tar.bz2
gsoc2013-evolution-acedf7a316e779c349f76a73c434019262742c60.tar.lz
gsoc2013-evolution-acedf7a316e779c349f76a73c434019262742c60.tar.xz
gsoc2013-evolution-acedf7a316e779c349f76a73c434019262742c60.tar.zst
gsoc2013-evolution-acedf7a316e779c349f76a73c434019262742c60.zip
Add changed_hash, change list and complete bool
2000-11-09 JP Rosevear <jpr@helixcode.com> * conduit/address-conduit.h: Add changed_hash, change list and complete bool * conduit/address-conduit.c (local_record_from_ecard): Add empty field checks (card_added): callback for book view (card_changed): ditto (card_removed): ditto (sequence_complete): ditto (view_cb): callback for the get changes call (pre_sync): force synchronous loading of book view (for_each): we already have the card so create the local record directly (for_each_modified): Uncomment and fix (delete_record): ditto * conduit/Makefile.am: link against gal for ebook - needs fixing * backend/ebook/e-book.c (e_book_do_response_get_changes): Properly respond to a get_changes call (e_book_check_listener_queue): define the get changes response operation * backend/ebook/e-book-listener.c (e_book_listener_queue_get_changes_response): Queue up a get changes response (impl_BookListener_respond_get_changes): Implement the get_changes method (e_book_listener_get_epv): add get_changes implementation to epv * backend/pas/pas-backend-file.c (pas_backend_file_book_view_copy): Only copy the search_context and change_context elements if they actually exist (pas_backend_file_changes): Hard code a path for now, only notify if there is something to notify about svn path=/trunk/; revision=6524
Diffstat (limited to 'addressbook/backend/ebook')
-rw-r--r--addressbook/backend/ebook/e-book-listener.c39
-rw-r--r--addressbook/backend/ebook/e-book-listener.h1
-rw-r--r--addressbook/backend/ebook/e-book.c55
3 files changed, 95 insertions, 0 deletions
diff --git a/addressbook/backend/ebook/e-book-listener.c b/addressbook/backend/ebook/e-book-listener.c
index 5efdaa37df..fb96329825 100644
--- a/addressbook/backend/ebook/e-book-listener.c
+++ b/addressbook/backend/ebook/e-book-listener.c
@@ -158,6 +158,22 @@ e_book_listener_queue_get_view_response (EBookListener *listener,
}
static void
+e_book_listener_queue_get_changes_response (EBookListener *listener,
+ EBookStatus status,
+ Evolution_BookView book_view)
+{
+ EBookListenerResponse *resp;
+
+ resp = g_new0 (EBookListenerResponse, 1);
+
+ resp->op = GetChangesResponse;
+ resp->status = status;
+ resp->book_view = book_view;
+
+ e_book_listener_queue_response (listener, resp);
+}
+
+static void
e_book_listener_queue_link_status (EBookListener *listener,
gboolean connected)
{
@@ -254,6 +270,28 @@ impl_BookListener_respond_get_view (PortableServer_Servant servant,
}
static void
+impl_BookListener_respond_get_changes (PortableServer_Servant servant,
+ const Evolution_BookListener_CallStatus status,
+ const Evolution_BookView book_view,
+ CORBA_Environment *ev)
+{
+ EBookListener *listener = E_BOOK_LISTENER (bonobo_object_from_servant (servant));
+ Evolution_BookView book_view_copy;
+
+ book_view_copy = CORBA_Object_duplicate (book_view, ev);
+
+ if (ev->_major != CORBA_NO_EXCEPTION) {
+ g_warning ("EBookListener: Exception while duplicating BookView.\n");
+ return;
+ }
+
+ e_book_listener_queue_get_changes_response (
+ listener,
+ e_book_listener_convert_status (status),
+ book_view_copy);
+}
+
+static void
impl_BookListener_respond_open_book (PortableServer_Servant servant,
const Evolution_BookListener_CallStatus status,
const Evolution_Book book,
@@ -525,6 +563,7 @@ e_book_listener_get_epv (void)
epv->respond_get_cursor = impl_BookListener_respond_get_cursor;
epv->respond_get_view = impl_BookListener_respond_get_view;
+ epv->respond_get_changes = impl_BookListener_respond_get_changes;
epv->report_connection_status = impl_BookListener_report_connection_status;
diff --git a/addressbook/backend/ebook/e-book-listener.h b/addressbook/backend/ebook/e-book-listener.h
index eb0432e360..3e4a160d33 100644
--- a/addressbook/backend/ebook/e-book-listener.h
+++ b/addressbook/backend/ebook/e-book-listener.h
@@ -45,6 +45,7 @@ typedef enum {
ModifyCardResponse,
GetCursorResponse,
GetBookViewResponse,
+ GetChangesResponse,
/* Async events */
LinkStatusEvent,
diff --git a/addressbook/backend/ebook/e-book.c b/addressbook/backend/ebook/e-book.c
index 32103fc9df..ce130a5888 100644
--- a/addressbook/backend/ebook/e-book.c
+++ b/addressbook/backend/ebook/e-book.c
@@ -187,6 +187,8 @@ e_book_do_response_get_cursor (EBook *book,
g_free (op);
}
+
+
static void
e_book_do_response_get_view (EBook *book,
EBookListenerResponse *resp)
@@ -238,6 +240,56 @@ e_book_do_response_get_view (EBook *book,
}
static void
+e_book_do_response_get_changes (EBook *book,
+ EBookListenerResponse *resp)
+{
+ CORBA_Environment ev;
+ EBookOp *op;
+ EBookView *book_view;
+
+ op = e_book_pop_op (book);
+
+ if (op == NULL) {
+ g_warning ("e_book_do_response_get_changes: Cannot find operation "
+ "in local op queue!\n");
+ return;
+ }
+
+ book_view = e_book_view_new(resp->book_view, op->listener);
+
+ if (op->cb)
+ ((EBookBookViewCallback) op->cb) (book, resp->status, book_view, op->closure);
+
+ /*
+ * Release the remote Evolution_Book in the PAS.
+ */
+ CORBA_exception_init (&ev);
+
+ Bonobo_Unknown_unref (resp->book_view, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("e_book_do_response_get_changs: Exception unref'ing "
+ "remote Evolution_BookView interface!\n");
+ CORBA_exception_free (&ev);
+ CORBA_exception_init (&ev);
+ }
+
+ CORBA_Object_release (resp->book_view, &ev);
+
+ if (ev._major != CORBA_NO_EXCEPTION) {
+ g_warning ("e_book_do_response_get_changes: Exception releasing "
+ "remote Evolution_BookView interface!\n");
+ }
+
+ CORBA_exception_free (&ev);
+
+ gtk_object_unref(GTK_OBJECT(book_view));
+ bonobo_object_unref(BONOBO_OBJECT(op->listener));
+
+ g_free (op);
+}
+
+static void
e_book_do_response_open (EBook *book,
EBookListenerResponse *resp)
{
@@ -307,6 +359,9 @@ e_book_check_listener_queue (EBookListener *listener, EBook *book)
case GetBookViewResponse:
e_book_do_response_get_view(book, resp);
break;
+ case GetChangesResponse:
+ e_book_do_response_get_changes(book, resp);
+ break;
case OpenBookResponse:
e_book_do_response_open (book, resp);
break;