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



commit 5179aea1fe5c66b354d0563943f84fc82f27903d
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Jan 29 15:50:53 2013 -0500

    Deprecate e_cal_backend_notify_opened().
    
    Use e_data_cal_respond_open() instead.

 calendar/backends/caldav/e-cal-backend-caldav.c    |    8 ++------
 .../backends/contacts/e-cal-backend-contacts.c     |    1 -
 calendar/backends/file/e-cal-backend-file.c        |    2 --
 calendar/backends/http/e-cal-backend-http.c        |   11 +----------
 calendar/backends/weather/e-cal-backend-weather.c  |    3 ---
 calendar/libedata-cal/e-cal-backend.c              |    8 ++------
 calendar/libedata-cal/e-cal-backend.h              |    4 ++--
 calendar/libedata-cal/e-data-cal.c                 |    9 +++++++++
 .../libedata-cal/libedata-cal-sections.txt         |    2 +-
 9 files changed, 17 insertions(+), 31 deletions(-)
---
diff --git a/calendar/backends/caldav/e-cal-backend-caldav.c b/calendar/backends/caldav/e-cal-backend-caldav.c
index efe2dba..2586621 100644
--- a/calendar/backends/caldav/e-cal-backend-caldav.c
+++ b/calendar/backends/caldav/e-cal-backend-caldav.c
@@ -2792,7 +2792,6 @@ caldav_do_open (ECalBackendSync *backend,
                 GError **perror)
 {
 	ECalBackendCalDAV        *cbdav;
-	gboolean opened = TRUE;
 	gboolean online;
 
 	cbdav = E_CAL_BACKEND_CALDAV (backend);
@@ -2822,11 +2821,11 @@ caldav_do_open (ECalBackendSync *backend,
 	if (online) {
 		GError *local_error = NULL;
 
-		opened = open_calendar (cbdav, cancellable, &local_error);
+		open_calendar (cbdav, cancellable, &local_error);
 
 		if (g_error_matches (local_error, E_DATA_CAL_ERROR, AuthenticationRequired) || g_error_matches (local_error, E_DATA_CAL_ERROR, AuthenticationFailed)) {
 			g_clear_error (&local_error);
-			opened = caldav_authenticate (
+			caldav_authenticate (
 				cbdav, FALSE, cancellable, perror);
 		}
 
@@ -2837,9 +2836,6 @@ caldav_do_open (ECalBackendSync *backend,
 		cbdav->priv->read_only = TRUE;
 	}
 
-	if (opened)
-		e_cal_backend_notify_opened (E_CAL_BACKEND (backend), NULL);
-
 	e_cal_backend_notify_readonly (
 		E_CAL_BACKEND (backend), cbdav->priv->read_only);
 	e_cal_backend_notify_online (E_CAL_BACKEND (backend), online);
diff --git a/calendar/backends/contacts/e-cal-backend-contacts.c b/calendar/backends/contacts/e-cal-backend-contacts.c
index edd5cae..f764116 100644
--- a/calendar/backends/contacts/e-cal-backend-contacts.c
+++ b/calendar/backends/contacts/e-cal-backend-contacts.c
@@ -1184,7 +1184,6 @@ e_cal_backend_contacts_open (ECalBackendSync *backend,
 	priv->addressbook_loaded = TRUE;
 	e_cal_backend_notify_readonly (E_CAL_BACKEND (backend), TRUE);
 	e_cal_backend_notify_online (E_CAL_BACKEND (backend), TRUE);
-	e_cal_backend_notify_opened (E_CAL_BACKEND (backend), NULL);
 }
 
 /* Add_timezone handler for the file backend */
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index 1fdf89c..704e861 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -1401,8 +1401,6 @@ e_cal_backend_file_open (ECalBackendSync *backend,
 
 	if (err)
 		g_propagate_error (perror, g_error_copy (err));
-
-	e_cal_backend_notify_opened (E_CAL_BACKEND (backend), err);
 }
 
 static void
diff --git a/calendar/backends/http/e-cal-backend-http.c b/calendar/backends/http/e-cal-backend-http.c
index 62c4ae3..0f7a16e 100644
--- a/calendar/backends/http/e-cal-backend-http.c
+++ b/calendar/backends/http/e-cal-backend-http.c
@@ -876,10 +876,8 @@ e_cal_backend_http_open (ECalBackendSync *backend,
 	priv = cbhttp->priv;
 
 	/* already opened, thus can skip all this initialization */
-	if (priv->opened) {
-		e_cal_backend_notify_opened (E_CAL_BACKEND (backend), NULL);
+	if (priv->opened)
 		return;
-	}
 
 	source = e_backend_get_source (E_BACKEND (backend));
 	cache_dir = e_cal_backend_get_cache_dir (E_CAL_BACKEND (backend));
@@ -918,11 +916,6 @@ e_cal_backend_http_open (ECalBackendSync *backend,
 			g_propagate_error (
 				perror, EDC_ERROR_EX (OtherError,
 				_("Could not create cache file")));
-			e_cal_backend_notify_opened (
-				E_CAL_BACKEND (backend),
-				EDC_ERROR_EX (
-				OtherError,
-				_("Could not create cache file")));
 			return;
 		}
 	}
@@ -962,8 +955,6 @@ e_cal_backend_http_open (ECalBackendSync *backend,
 		if (!priv->reload_timeout_id)
 			priv->reload_timeout_id = e_source_refresh_add_timeout (source, NULL, http_cal_reload_cb, backend, NULL);
 	}
-
-	e_cal_backend_notify_opened (E_CAL_BACKEND (backend), local_error);
 }
 
 static void
diff --git a/calendar/backends/weather/e-cal-backend-weather.c b/calendar/backends/weather/e-cal-backend-weather.c
index c9e2da8..4da2807 100644
--- a/calendar/backends/weather/e-cal-backend-weather.c
+++ b/calendar/backends/weather/e-cal-backend-weather.c
@@ -509,7 +509,6 @@ e_cal_backend_weather_open (ECalBackendSync *backend,
 
 		/* do we require to load this new store */
 		e_cal_backend_store_load (priv->store);
-		e_cal_backend_notify_opened (E_CAL_BACKEND (backend), NULL);
 
 		if (!e_backend_get_online (E_BACKEND (backend)))
 			return;
@@ -517,8 +516,6 @@ e_cal_backend_weather_open (ECalBackendSync *backend,
 		if (!priv->begin_retrival_id)
 			priv->begin_retrival_id = g_idle_add ((GSourceFunc) begin_retrieval_cb, cbw);
 	}
-
-	e_cal_backend_notify_opened (E_CAL_BACKEND (backend), NULL);
 }
 
 static void
diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
index 1db9e33..6718458 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -1916,6 +1916,8 @@ e_cal_backend_notify_online (ECalBackend *backend,
  * Meant to be used by backend implementations.
  *
  * Since: 3.2
+ *
+ * Deprecated: 3.8: Use e_data_cal_respond_open() instead.
  **/
 void
 e_cal_backend_notify_opened (ECalBackend *backend,
@@ -1992,17 +1994,11 @@ e_cal_backend_respond_opened (ECalBackend *backend,
                               guint32 opid,
                               GError *error)
 {
-	GError *copy = NULL;
-
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_CAL_BACKEND (backend));
 	g_return_if_fail (cal != NULL);
 	g_return_if_fail (opid != 0);
 
-	if (error)
-		copy = g_error_copy (error);
-
-	e_cal_backend_notify_opened (backend, copy);
 	e_data_cal_respond_open (cal, opid, error);
 }
 
diff --git a/calendar/libedata-cal/e-cal-backend.h b/calendar/libedata-cal/e-cal-backend.h
index 918b4b9..a315f29 100644
--- a/calendar/libedata-cal/e-cal-backend.h
+++ b/calendar/libedata-cal/e-cal-backend.h
@@ -386,8 +386,6 @@ void		e_cal_backend_notify_readonly	(ECalBackend *backend,
 						 gboolean is_readonly);
 void		e_cal_backend_notify_online	(ECalBackend *backend,
 						 gboolean is_online);
-void		e_cal_backend_notify_opened	(ECalBackend *backend,
-						 GError *error);
 void		e_cal_backend_notify_property_changed
 						(ECalBackend *backend,
 						 const gchar *prop_name,
@@ -442,6 +440,8 @@ void		e_cal_backend_foreach_view	(ECalBackend *backend,
 						 gboolean (*callback) (EDataCalView *view,
 								       gpointer user_data),
 								       gpointer user_data);
+void		e_cal_backend_notify_opened	(ECalBackend *backend,
+						 GError *error);
 #endif /* EDS_DISABLE_DEPRECATED */
 
 G_END_DECLS
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index f1a8f41..49a7028 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -1016,6 +1016,8 @@ e_data_cal_respond_open (EDataCal *cal,
                          guint32 opid,
                          GError *error)
 {
+	GError *copy = NULL;
+
 	g_return_if_fail (E_IS_DATA_CAL (cal));
 
 	op_complete (cal, opid);
@@ -1023,6 +1025,13 @@ e_data_cal_respond_open (EDataCal *cal,
 	/* Translators: This is prefix to a detailed error message */
 	g_prefix_error (&error, "%s", _("Cannot open calendar: "));
 
+	/* This function is deprecated, but it's the only way to
+	 * set ECalBackend's internal 'opened' flag.  We should
+	 * be the only ones calling this. */
+	if (error != NULL)
+		copy = g_error_copy (error);
+	e_cal_backend_notify_opened (cal->priv->backend, copy);
+
 	e_gdbus_cal_emit_open_done (cal->priv->dbus_interface, opid, error);
 
 	if (error != NULL)
diff --git a/docs/reference/calendar/libedata-cal/libedata-cal-sections.txt b/docs/reference/calendar/libedata-cal/libedata-cal-sections.txt
index 3e4c909..e514fc8 100644
--- a/docs/reference/calendar/libedata-cal/libedata-cal-sections.txt
+++ b/docs/reference/calendar/libedata-cal/libedata-cal-sections.txt
@@ -49,7 +49,6 @@ e_cal_backend_notify_component_removed
 e_cal_backend_notify_error
 e_cal_backend_notify_readonly
 e_cal_backend_notify_online
-e_cal_backend_notify_opened
 e_cal_backend_notify_property_changed
 e_cal_backend_empty_cache
 e_cal_backend_set_is_removed
@@ -60,6 +59,7 @@ CLIENT_BACKEND_PROPERTY_OPENING
 e_cal_backend_is_opening
 e_cal_backend_set_backend_property
 e_cal_backend_foreach_view
+e_cal_backend_notify_opened
 <SUBSECTION Standard>
 E_CAL_BACKEND
 E_IS_CAL_BACKEND



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