Re: [evolution-patches] EDS Exit Patch 68533



On Tue, 2005-03-15 at 00:55 -0500, JP Rosevear wrote:
> Gross hack, but it will do because we'll assume for now that
> internal refs can only work calendar->addressbook and any more complete
> fix changes quite a bit of the lifecycle stuff and seems risky.  Should
> fix 68533.
> 
> I'd like e-d-s book/cal types to run with this today if possible to look
> for any issues.

Small init fix.

-JP
-- 
JP Rosevear <jpr novell com>
Novell, Inc.
? .cdtproject
? .project
? depcomp
? dest.patch
? e-d-s-ref.patch
? eds-exit.patch
? gtk-doc.make
? iconv-detect.h
? addressbook/book-ref.patch
? addressbook/e-dest.patch
? calendar/cal-ref.patch
? calendar/config.guess
? calendar/config.sub
? calendar/depcomp
? calendar/install-sh
? calendar/locking.patch
? calendar/ltmain.sh
? calendar/missing
? calendar/mkinstalldirs
? calendar/new-cal-ref.patch
? calendar/ylwrap
? calendar/libecal/e-cal-comp-util.c
? calendar/libecal/e-cal-comp-util.h
? calendar/libecal/e-cal-comp-util.loT
? calendar/libecal/e-cal-comp.c
? calendar/libecal/e-cal-comp.h
? calendar/libecal/temp.patch
? calendar/tests/icalendar
? calendar/tests/ecal/test-recur
? calendar/tests/ecal/test-torture.sh
? camel/camel-mime-tables.c
? camel/providers/groupwise/groupwise-journal.patch
? libedataserver/e-vobject.c
? libedataserver/e-vobject.h
? libedataserver/e-vobject.loT
? libedataserverui/e-name-selector-dialog.gladep
? libedataserverui/e-source-option-menu.c2
? libedataserverui/e-source-option-menu.h2
? libedataserverui/e-source-selector.c2
? libedataserverui/e-source-selector.h2
? libedataserverui/test-contact-store
? libedataserverui/test-name-selector
? libedataserverui/test-source-option-menu.c2
? libedataserverui/test-source-selector.c2
? src/GNOME_Evolution_DataServer_1.2.server
Index: addressbook/libedata-book/e-book-backend.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libedata-book/e-book-backend.c,v
retrieving revision 1.11
diff -u -r1.11 e-book-backend.c
--- addressbook/libedata-book/e-book-backend.c	26 Feb 2005 03:46:13 -0000	1.11
+++ addressbook/libedata-book/e-book-backend.c	15 Mar 2005 15:49:17 -0000
@@ -412,10 +412,38 @@
 	 */
 	if (!backend->priv->clients)
 		last_client_gone (backend);
-
+	
 	g_mutex_unlock (backend->priv->clients_mutex);
 
 	g_object_unref (backend);
+}
+
+gboolean
+e_book_backend_has_out_of_proc_clients (EBookBackend *backend)
+{
+	GList *l;
+
+	g_mutex_lock (backend->priv->clients_mutex);
+
+	if (!backend->priv->clients) {
+		g_mutex_unlock (backend->priv->clients_mutex);
+		
+		return FALSE;
+	}
+	
+	for (l = backend->priv->clients; l; l = l->next) {
+		if (ORBit_small_get_connection_status (e_data_book_get_listener (l->data)) != ORBIT_CONNECTION_IN_PROC) {
+			g_mutex_unlock (backend->priv->clients_mutex);
+			
+			return TRUE;
+		}
+	}
+	
+	g_mutex_unlock (backend->priv->clients_mutex);
+
+	/* If we get here, all remaining clients are in proc */
+
+	return FALSE;
 }
 
 char *
Index: addressbook/libedata-book/e-book-backend.h
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libedata-book/e-book-backend.h,v
retrieving revision 1.10
diff -u -r1.10 e-book-backend.h
--- addressbook/libedata-book/e-book-backend.h	23 Dec 2004 17:33:49 -0000	1.10
+++ addressbook/libedata-book/e-book-backend.h	15 Mar 2005 15:49:17 -0000
@@ -91,6 +91,7 @@
 						     EDataBook                *book);
 void        e_book_backend_remove_client            (EBookBackend             *backend,
 						     EDataBook                *book);
+gboolean    e_book_backend_has_out_of_proc_clients (EBookBackend *backend);
 char       *e_book_backend_get_static_capabilities  (EBookBackend             *backend);
 
 gboolean    e_book_backend_is_loaded                (EBookBackend             *backend);
Index: addressbook/libedata-book/e-data-book-factory.c
===================================================================
RCS file: /cvs/gnome/evolution-data-server/addressbook/libedata-book/e-data-book-factory.c,v
retrieving revision 1.7
diff -u -r1.7 e-data-book-factory.c
--- addressbook/libedata-book/e-data-book-factory.c	23 Dec 2004 17:33:49 -0000	1.7
+++ addressbook/libedata-book/e-data-book-factory.c	15 Mar 2005 15:49:17 -0000
@@ -107,6 +107,17 @@
 			     g_strdup (proto), backend_factory);
 }
 
+static void
+out_of_proc_check (gpointer key, gpointer value, gpointer data)
+{
+	gboolean *out_of_proc = data;
+
+	if ((*out_of_proc))
+	    return;
+
+	*out_of_proc = e_book_backend_has_out_of_proc_clients (value);
+}
+
 /**
  * e_data_book_factory_get_n_backends:
  * @factory: An addressbook factory.
@@ -119,12 +130,18 @@
 e_data_book_factory_get_n_backends (EDataBookFactory *factory)
 {
 	int n_backends;
-
+	gboolean out_of_proc = FALSE;
+	
 	g_return_val_if_fail (factory != NULL, -1);
 	g_return_val_if_fail (E_IS_DATA_BOOK_FACTORY (factory), -1);
 
 	g_mutex_lock (factory->priv->map_mutex);
-	n_backends = g_hash_table_size (factory->priv->active_server_map);
+	g_hash_table_foreach (factory->priv->active_server_map, out_of_proc_check, &out_of_proc);
+
+	if (!out_of_proc)
+		n_backends = 0;
+	else
+		n_backends = g_hash_table_size (factory->priv->active_server_map);
 	g_mutex_unlock (factory->priv->map_mutex);
 
 	return n_backends;


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