[evolution-data-server] Deprecate e_client_is_opened().



commit 0e2626eb66bb76072f657b5cbb5ac06ad11e4eac
Author: Matthew Barnes <mbarnes redhat com>
Date:   Fri Jan 25 15:04:32 2013 -0500

    Deprecate e_client_is_opened().
    
    This always returns TRUE now.

 .../backends/contacts/e-cal-backend-contacts.c     |   35 --------------------
 calendar/libecal/e-cal-client.c                    |    4 --
 .../libedataserver/libedataserver-sections.txt     |    2 +-
 libedataserver/e-client.c                          |   10 +++---
 libedataserver/e-client.h                          |    2 +-
 tests/libebook/client/test-client-examine.c        |    1 -
 tests/libecal/client/test-client-examine.c         |    1 -
 7 files changed, 7 insertions(+), 48 deletions(-)
---
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index bcef26e..edd5cae 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -237,38 +237,9 @@ cal_backend_contacts_remove_book_record (ECalBackendContacts *cbc,
 	return removed;
 }
 
-static gpointer
-cbc_reopen_book_client_thread (gpointer user_data)
-{
-	EBookClient *book_client = user_data;
-	gboolean done = FALSE;
-
-	g_object_ref (book_client);
-
-	while (!done) {
-		done = TRUE;
-
-		if (!e_client_is_opened (E_CLIENT (book_client))) {
-			GError *error = NULL;
-
-			if (!e_client_open_sync (E_CLIENT (book_client), TRUE, NULL, &error) || error) {
-				g_warning ("%s: Failed to open book: %s", G_STRFUNC, error ? error->message : "Unknown error");
-			}
-
-			g_clear_error (&error);
-		}
-	}
-
-	g_object_unref (book_client);
-
-	return NULL;
-}
-
 static void
 cbc_reopen_book_client (BookRecord *br)
 {
-	GThread *thread;
-
 	g_mutex_lock (&br->lock);
 
 	g_warn_if_fail (br->book_client_opened_id == 0);
@@ -276,12 +247,6 @@ cbc_reopen_book_client (BookRecord *br)
 		br->book_client, "opened",
 		G_CALLBACK (book_client_opened_cb), br);
 
-	thread = g_thread_new (
-		NULL,
-		cbc_reopen_book_client_thread,
-		br->book_client);
-	g_thread_unref (thread);
-
 	g_mutex_unlock (&br->lock);
 }
 
