[evolution-data-server] Remove e_data_cal_is_opened().
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Remove e_data_cal_is_opened().
- Date: Wed, 3 Apr 2013 19:24:30 +0000 (UTC)
commit 80fbdba9285e636bd7473f5368fc3246be8999d1
Author: Matthew Barnes <mbarnes redhat com>
Date: Wed Apr 3 15:24:29 2013 -0400
Remove e_data_cal_is_opened().
With the new public API in place, ECalBackend can own its "opened"
state again.
calendar/libedata-cal/e-cal-backend.c | 23 ++++++---------
calendar/libedata-cal/e-data-cal.c | 30 --------------------
calendar/libedata-cal/e-data-cal.h | 1 -
.../libedata-cal/libedata-cal-sections.txt | 1 -
4 files changed, 9 insertions(+), 46 deletions(-)
---
diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
index fa56745..c08d481 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -33,9 +33,10 @@ typedef struct _SignalClosure SignalClosure;
struct _ECalBackendPrivate {
ESourceRegistry *registry;
-
EDataCal *data_cal;
+ gboolean opened;
+
/* The kind of components for this backend */
icalcomponent_kind kind;
@@ -1012,19 +1013,9 @@ e_cal_backend_set_writable (ECalBackend *backend,
gboolean
e_cal_backend_is_opened (ECalBackend *backend)
{
- EDataCal *data_cal;
- gboolean opened = FALSE;
-
g_return_val_if_fail (E_IS_CAL_BACKEND (backend), FALSE);
- data_cal = e_cal_backend_ref_data_cal (backend);
-
- if (data_cal != NULL) {
- opened = e_data_cal_is_opened (data_cal);
- g_object_unref (data_cal);
- }
-
- return opened;
+ return backend->priv->opened;
}
/**
@@ -1428,8 +1419,12 @@ e_cal_backend_open_finish (ECalBackend *backend,
cal_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;
}
/**
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index ab3fea0..325845d 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -48,8 +48,6 @@ struct _EDataCalPrivate {
GWeakRef backend;
gchar *object_path;
- gboolean opened;
-
GMutex sender_lock;
GHashTable *sender_table;
};
@@ -1503,8 +1501,6 @@ e_data_cal_respond_open (EDataCal *cal,
/* Translators: This is prefix to a detailed error message */
g_prefix_error (&error, "%s", _("Cannot open calendar: "));
- cal->priv->opened = (error == NULL);
-
if (error != NULL)
g_simple_async_result_take_error (simple, error);
@@ -2724,29 +2720,3 @@ e_data_cal_get_object_path (EDataCal *cal)
return cal->priv->object_path;
}
-/**
- * e_data_cal_is_opened:
- * @cal: an #EDataCal
- *
- * Returns whether the @cal's #EDataCal:backend was successfully opened.
- *
- * <note>
- * <para>
- * This is a temporary function serving only to keep
- * e_cal_backend_is_opened() working for a little while longer.
- * Do not call this function directly.
- * </para>
- * </note>
- *
- * Returns: whether the #EDataCal:backend is opened
- *
- * Since: 3.10
- **/
-gboolean
-e_data_cal_is_opened (EDataCal *cal)
-{
- g_return_val_if_fail (E_IS_DATA_CAL (cal), FALSE);
-
- return cal->priv->opened;
-}
-
diff --git a/calendar/libedata-cal/e-data-cal.h b/calendar/libedata-cal/e-data-cal.h
index 2bec855..a0a4d28 100644
--- a/calendar/libedata-cal/e-data-cal.h
+++ b/calendar/libedata-cal/e-data-cal.h
@@ -130,7 +130,6 @@ struct _ECalBackend *
GDBusConnection *
e_data_cal_get_connection (EDataCal *cal);
const gchar * e_data_cal_get_object_path (EDataCal *cal);
-gboolean e_data_cal_is_opened (EDataCal *cal);
void e_data_cal_respond_open (EDataCal *cal,
guint32 opid,
diff --git a/docs/reference/calendar/libedata-cal/libedata-cal-sections.txt
b/docs/reference/calendar/libedata-cal/libedata-cal-sections.txt
index 6c670ef..7c75ed2 100644
--- a/docs/reference/calendar/libedata-cal/libedata-cal-sections.txt
+++ b/docs/reference/calendar/libedata-cal/libedata-cal-sections.txt
@@ -254,7 +254,6 @@ e_data_cal_new
e_data_cal_ref_backend
e_data_cal_get_connection
e_data_cal_get_object_path
-e_data_cal_is_opened
e_data_cal_respond_open
e_data_cal_respond_refresh
e_data_cal_respond_get_object
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]