[evolution-data-server] Remove e_data_book_is_opened().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Remove e_data_book_is_opened().
- Date: Wed, 3 Apr 2013 19:24:25 +0000 (UTC)
commit 9476276b5331b91079117603476536306a58cc10
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Apr 3 15:15:24 2013 -0400
Remove e_data_book_is_opened().
With the new public API in place, EBookBackend can own its "opened"
state again.
addressbook/libedata-book/e-book-backend.c | 22 ++++++--------
addressbook/libedata-book/e-data-book.c | 30 --------------------
addressbook/libedata-book/e-data-book.h | 1 -
.../libedata-book/libedata-book-sections.txt | 1 -
4 files changed, 9 insertions(+), 45 deletions(-)
---
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 8253c2e..28dcb6c 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -35,6 +35,8 @@ struct _EBookBackendPrivate {
ESourceRegistry *registry;
EDataBook *data_book;
+ gboolean opened;
+
GMutex views_mutex;
GList *views;
@@ -930,8 +932,12 @@ e_book_backend_open_finish (EBookBackend *backend,
book_backend_unblock_operations (backend, simple);
- /* Assume success unless a GError is set. */
- return !g_simple_async_result_propagate_error (simple, error);
+ if (g_simple_async_result_propagate_error (simple, error))
+ return FALSE;
+
+ backend->priv->opened = TRUE;
+
+ return TRUE;
}
/**
@@ -2438,19 +2444,9 @@ e_book_backend_get_backend_property (EBookBackend *backend,
gboolean
e_book_backend_is_opened (EBookBackend *backend)
{
- EDataBook *data_book;
- gboolean opened = FALSE;
-
g_return_val_if_fail (E_IS_BOOK_BACKEND (backend), FALSE);
- data_book = e_book_backend_ref_data_book (backend);
-
- if (data_book != NULL) {
- opened = e_data_book_is_opened (data_book);
- g_object_unref (data_book);
- }
-
- return opened;
+ return backend->priv->opened;
}
/**
diff --git a/addressbook/libedata-book/e-data-book.c b/addressbook/libedata-book/e-data-book.c
index 565cdb3..c427a23 100644
--- a/addressbook/libedata-book/e-data-book.c
+++ b/addressbook/libedata-book/e-data-book.c
@@ -48,8 +48,6 @@ struct _EDataBookPrivate {
GWeakRef backend;
gchar *object_path;
- gboolean opened;
-
GMutex sender_lock;
GHashTable *sender_table;
};
@@ -1070,8 +1068,6 @@ e_data_book_respond_open (EDataBook *book,
/* Translators: This is prefix to a detailed error message */
g_prefix_error (&error, "%s", _("Cannot open book: "));
- book->priv->opened = (error == NULL);
-
if (error != NULL)
g_simple_async_result_take_error (simple, error);
@@ -1915,29 +1911,3 @@ e_data_book_get_object_path (EDataBook *book)
return book->priv->object_path;
}
-/**
- * e_data_book_is_opened:
- * @book: an #EDataBook
- *
- * Returns whether the @book's #EDataBook:backend was successfully opened.
- *
- * <note>
- * <para>
- * This is a temporary function serving only to keep
- * e_book_backend_is_opened() working for a little while longer.
- * Do not call this function directly.
- * </para>
- * </note>
- *
- * Returns: whether the #EDataBook:backend is opened
- *
- * Since: 3.10
- **/
-gboolean
-e_data_book_is_opened (EDataBook *book)
-{
- g_return_val_if_fail (E_IS_DATA_BOOK (book), FALSE);
-
- return book->priv->opened;
-}
-
diff --git a/addressbook/libedata-book/e-data-book.h b/addressbook/libedata-book/e-data-book.h
index 8c56ea3..d3bc9a2 100644
--- a/addressbook/libedata-book/e-data-book.h
+++ b/addressbook/libedata-book/e-data-book.h
@@ -105,7 +105,6 @@ struct _EBookBackend *
GDBusConnection *
e_data_book_get_connection (EDataBook *book);
const gchar * e_data_book_get_object_path (EDataBook *book);
-gboolean e_data_book_is_opened (EDataBook *book);
void e_data_book_respond_open (EDataBook *book,
guint32 opid,
diff --git a/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
b/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
index 606deb3..1025dc3 100644
--- a/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
+++ b/docs/reference/addressbook/libedata-book/libedata-book-sections.txt
@@ -275,7 +275,6 @@ e_data_book_new
e_data_book_ref_backend
e_data_book_get_connection
e_data_book_get_object_path
-e_data_book_is_opened
e_data_book_respond_open
e_data_book_respond_refresh
e_data_book_respond_create_contacts
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]