diff --git a/calendar/libecal/e-cal-client.c b/calendar/libecal/e-cal-client.c
index 3f74629..7346b5f 100644
--- a/calendar/libecal/e-cal-client.c
+++ b/calendar/libecal/e-cal-client.c
@@ -2147,7 +2147,6 @@ e_cal_client_generate_instances (ECalClient *client,
 	GCancellable *use_cancellable;
 
 	g_return_if_fail (E_IS_CAL_CLIENT (client));
-	g_return_if_fail (e_client_is_opened (E_CLIENT (client)));
 
 	g_return_if_fail (start >= 0);
 	g_return_if_fail (end >= 0);
@@ -2199,7 +2198,6 @@ e_cal_client_generate_instances_sync (ECalClient *client,
 	GSList *objects = NULL;
 
 	g_return_if_fail (E_IS_CAL_CLIENT (client));
-	g_return_if_fail (e_client_is_opened (E_CLIENT (client)));
 
 	g_return_if_fail (start >= 0);
 	g_return_if_fail (end >= 0);
@@ -2326,7 +2324,6 @@ e_cal_client_generate_instances_for_object (ECalClient *client,
 	GCancellable *use_cancellable;
 
 	g_return_if_fail (E_IS_CAL_CLIENT (client));
-	g_return_if_fail (e_client_is_opened (E_CLIENT (client)));
 
 	g_return_if_fail (start >= 0);
 	g_return_if_fail (end >= 0);
@@ -2428,7 +2425,6 @@ e_cal_client_generate_instances_for_object_sync (ECalClient *client,
 	gboolean is_single_instance = FALSE;
 
 	g_return_if_fail (E_IS_CAL_CLIENT (client));
-	g_return_if_fail (e_client_is_opened (E_CLIENT (client)));
 
 	g_return_if_fail (start >= 0);
 	g_return_if_fail (end >= 0);
diff --git a/docs/reference/libedataserver/libedataserver-sections.txt b/docs/reference/libedataserver/libedataserver-sections.txt
index 77b3dff..42bb091 100644
--- a/docs/reference/libedataserver/libedataserver-sections.txt
+++ b/docs/reference/libedataserver/libedataserver-sections.txt
@@ -54,7 +54,6 @@ e_client_check_capability
 e_client_check_refresh_supported
 e_client_is_readonly
 e_client_is_online
-e_client_is_opened
 e_client_unwrap_dbus_error
 e_client_cancel_all
 e_client_get_backend_property
@@ -78,6 +77,7 @@ e_client_util_unwrap_dbus_error
 <SUBSECTION Deprecated>
 CLIENT_BACKEND_PROPERTY_OPENED
 CLIENT_BACKEND_PROPERTY_OPENING
+e_client_is_opened
 e_client_remove
 e_client_remove_finish
 e_client_remove_sync
diff --git a/libedataserver/e-client.c b/libedataserver/e-client.c
index 9f3a891..42b06ef 100644
--- a/libedataserver/e-client.c
+++ b/libedataserver/e-client.c
@@ -44,7 +44,6 @@ struct _EClientPrivate {
 	gchar *uri;
 	gboolean online;
 	gboolean readonly;
-	gboolean opened;
 	gboolean capabilities_retrieved;
 	GSList *capabilities;
 
@@ -714,16 +713,19 @@ e_client_set_online (EClient *client,
  * during the opening phase except of authenticate or cancel it.
  * Every other operation results in an %E_CLIENT_ERROR_BUSY error.
  *
- * Returns: %TRUE if this @client is fully opened, otherwise %FALSE.
+ * Returns: always %TRUE
  *
  * Since: 3.2.
+ *
+ * Deprecated: 3.8: Clients don't need to care if they're fully opened
+ *                  anymore.  This function always returns %TRUE.
  **/
 gboolean
 e_client_is_opened (EClient *client)
 {
 	g_return_val_if_fail (E_IS_CLIENT (client), FALSE);
 
-	return client->priv->opened;
+	return TRUE;
 }
 
 /*
@@ -849,8 +851,6 @@ e_client_emit_opened (EClient *client,
 
 	g_return_if_fail (E_IS_CLIENT (client));
 
-	client->priv->opened = dbus_error == NULL;
-
 	if (dbus_error) {
 		local_error = g_error_copy (dbus_error);
 		e_client_unwrap_dbus_error (client, local_error, &local_error);
diff --git a/libedataserver/e-client.h b/libedataserver/e-client.h
index 19f2bf0..59c5427 100644
--- a/libedataserver/e-client.h
+++ b/libedataserver/e-client.h
@@ -287,7 +287,6 @@ gboolean	e_client_check_refresh_supported
 						(EClient *client);
 gboolean	e_client_is_readonly		(EClient *client);
 gboolean	e_client_is_online		(EClient *client);
-gboolean	e_client_is_opened		(EClient *client);
 void		e_client_unwrap_dbus_error	(EClient *client,
 						 GError *dbus_error,
 						 GError **out_error);
@@ -416,6 +415,7 @@ gboolean	e_client_util_unwrap_dbus_error	(GError *dbus_error,
  **/
 #define CLIENT_BACKEND_PROPERTY_OPENING			"opening"
 
+gboolean	e_client_is_opened		(EClient *client);
 void		e_client_remove			(EClient *client,
 						 GCancellable *cancellable,
 						 GAsyncReadyCallback callback,
diff --git a/tests/libebook/client/test-client-examine.c b/tests/libebook/client/test-client-examine.c
index 0dc7d48..443ce46 100644
--- a/tests/libebook/client/test-client-examine.c
+++ b/tests/libebook/client/test-client-examine.c
@@ -87,7 +87,6 @@ print_values (const ExtraValues *evals,
 
 	g_print ("\treadonly:%s\n", e_client_is_readonly (client) ? "yes" : "no");
 	g_print ("\tonline:%s\n", e_client_is_online (client) ? "yes" : "no");
-	g_print ("\topened:%s\n", e_client_is_opened (client) ? "yes" : "no");
 	g_print ("\tcapabilities: ");
 	values = e_client_get_capabilities (client);
 	if (!values) {
diff --git a/tests/libecal/client/test-client-examine.c b/tests/libecal/client/test-client-examine.c
index 92b8ba6..0c9e254 100644
--- a/tests/libecal/client/test-client-examine.c
+++ b/tests/libecal/client/test-client-examine.c
@@ -111,7 +111,6 @@ print_values (const ExtraValues *evals,
 
 	g_print ("\treadonly:%s\n", e_client_is_readonly (client) ? "yes" : "no");
 	g_print ("\tonline:%s\n", e_client_is_online (client) ? "yes" : "no");
-	g_print ("\topened:%s\n", e_client_is_opened (client) ? "yes" : "no");
 	g_print ("\tcache dir: %s%s%s\n", evals->cache_dir ? "'" : "", evals->cache_dir ? evals->cache_dir : "none", evals->cache_dir ? "'" : "");
 	g_print ("\tcapabilities: ");
 	values = e_client_get_capabilities (client);



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