[evolution-data-server/openismus-work-master: 5/11] Added e_cal_get_revision().
- From: Tristan Van Berkom <tvb src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server/openismus-work-master: 5/11] Added e_cal_get_revision().
- Date: Sat, 6 Aug 2011 23:27:44 +0000 (UTC)
commit 09ff3b6b5d71870ef1beaed1f67c8e4edc562ef4
Author: Tristan Van Berkom <tristan van berkom gmail com>
Date: Thu Aug 4 21:30:35 2011 -0400
Added e_cal_get_revision().
Adds e_cal_get_revision() async/sync api to access an
opaque revision string which will be NULL for a backend that
does not implement it. Adds all the needed gdbus machinery and
implements a revision in the file backend.
This is implemented by checking the calendar file timestamp and
maintaining a modification counter to ensure there are no races
then multiple revisions happen in the same second. When the backend
is asked for it's revision and it's currently dirty... the calendar
file is forcefully saved to ensure a correct revision string.
Bug: https://bugzilla.gnome.org/show_bug.cgi?id=652177
calendar/backends/file/e-cal-backend-file.c | 54 ++++++++++++++++++
calendar/libecal/e-cal-client.c | 78 +++++++++++++++++++++++++++
calendar/libecal/e-cal-client.h | 4 ++
calendar/libedata-cal/e-cal-backend.c | 25 +++++++++
calendar/libedata-cal/e-cal-backend.h | 3 +
calendar/libedata-cal/e-data-cal.c | 37 +++++++++++++
calendar/libedata-cal/e-data-cal.h | 1 +
calendar/libegdbus/e-gdbus-cal.c | 29 ++++++++++
calendar/libegdbus/e-gdbus-cal.h | 8 +++
9 files changed, 239 insertions(+), 0 deletions(-)
---
diff --git a/calendar/backends/file/e-cal-backend-file.c b/calendar/backends/file/e-cal-backend-file.c
index fb24a10..621f443 100644
--- a/calendar/backends/file/e-cal-backend-file.c
+++ b/calendar/backends/file/e-cal-backend-file.c
@@ -112,6 +112,9 @@ struct _ECalBackendFilePrivate {
/* timeour id for refresh type "2" */
guint refresh_timeout_id;
+
+ /* Just an incremental number to ensure uniqueness across revisions */
+ guint revision_counter;
};
@@ -265,6 +268,7 @@ save (ECalBackendFile *cbfile)
g_static_rec_mutex_lock (&priv->idle_save_rmutex);
priv->is_dirty = TRUE;
+ priv->revision_counter++;
if (!priv->dirty_idle_id)
priv->dirty_idle_id = g_idle_add ((GSourceFunc) save_file_when_idle, cbfile);
@@ -2011,6 +2015,55 @@ e_cal_backend_file_internal_get_timezone (ECalBackend *backend, const gchar *tzi
return zone;
}
+/* Get_revision handler for the file backend */
+static gchar *
+get_revision_string (ECalBackendFile *cbfile)
+{
+ gchar time_string[100] = {0};
+ struct stat sb;
+ struct tm *timeval;
+
+ if (g_stat (cbfile->priv->path, &sb) < 0)
+ /* Called before ical file exists, shouldn't happen */
+ return NULL;
+
+ timeval = gmtime (&sb.st_mtime);
+
+ if (timeval)
+ strftime (time_string, 100, "%Y-%m-%dT%H:%M:%SZ", timeval);
+ else
+ g_critical ("Failed to generate revision string");
+
+ return g_strdup_printf ("%s(%d)", time_string, cbfile->priv->revision_counter);
+}
+
+static void
+e_cal_backend_file_get_revision (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *cancellable)
+{
+ ECalBackendFile *cbfile = E_CAL_BACKEND_FILE (backend);
+ gchar *revision;
+
+ /* Sync the file right now because we need a timestamp to
+ * make a revision
+ */
+ if (cbfile->priv->is_dirty) {
+ if (cbfile->priv->dirty_idle_id) {
+ g_source_remove (cbfile->priv->dirty_idle_id);
+ cbfile->priv->dirty_idle_id = 0;
+ }
+ save_file_when_idle (cbfile);
+
+ /* Do we need to reset 'refresh_skip' here ?? */
+ /* priv->refresh_skip = 0; */
+ }
+
+ /* Notify with the revision */
+ revision = get_revision_string (cbfile);
+
+ e_data_cal_respond_get_revision (cal, opid, NULL, revision);
+ g_free (revision);
+}
+
static void
sanitize_component (ECalBackendFile *cbfile, ECalComponent *comp)
{
@@ -3213,6 +3266,7 @@ e_cal_backend_file_class_init (ECalBackendFileClass *class)
backend_class->start_view = e_cal_backend_file_start_view;
backend_class->set_online = e_cal_backend_file_set_online;
backend_class->internal_get_timezone = e_cal_backend_file_internal_get_timezone;
+ backend_class->get_revision = e_cal_backend_file_get_revision;
}
void
diff --git a/calendar/libecal/e-cal-client.c b/calendar/libecal/e-cal-client.c
index cfd6403..8e6d21d 100644
--- a/calendar/libecal/e-cal-client.c
+++ b/calendar/libecal/e-cal-client.c
@@ -4516,6 +4516,84 @@ e_cal_client_add_timezone_sync (ECalClient *client, /* const */ icaltimezone *zo
return res;
}
+/**
+ * e_cal_client_get_revision:
+ * @client: an #ECalClient
+ * @cancellable: a #GCancellable; can be %NULL
+ * @callback: callback to call when a result is ready
+ * @user_data: user data for the @callback
+ *
+ * Query @client for an opaque revision string representing
+ * the current state of the calendar. The call is finished
+ * by e_cal_client_get_view_finish() from the @callback.
+ *
+ *
+ * Since: 3.2
+ **/
+void
+e_cal_client_get_revision (ECalClient *client, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
+{
+ e_client_proxy_call_void (E_CLIENT (client), cancellable, callback, user_data,
+ e_cal_client_get_revision,
+ e_gdbus_cal_call_get_revision,
+ NULL, NULL, e_gdbus_cal_call_get_revision_finish, NULL, NULL);
+}
+
+/**
+ * e_cal_client_get_revision_finish:
+ * @client: an #ECalClient
+ * @result: a #GAsyncResult
+ * @revision: (out) (transfer full): an opaque revision string if the backend supports it, otherwise %NULL.
+ * @error: (out): a #GError to set an error, if any
+ *
+ * Finishes previous call of e_cal_client_get_revision().
+ * If the call is successful and the backend in use reports opaque
+ * revision strings, then the @revision is set to newly allocated opaque
+ * revision string which should be freed with g_free().
+ *
+ * Returns: %TRUE if successful, %FALSE otherwise.
+ *
+ * Since: 3.2
+ **/
+gboolean
+e_cal_client_get_revision_finish (ECalClient *client, GAsyncResult *result, gchar **revision, GError **error)
+{
+ g_return_val_if_fail (revision != NULL, FALSE);
+
+ return e_client_proxy_call_finish_string (E_CLIENT (client), result, revision, error,
+ e_cal_client_get_revision);
+}
+
+/**
+ * e_cal_client_get_revision_sync:
+ * @client: an #ECalClient
+ * @revision: (out) (transfer full): a location to store an opaque revision string
+ * @cancellable: a #GCancellable; can be %NULL
+ * @error: (out): a #GError to set an error, if any
+ *
+ * Query @client for an opaque revision string representing
+ * the current state of the calendar.
+ *
+ * Since: 3.2
+ **/
+gboolean
+e_cal_client_get_revision_sync (ECalClient *client, gchar **revision, GCancellable *cancellable, GError **error)
+{
+ g_return_val_if_fail (client != NULL, FALSE);
+ g_return_val_if_fail (E_IS_CAL_CLIENT (client), FALSE);
+ g_return_val_if_fail (client->priv != NULL, FALSE);
+ g_return_val_if_fail (revision != NULL, FALSE);
+
+ if (!client->priv->gdbus_cal) {
+ set_proxy_gone_error (error);
+ return FALSE;
+ }
+
+ return e_client_proxy_call_sync_void__string (E_CLIENT (client), revision, cancellable, error,
+ e_gdbus_cal_call_get_revision_sync);
+}
+
+
static GDBusProxy *
cal_client_get_dbus_proxy (EClient *client)
{
diff --git a/calendar/libecal/e-cal-client.h b/calendar/libecal/e-cal-client.h
index e04491a..aef2599 100644
--- a/calendar/libecal/e-cal-client.h
+++ b/calendar/libecal/e-cal-client.h
@@ -187,6 +187,10 @@ void e_cal_client_add_timezone (ECalClient *client, /* const */ icaltimezone
gboolean e_cal_client_add_timezone_finish (ECalClient *client, GAsyncResult *result, GError **error);
gboolean e_cal_client_add_timezone_sync (ECalClient *client, /* const */ icaltimezone *zone, GCancellable *cancellable, GError **error);
+void e_cal_client_get_revision (ECalClient *client, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
+gboolean e_cal_client_get_revision_finish (ECalClient *client, GAsyncResult *result, gchar **revision, GError **error);
+gboolean e_cal_client_get_revision_sync (ECalClient *client, gchar **revision, GCancellable *cancellable, GError **error);
+
G_END_DECLS
#endif /* E_CAL_CLIENT_H */
diff --git a/calendar/libedata-cal/e-cal-backend.c b/calendar/libedata-cal/e-cal-backend.c
index d79e4e2..3a6d6fc 100644
--- a/calendar/libedata-cal/e-cal-backend.c
+++ b/calendar/libedata-cal/e-cal-backend.c
@@ -1373,6 +1373,31 @@ e_cal_backend_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
}
/**
+ * e_cal_backend_get_revision:
+ * @backend: an #ECalBackend
+ * @cal: an #EDataCal
+ * @opid: the ID to use for this operation
+ *
+ * Executes a 'get revision' request specified by @opid on @cal
+ * using @backend.
+ **/
+void
+e_cal_backend_get_revision (ECalBackend *backend,
+ EDataCal *cal,
+ guint32 opid,
+ GCancellable *cancellable)
+{
+ g_return_if_fail (E_IS_CAL_BACKEND (backend));
+ g_return_if_fail (E_IS_DATA_CAL (cal));
+
+ if (E_CAL_BACKEND_GET_CLASS (backend)->get_revision)
+ (* E_CAL_BACKEND_GET_CLASS (backend)->get_revision) (backend, cal, opid, cancellable);
+ else
+ /* If the backend does not implement, successfully return a NULL string */
+ e_data_cal_respond_get_revision (cal, opid, NULL, NULL);
+}
+
+/**
* e_cal_backend_start_view:
* @backend: an #ECalBackend
* @view: The view to be started.
diff --git a/calendar/libedata-cal/e-cal-backend.h b/calendar/libedata-cal/e-cal-backend.h
index 840b092..f9f0da7 100644
--- a/calendar/libedata-cal/e-cal-backend.h
+++ b/calendar/libedata-cal/e-cal-backend.h
@@ -88,6 +88,7 @@ struct _ECalBackendClass {
void (* discard_alarm) (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *cancellable, const gchar *uid, const gchar *rid, const gchar *auid);
void (* get_timezone) (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *cancellable, const gchar *tzid);
void (* add_timezone) (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *cancellable, const gchar *tzobject);
+ void (* get_revision) (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *cancellable);
void (* start_view) (ECalBackend *backend, EDataCalView *view);
void (* stop_view) (ECalBackend *backend, EDataCalView *view);
@@ -144,6 +145,8 @@ void e_cal_backend_discard_alarm (ECalBackend *backend, EDataCal *cal, guint32
void e_cal_backend_get_timezone (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *cancellable, const gchar *tzid);
void e_cal_backend_add_timezone (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *cancellable, const gchar *tzobject);
icaltimezone * e_cal_backend_internal_get_timezone (ECalBackend *backend, const gchar *tzid);
+void e_cal_backend_get_revision (ECalBackend *backend, EDataCal *cal, guint32 opid, GCancellable *cancellable);
+
void e_cal_backend_start_view (ECalBackend *backend, EDataCalView *view);
void e_cal_backend_stop_view (ECalBackend *backend, EDataCalView *view);
diff --git a/calendar/libedata-cal/e-data-cal.c b/calendar/libedata-cal/e-data-cal.c
index 6eeaa96..0574158 100644
--- a/calendar/libedata-cal/e-data-cal.c
+++ b/calendar/libedata-cal/e-data-cal.c
@@ -75,6 +75,7 @@ typedef enum {
OP_GET_VIEW,
OP_GET_TIMEZONE,
OP_ADD_TIMEZONE,
+ OP_GET_REVISION,
OP_CANCEL_OPERATION,
OP_CANCEL_ALL,
OP_CLOSE
@@ -293,6 +294,9 @@ operation_thread (gpointer data, gpointer user_data)
e_cal_backend_add_timezone (backend, op->cal, op->id, op->cancellable, op->d.tzobject);
g_free (op->d.tzobject);
break;
+ case OP_GET_REVISION:
+ e_cal_backend_get_revision (backend, op->cal, op->id, op->cancellable);
+ break;
case OP_AUTHENTICATE:
e_cal_backend_authenticate_user (backend, op->cancellable, op->d.credentials);
e_credentials_free (op->d.credentials);
@@ -814,6 +818,19 @@ impl_Cal_add_timezone (EGdbusCal *object, GDBusMethodInvocation *invocation, con
}
static gboolean
+impl_Cal_get_revision (EGdbusCal *object, GDBusMethodInvocation *invocation, EDataCal *cal)
+{
+ OperationData *op;
+
+ op = op_new (OP_GET_REVISION, cal);
+
+ e_gdbus_cal_complete_get_revision (cal->priv->gdbus_object, invocation, op->id);
+ e_operation_pool_push (ops_pool, op);
+
+ return TRUE;
+}
+
+static gboolean
impl_Cal_authenticate_user (EGdbusCal *object, GDBusMethodInvocation *invocation, const gchar * const *in_credentials, EDataCal *cal)
{
OperationData *op;
@@ -1332,6 +1349,25 @@ e_data_cal_respond_add_timezone (EDataCal *cal, guint32 opid, GError *error)
}
void
+e_data_cal_respond_get_revision (EDataCal *cal, guint32 opid, GError *error, const gchar *revision)
+{
+ gchar *gdbus_revision = NULL;
+
+ op_complete (cal, opid);
+
+ /* Translators: This is prefix to a detailed error message */
+ g_prefix_error (&error, "%s", _("Cannot get revision of calendar: "));
+
+ e_gdbus_cal_emit_get_revision_done (cal->priv->gdbus_object, opid, error,
+ e_util_ensure_gdbus_string (revision, &gdbus_revision));
+
+ if (error)
+ g_error_free (error);
+
+ g_free (gdbus_revision);
+}
+
+void
e_data_cal_report_error (EDataCal *cal, const gchar *message)
{
g_return_if_fail (cal != NULL);
@@ -1460,6 +1496,7 @@ e_data_cal_init (EDataCal *ecal)
g_signal_connect (gdbus_object, "handle-get-view", G_CALLBACK (impl_Cal_get_view), ecal);
g_signal_connect (gdbus_object, "handle-get-timezone", G_CALLBACK (impl_Cal_get_timezone), ecal);
g_signal_connect (gdbus_object, "handle-add-timezone", G_CALLBACK (impl_Cal_add_timezone), ecal);
+ g_signal_connect (gdbus_object, "handle-get-revision", G_CALLBACK (impl_Cal_get_revision), ecal);
g_signal_connect (gdbus_object, "handle-cancel-operation", G_CALLBACK (impl_Cal_cancel_operation), ecal);
g_signal_connect (gdbus_object, "handle-cancel-all", G_CALLBACK (impl_Cal_cancel_all), ecal);
g_signal_connect (gdbus_object, "handle-close", G_CALLBACK (impl_Cal_close), ecal);
diff --git a/calendar/libedata-cal/e-data-cal.h b/calendar/libedata-cal/e-data-cal.h
index cb97e01..c7f5ef6 100644
--- a/calendar/libedata-cal/e-data-cal.h
+++ b/calendar/libedata-cal/e-data-cal.h
@@ -147,6 +147,7 @@ void e_data_cal_respond_discard_alarm (EDataCal *cal, guint32 opid, GError *er
void e_data_cal_respond_get_view (EDataCal *cal, guint32 opid, GError *error, const gchar *view_path);
void e_data_cal_respond_get_timezone (EDataCal *cal, guint32 opid, GError *error, const gchar *tzobject);
void e_data_cal_respond_add_timezone (EDataCal *cal, guint32 opid, GError *error);
+void e_data_cal_respond_get_revision (EDataCal *cal, guint32 opid, GError *error, const gchar *revision);
void e_data_cal_report_error (EDataCal *cal, const gchar *message);
void e_data_cal_report_readonly (EDataCal *cal, gboolean is_readonly);
diff --git a/calendar/libegdbus/e-gdbus-cal.c b/calendar/libegdbus/e-gdbus-cal.c
index 9e747c3..ff1766c 100644
--- a/calendar/libegdbus/e-gdbus-cal.c
+++ b/calendar/libegdbus/e-gdbus-cal.c
@@ -79,6 +79,8 @@ enum
__GET_TIMEZONE_DONE_SIGNAL,
__ADD_TIMEZONE_METHOD,
__ADD_TIMEZONE_DONE_SIGNAL,
+ __GET_REVISION_METHOD,
+ __GET_REVISION_DONE_SIGNAL,
__AUTHENTICATE_USER_METHOD,
__CANCEL_OPERATION_METHOD,
__CANCEL_ALL_METHOD,
@@ -154,6 +156,7 @@ E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_VOID (GDBUS_CAL_INTERFACE_NAME,
E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_STRING (GDBUS_CAL_INTERFACE_NAME, get_view)
E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_STRING (GDBUS_CAL_INTERFACE_NAME, get_timezone)
E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_VOID (GDBUS_CAL_INTERFACE_NAME, add_timezone)
+E_DECLARE_GDBUS_METHOD_DONE_EMISSION_HOOK_ASYNC_STRING (GDBUS_CAL_INTERFACE_NAME, get_revision)
static void
e_gdbus_cal_default_init (EGdbusCalIface *iface)
@@ -192,6 +195,7 @@ e_gdbus_cal_default_init (EGdbusCalIface *iface)
E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING(EGdbusCalIface, "get_view", get_view, __GET_VIEW_METHOD, __GET_VIEW_DONE_SIGNAL)
E_INIT_GDBUS_METHOD_ASYNC_STRING__STRING(EGdbusCalIface, "get_timezone", get_timezone, __GET_TIMEZONE_METHOD, __GET_TIMEZONE_DONE_SIGNAL)
E_INIT_GDBUS_METHOD_ASYNC_STRING__VOID (EGdbusCalIface, "add_timezone", add_timezone, __ADD_TIMEZONE_METHOD, __ADD_TIMEZONE_DONE_SIGNAL)
+ E_INIT_GDBUS_METHOD_ASYNC_VOID__STRING (EGdbusCalIface, "get_revision", get_revision, __GET_REVISION_METHOD, __GET_REVISION_DONE_SIGNAL)
E_INIT_GDBUS_METHOD_STRV (EGdbusCalIface, "authenticate_user", authenticate_user, __AUTHENTICATE_USER_METHOD)
E_INIT_GDBUS_METHOD_UINT (EGdbusCalIface, "cancel_operation", cancel_operation, __CANCEL_OPERATION_METHOD)
E_INIT_GDBUS_METHOD_VOID (EGdbusCalIface, "cancel_all", cancel_all, __CANCEL_ALL_METHOD)
@@ -796,6 +800,26 @@ e_gdbus_cal_call_add_timezone_sync (GDBusProxy *proxy, const gchar *in_tzobject,
}
void
+e_gdbus_cal_call_get_revision (GDBusProxy *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
+{
+ e_gdbus_proxy_call_void ("get_revision", e_gdbus_cal_call_get_revision, E_GDBUS_ASYNC_OP_KEEPER (proxy), cancellable, callback, user_data);
+}
+
+gboolean
+e_gdbus_cal_call_get_revision_finish (GDBusProxy *proxy, GAsyncResult *result, gchar **out_revision, GError **error)
+{
+ return e_gdbus_proxy_finish_call_string (E_GDBUS_ASYNC_OP_KEEPER (proxy), result, out_revision, error, e_gdbus_cal_call_get_revision);
+}
+
+gboolean
+e_gdbus_cal_call_get_revision_sync (GDBusProxy *proxy, gchar **out_revision, GCancellable *cancellable, GError **error)
+{
+ return e_gdbus_proxy_call_sync_void__string (proxy, out_revision, cancellable, error,
+ e_gdbus_cal_call_get_revision,
+ e_gdbus_cal_call_get_revision_finish);
+}
+
+void
e_gdbus_cal_call_authenticate_user (GDBusProxy *proxy, const gchar * const *in_credentials, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data)
{
e_gdbus_proxy_method_call_strv ("authenticate_user", proxy, in_credentials, cancellable, callback, user_data);
@@ -899,6 +923,7 @@ DECLARE_EMIT_DONE_SIGNAL_0 (discard_alarm, __DISCARD_ALARM_DONE_SIGNAL)
DECLARE_EMIT_DONE_SIGNAL_1 (get_view, __GET_VIEW_DONE_SIGNAL, const gchar *)
DECLARE_EMIT_DONE_SIGNAL_1 (get_timezone, __GET_TIMEZONE_DONE_SIGNAL, const gchar *)
DECLARE_EMIT_DONE_SIGNAL_0 (add_timezone, __ADD_TIMEZONE_DONE_SIGNAL)
+DECLARE_EMIT_DONE_SIGNAL_1 (get_revision, __GET_REVISION_DONE_SIGNAL, const gchar *)
void
e_gdbus_cal_emit_backend_error (EGdbusCal *object, const gchar *arg_message)
@@ -971,6 +996,7 @@ E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, discard_alarm, uid_rid_auid, "as")
E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, get_view, sexp, "s", view_path, "s")
E_DECLARE_GDBUS_ASYNC_METHOD_1_WITH_RETURN (cal, get_timezone, tzid, "s", tzobject, "s")
E_DECLARE_GDBUS_ASYNC_METHOD_1 (cal, add_timezone, tzobject, "s")
+E_DECLARE_GDBUS_ASYNC_METHOD_0_WITH_RETURN (cal, get_revision, revision, "s")
E_DECLARE_GDBUS_SYNC_METHOD_1 (cal, authenticate_user, credentials, "as")
E_DECLARE_GDBUS_SYNC_METHOD_1 (cal, cancel_operation, opid, "u")
@@ -997,6 +1023,7 @@ static const GDBusMethodInfo * const e_gdbus_cal_method_info_pointers[] =
&E_DECLARED_GDBUS_METHOD_INFO_NAME (cal, get_view),
&E_DECLARED_GDBUS_METHOD_INFO_NAME (cal, get_timezone),
&E_DECLARED_GDBUS_METHOD_INFO_NAME (cal, add_timezone),
+ &E_DECLARED_GDBUS_METHOD_INFO_NAME (cal, get_revision),
&E_DECLARED_GDBUS_METHOD_INFO_NAME (cal, authenticate_user),
&E_DECLARED_GDBUS_METHOD_INFO_NAME (cal, cancel_operation),
&E_DECLARED_GDBUS_METHOD_INFO_NAME (cal, cancel_all),
@@ -1032,6 +1059,7 @@ static const GDBusSignalInfo * const e_gdbus_cal_signal_info_pointers[] =
&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (cal, get_view_done),
&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (cal, get_timezone_done),
&E_DECLARED_GDBUS_SIGNAL_INFO_NAME (cal, add_timezone_done),
+ &E_DECLARED_GDBUS_SIGNAL_INFO_NAME (cal, get_revision_done),
NULL
};
@@ -1255,6 +1283,7 @@ e_gdbus_cal_proxy_init (EGdbusCalProxy *proxy)
E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_STRING (get_view);
E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_STRING (get_timezone);
E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_VOID (add_timezone);
+ E_GDBUS_CONNECT_METHOD_DONE_SIGNAL_STRING (get_revision);
}
static void
diff --git a/calendar/libegdbus/e-gdbus-cal.h b/calendar/libegdbus/e-gdbus-cal.h
index 695d13b..61effe5 100644
--- a/calendar/libegdbus/e-gdbus-cal.h
+++ b/calendar/libegdbus/e-gdbus-cal.h
@@ -165,6 +165,8 @@ struct _EGdbusCalIface
gboolean (*handle_add_timezone) (EGdbusCal *object, GDBusMethodInvocation *invocation, const gchar *in_tzobject);
void (*add_timezone_done) (EGdbusCal *object, guint arg_opid, const GError *arg_error);
+ gboolean (*handle_get_revision) (EGdbusCal *object, GDBusMethodInvocation *invocation);
+ void (*get_revision_done) (EGdbusCal *object, guint arg_opid, const GError *arg_error, gchar **out_revision);
gboolean (*handle_authenticate_user) (EGdbusCal *object, GDBusMethodInvocation *invocation, const gchar * const *in_credentials);
gboolean (*handle_cancel_operation) (EGdbusCal *object, GDBusMethodInvocation *invocation, guint in_opid);
@@ -261,6 +263,10 @@ void e_gdbus_cal_call_add_timezone (GDBusProxy *proxy, const gchar *in_tzobje
gboolean e_gdbus_cal_call_add_timezone_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error);
gboolean e_gdbus_cal_call_add_timezone_sync (GDBusProxy *proxy, const gchar *in_tzobject, GCancellable *cancellable, GError **error);
+void e_gdbus_cal_call_get_revision (GDBusProxy *proxy, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
+gboolean e_gdbus_cal_call_get_revision_finish (GDBusProxy *proxy, GAsyncResult *result, gchar **out_revision, GError **error);
+gboolean e_gdbus_cal_call_get_revision_sync (GDBusProxy *proxy, gchar **out_revision, GCancellable *cancellable, GError **error);
+
void e_gdbus_cal_call_authenticate_user (GDBusProxy *proxy, const gchar * const *in_credentials, GCancellable *cancellable, GAsyncReadyCallback callback, gpointer user_data);
gboolean e_gdbus_cal_call_authenticate_user_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error);
gboolean e_gdbus_cal_call_authenticate_user_sync (GDBusProxy *proxy, const gchar * const *in_credentials, GCancellable *cancellable, GError **error);
@@ -296,6 +302,7 @@ gboolean e_gdbus_cal_call_close_sync (GDBusProxy *proxy, GCancellable *cancell
#define e_gdbus_cal_complete_get_view e_gdbus_complete_async_method
#define e_gdbus_cal_complete_get_timezone e_gdbus_complete_async_method
#define e_gdbus_cal_complete_add_timezone e_gdbus_complete_async_method
+#define e_gdbus_cal_complete_get_revision e_gdbus_complete_async_method
#define e_gdbus_cal_complete_authenticate_user e_gdbus_complete_sync_method_void
#define e_gdbus_cal_complete_cancel_operation e_gdbus_complete_sync_method_void
#define e_gdbus_cal_complete_cancel_all e_gdbus_complete_sync_method_void
@@ -320,6 +327,7 @@ void e_gdbus_cal_emit_discard_alarm_done (EGdbusCal *object, guint arg_opid, co
void e_gdbus_cal_emit_get_view_done (EGdbusCal *object, guint arg_opid, const GError *arg_error, const gchar *out_view_path);
void e_gdbus_cal_emit_get_timezone_done (EGdbusCal *object, guint arg_opid, const GError *arg_error, const gchar *out_object);
void e_gdbus_cal_emit_add_timezone_done (EGdbusCal *object, guint arg_opid, const GError *arg_error);
+void e_gdbus_cal_emit_get_revision_done (EGdbusCal *object, guint arg_opid, const GError *arg_error, const gchar *out_revision);
/* D-Bus Signal Emission Helpers */
void e_gdbus_cal_emit_backend_error (EGdbusCal *object, const gchar *arg_message);
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]