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



commit 35443630ef7e54abcbdde0295629733baee9fda4
Author: Matthew Barnes <mbarnes redhat com>
Date:   Tue Jan 29 15:39:30 2013 -0500

    Deprecate e_book_backend_notify_opened().
    
    Use e_data_book_respond_open() instead.

 addressbook/backends/file/e-book-backend-file.c    |    1 -
 .../backends/google/e-book-backend-google.c        |    2 --
 addressbook/libedata-book/e-book-backend.c         |    8 ++------
 addressbook/libedata-book/e-book-backend.h         |    4 ++--
 addressbook/libedata-book/e-data-book.c            |    9 +++++++++
 .../libedata-book/libedata-book-sections.txt       |    2 +-
 6 files changed, 14 insertions(+), 12 deletions(-)
---
diff --git a/addressbook/backends/file/e-book-backend-file.c b/addressbook/backends/file/e-book-backend-file.c
index f1d56a6..a67d5a0 100644
--- a/addressbook/backends/file/e-book-backend-file.c
+++ b/addressbook/backends/file/e-book-backend-file.c
@@ -1505,7 +1505,6 @@ e_book_backend_file_open (EBookBackendSync *backend,
 
 	e_book_backend_notify_online (E_BOOK_BACKEND (backend), TRUE);
 	e_book_backend_notify_readonly (E_BOOK_BACKEND (backend), FALSE);
-	e_book_backend_notify_opened (E_BOOK_BACKEND (backend), NULL /* Success */);
 }
 
 static gboolean
diff --git a/addressbook/backends/google/e-book-backend-google.c b/addressbook/backends/google/e-book-backend-google.c
index 7de0702..79c683c 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -1933,8 +1933,6 @@ e_book_backend_google_open (EBookBackend *backend,
 			e_book_backend_notify_readonly (backend, FALSE);
 			cache_refresh_if_needed (backend);
 		}
-
-		e_book_backend_notify_opened (backend, NULL /* Success */);
 	}
 
 	/* This function frees the GError passed to it. */
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 2f5f04c..cc85f2f 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -1315,6 +1315,8 @@ e_book_backend_notify_online (EBookBackend *backend,
  * Meant to be used by backend implementations.
  *
  * Since: 3.2
+ *
+ * Deprecated: 3.8: Use e_data_book_respond_open() instead.
  **/
 void
 e_book_backend_notify_opened (EBookBackend *backend,
@@ -1391,16 +1393,10 @@ e_book_backend_respond_opened (EBookBackend *backend,
                                guint32 opid,
                                GError *error)
 {
-	GError *copy = NULL;
-
 	g_return_if_fail (backend != NULL);
 	g_return_if_fail (E_IS_BOOK_BACKEND (backend));
 	g_return_if_fail (book != NULL);
 	g_return_if_fail (opid != 0);
 
-	if (error)
-		copy = g_error_copy (error);
-
-	e_book_backend_notify_opened (backend, copy);
 	e_data_book_respond_open (book, opid, error);
 }
diff --git a/addressbook/libedata-book/e-book-backend.h b/addressbook/libedata-book/e-book-backend.h
index 9334da5..6d3f095 100644
--- a/addressbook/libedata-book/e-book-backend.h
+++ b/addressbook/libedata-book/e-book-backend.h
@@ -289,8 +289,6 @@ void		e_book_backend_notify_readonly	(EBookBackend *backend,
 						 gboolean is_readonly);
 void		e_book_backend_notify_online	(EBookBackend *backend,
 						 gboolean is_online);
-void		e_book_backend_notify_opened	(EBookBackend *backend,
-						 GError *error);
 void		e_book_backend_notify_property_changed
 						(EBookBackend *backend,
 						 const gchar *prop_name,
@@ -353,6 +351,8 @@ void		e_book_backend_foreach_view	(EBookBackend *backend,
 						 gboolean (*callback) (EDataBookView *view,
 								       gpointer user_data),
 								       gpointer user_data);
+void		e_book_backend_notify_opened	(EBookBackend *backend,
+						 GError *error);
 #endif /* EDS_DISABLE_DEPRECATED */
 
 G_END_DECLS
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 826cf9e..f242967 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -866,6 +866,8 @@ e_data_book_respond_open (EDataBook *book,
                           guint opid,
                           GError *error)
 {
+	GError *copy = NULL;
+
 	g_return_if_fail (E_IS_DATA_BOOK (book));
 
 	op_complete (book, opid);
@@ -873,6 +875,13 @@ e_data_book_respond_open (EDataBook *book,
 	/* Translators: This is prefix to a detailed error message */
 	g_prefix_error (&error, "%s", _("Cannot open book: "));
 
+	/* This function is deprecated, but it's the only way to
+	 * set EBookBackend's internal 'opened' flag.  We should
+	 * be the only ones calling this. */
+	if (error != NULL)
+		copy = g_error_copy (error);
+	e_book_backend_notify_opened (book->priv->backend, copy);
+
 	e_gdbus_book_emit_open_done (book->priv->dbus_interface, opid, error);
 
 	if (error != NULL)
diff --git a/docs/reference/addressbook/libedata-book/libedata-book-sections.txt b/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
index ce9c1bc..e6c9fc0 100644
--- a/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
+++ b/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
@@ -39,7 +39,6 @@ e_book_backend_notify_complete
 e_book_backend_notify_error
 e_book_backend_notify_readonly
 e_book_backend_notify_online
-e_book_backend_notify_opened
 e_book_backend_notify_property_changed
 e_book_backend_sync
 e_book_backend_set_is_removed
@@ -51,6 +50,7 @@ BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS
 e_book_backend_is_opening
 e_book_backend_set_backend_property
 e_book_backend_foreach_view
+e_book_backend_notify_opened
 <SUBSECTION Standard>
 E_BOOK_BACKEND
 E_IS_BOOK_BACKEND



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