Re: [evolution-patches] Exchange: patch for bug #274262



Hi,

I have attached a new patch which takes care of all other operations
like create a new contact, delete an existing contact etc along with the
search/clear operation.

Please review the patch.

Thanks,
Shakti


Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution-exchange/ChangeLog,v
retrieving revision 1.379
diff -u -p -r1.379 ChangeLog
--- ChangeLog	18 Aug 2005 04:31:54 -0000	1.379
+++ ChangeLog	18 Aug 2005 05:40:16 -0000
@@ -1,3 +1,15 @@
+2005-08-18  Shakti Sen <shprasad novell com>
+
+	* addressbook/e-book-backend-exchange.c
+	(e_book_backend_exchange_set_mode): Takes care of searching
+	even the user starts evolution in offline mode and switch back to
+	online mode. Also it fixes all the operations like create a contact,
+	delete a contact etc while the user switches back from offline to
+	online mode.
+
+	Fixes bug #274262 and lot of issues which are not reported in the bug
+	report.
+
 2005-08-17  Not Zed  <NotZed Ximian com>
 
 	** See bug #312668.
Index: addressbook/e-book-backend-exchange.c
===================================================================
RCS file: /cvs/gnome/evolution-exchange/addressbook/e-book-backend-exchange.c,v
retrieving revision 1.37
diff -u -p -r1.37 e-book-backend-exchange.c
--- addressbook/e-book-backend-exchange.c	17 Aug 2005 10:43:59 -0000	1.37
+++ addressbook/e-book-backend-exchange.c	18 Aug 2005 05:40:18 -0000
@@ -1878,7 +1878,7 @@ e_book_backend_exchange_start_book_view 
 					GNOME_Evolution_Addressbook_Success);
 		if (temp_list)
 			 g_list_free (temp_list);
-		bonobo_object_unref (book_view);
+		g_object_unref (book_view);
 		return;
 		
 	case GNOME_Evolution_Addressbook_MODE_REMOTE:
@@ -2303,6 +2303,7 @@ e_book_backend_exchange_set_mode (EBookB
 {
 	EBookBackendExchange *be = E_BOOK_BACKEND_EXCHANGE (backend);
 	EBookBackendExchangePrivate *bepriv = be->priv;
+	E2kHTTPStatus status;
 
 	bepriv->mode = mode;
 	if (e_book_backend_is_loaded (backend)) {
@@ -2317,6 +2318,26 @@ e_book_backend_exchange_set_mode (EBookB
 			e_book_backend_notify_connection_status (backend, TRUE);
 			/* FIXME :
 			e_book_backend_notify_auth_required (backend); */
+		}
+	}
+
+	if (!e_book_backend_is_loaded (backend)
+	    && mode == GNOME_Evolution_Addressbook_MODE_REMOTE) {
+		if (!bepriv->exchange_uri)
+			return;
+
+		status = e_book_backend_exchange_connect (be);
+		if (status != GNOME_Evolution_Addressbook_Success)
+			return;
+
+		if (e_book_backend_cache_is_populated (bepriv->cache)) {
+			if (bepriv->is_writable)
+				g_thread_create ((GThreadFunc) update_cache, 
+						  be, FALSE, NULL);
+		}
+		else if (bepriv->is_writable || bepriv->marked_for_offline){ 
+			/* for personal books we always cache*/
+			g_thread_create ((GThreadFunc) build_cache, be, FALSE, NULL);
 		}
 	}
 }


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]