*
* Sends meeting information in @calobj. The @backend may modify @calobj
* and send meeting information only to particular users. The function
- * returns the sent #ECalComponent and deposits the list of users the
- * meeting information was sent to in @out_users.
+ * returns the (maybe) modified @calobj and deposits the list of users the
+ * meeting information was sent (to be send) to in @out_users.
*
- * The returned #ECalComponent is referenced for thread-safety and must
- * be unrefenced with g_object_unref() when finished with it.
+ * The returned pointer should be freed with g_free(), when no londer needed.
*
* If an error occurs, the function will set @error and return %NULL.
*
- * Returns: an #ECalComponent, or %NULL
+ * Returns: a vCalendar string, or %NULL
*
* Since: 3.10
**/
-ECalComponent *
+gchar *
e_cal_backend_send_objects_sync (ECalBackend *backend,
const gchar *calobj,
GQueue *out_users,
{
EAsyncClosure *closure;
GAsyncResult *result;
- ECalComponent *component;
+ gchar *out_calobj;
g_return_val_if_fail (E_IS_CAL_BACKEND (backend), NULL);
g_return_val_if_fail (calobj != NULL, NULL);
result = e_async_closure_wait (closure);
- component = e_cal_backend_send_objects_finish (
+ out_calobj = e_cal_backend_send_objects_finish (
backend, result, out_users, error);
e_async_closure_free (closure);
- return component;
+ return out_calobj;
}
/* Helper for e_cal_backend_send_objects() */
*
* Finishes the operation started with e_cal_backend_send_objects().
*
- * The function returns the sent #ECalComponent and deposits the list of
- * users the meeting information was sent to in @out_users.
+ * The function returns a string representation of a sent, or to be send,
+ * vCalendar and deposits the list of users the meeting information was sent
+ * to, or to be send to, in @out_users.
*
- * The returned #ECalComponent is referenced for thread-safety and must
- * be unreferenced with g_object_unref() when finished with it.
+ * Free the returned pointer with g_free(), when no longer needed.
*
* If an error occurs, the function will set @error and return %NULL.
*
- * Returns: an #ECalComponent, or %NULL
+ * Returns: a newly allocated vCalendar string, or %NULL
*
* Since: 3.10
**/
-ECalComponent *
+gchar *
e_cal_backend_send_objects_finish (ECalBackend *backend,
GAsyncResult *result,
GQueue *out_users,
{
GSimpleAsyncResult *simple;
AsyncContext *async_context;
- ECalComponent *component;
+ gchar *calobj;
g_return_val_if_fail (
g_simple_async_result_is_valid (
if (g_simple_async_result_propagate_error (simple, error))
return NULL;
- component = g_queue_pop_head (&async_context->result_queue);
- g_return_val_if_fail (E_IS_CAL_COMPONENT (component), NULL);
+ calobj = g_queue_pop_head (&async_context->result_queue);
e_queue_transfer (&async_context->result_queue, out_users);
- return component;
+ return calobj;
}
/**
gpointer user_data)
{
AsyncContext *async_context = user_data;
- ECalComponent *component;
+ gchar *calobj;
GQueue queue = G_QUEUE_INIT;
GError *error = NULL;
- component = e_cal_backend_send_objects_finish (
+ calobj = e_cal_backend_send_objects_finish (
E_CAL_BACKEND (source_object), result, &queue, &error);
/* Sanity check. */
g_return_if_fail (
- ((component != NULL) && (error == NULL)) ||
- ((component == NULL) && (error != NULL)));
+ ((calobj != NULL) && (error == NULL)) ||
+ ((calobj == NULL) && (error != NULL)));
- if (component != NULL) {
+ if (calobj != NULL) {
gchar **strv;
- gchar *string;
- gchar *utf8_string;
+ gchar *utf8_calobj;
gint ii = 0;
strv = g_new0 (gchar *, queue.length + 1);
g_free (user);
}
- string = e_cal_component_get_as_string (component);
- utf8_string = e_util_utf8_make_valid (string);
+ utf8_calobj = e_util_utf8_make_valid (calobj);
e_dbus_calendar_complete_send_objects (
async_context->interface,
async_context->invocation,
(const gchar * const *) strv,
- utf8_string);
+ utf8_calobj);
- g_free (utf8_string);
- g_free (string);
+ g_free (utf8_calobj);
+ g_free (calobj);
g_strfreev (strv);
} else {
g_prefix_error (&error, "%s", _("Cannot send calendar objects: "));
if (error == NULL) {
- ECalComponent *component;
GSList *list, *link;
- component = e_cal_component_new_from_string (calobj);
- g_return_if_fail (component != NULL);
- g_queue_push_tail (queue, g_object_ref (component));
- g_object_unref (component);
+ g_queue_push_tail (queue, g_strdup (calobj));
list = (GSList *) users;