vcard_with_rev = e_vcard_to_string (E_VCARD (*contact), EVC_FORMAT_VCARD_30);
/* This is disgusting, but for a time cards were added with
- ID's that are no longer used (they contained both the uri
- and the id.) If we recognize it as a uri (file:///...) trim
- off everything before the last '/', and use that as the
- id.*/
+ ID's that are no longer used (they contained both the uri
+ and the id.) If we recognize it as a uri (file:///...) trim
+ off everything before the last '/', and use that as the
+ id.*/
if (!strncmp (id, "file:///", strlen ("file:///"))) {
lookup_id = strrchr (id, '/') + 1;
}
if (!strcmp (old_version, "0.1")) {
/* we just loop through all the cards in the db,
- giving them valid ids if they don't have them */
+ giving them valid ids if they don't have them */
DBT id_dbt, vcard_dbt;
DBC *dbc;
gint card_failed = 0;
static void
free_attr_list (GList *attr_list)
{
- GList *l;
+ GList *l;
- for (l = attr_list; l; l = g_list_next (l)) {
- EVCardAttribute *attr = l->data;
- e_vcard_attribute_free (attr);
- }
+ for (l = attr_list; l; l = g_list_next (l)) {
+ EVCardAttribute *attr = l->data;
+ e_vcard_attribute_free (attr);
+ }
- g_list_free (attr_list);
+ g_list_free (attr_list);
}
static void
attr = e_vcard_attribute_new (NULL, EVC_EMAIL);
e_vcard_attribute_add_param_with_value (attr,
- e_vcard_attribute_param_new (EVC_X_DEST_CONTACT_UID),
+ e_vcard_attribute_param_new (EVC_X_DEST_CONTACT_UID),
member->id);
if (member->name) {
gint len = strlen (member->name);
gchar *uid = g_ptr_array_index (ids, i);
contact = e_book_backend_db_cache_get_contact (egwb->priv->file_db, uid);
vcard_list = g_list_append (vcard_list,
- e_vcard_to_string (E_VCARD (contact),
- EVC_FORMAT_VCARD_30));
+ e_vcard_to_string (E_VCARD (contact),
+ EVC_FORMAT_VCARD_30));
g_object_unref (contact);
}
g_ptr_array_free (ids, TRUE);
gchar *uid;
EContact *contact;
- if (!e_flag_is_set (closure->running))
- break;
+ if (!e_flag_is_set (closure->running))
+ break;
uid = g_ptr_array_index (ids, i);
contact = e_book_backend_db_cache_get_contact (ebgw->priv->file_db, uid);
static gpointer
address_book_deltas_thread (gpointer data)
{
- EBookBackendGroupwise *ebgw = data;
- EBookBackendGroupwisePrivate *priv = ebgw->priv;
- GTimeVal timeout;
+ EBookBackendGroupwise *ebgw = data;
+ EBookBackendGroupwisePrivate *priv = ebgw->priv;
+ GTimeVal timeout;
- timeout.tv_sec = 0;
- timeout.tv_usec = 0;
+ timeout.tv_sec = 0;
+ timeout.tv_usec = 0;
- while (TRUE) {
- gboolean succeeded = update_address_book_deltas (ebgw);
+ while (TRUE) {
+ gboolean succeeded = update_address_book_deltas (ebgw);
- g_mutex_lock (priv->dlock->mutex);
+ g_mutex_lock (priv->dlock->mutex);
- if (!succeeded || priv->dlock->exit)
- break;
+ if (!succeeded || priv->dlock->exit)
+ break;
- g_get_current_time (&timeout);
- g_time_val_add (&timeout, CACHE_REFRESH_INTERVAL * 1000);
- g_cond_timed_wait (priv->dlock->cond, priv->dlock->mutex, &timeout);
+ g_get_current_time (&timeout);
+ g_time_val_add (&timeout, CACHE_REFRESH_INTERVAL * 1000);
+ g_cond_timed_wait (priv->dlock->cond, priv->dlock->mutex, &timeout);
- if (priv->dlock->exit)
- break;
+ if (priv->dlock->exit)
+ break;
- g_mutex_unlock (priv->dlock->mutex);
- }
+ g_mutex_unlock (priv->dlock->mutex);
+ }
- g_mutex_unlock (priv->dlock->mutex);
- priv->dthread = NULL;
- return NULL;
+ g_mutex_unlock (priv->dlock->mutex);
+ priv->dthread = NULL;
+ return NULL;
}
static gboolean
fetch_address_book_deltas (EBookBackendGroupwise *ebgw)
{
- EBookBackendGroupwisePrivate *priv = ebgw->priv;
- GError *error = NULL;
+ EBookBackendGroupwisePrivate *priv = ebgw->priv;
+ GError *error = NULL;
/* If the thread is already running just return back */
- if (priv->dthread)
- return FALSE;
+ if (priv->dthread)
+ return FALSE;
- priv->dlock->exit = FALSE;
- priv->dthread = g_thread_create ((GThreadFunc) address_book_deltas_thread, ebgw, TRUE, &error);
- if (!priv->dthread) {
+ priv->dlock->exit = FALSE;
+ priv->dthread = g_thread_create ((GThreadFunc) address_book_deltas_thread, ebgw, TRUE, &error);
+ if (!priv->dthread) {
g_warning (G_STRLOC ": %s", error->message);
- g_error_free (error);
- }
+ g_error_free (error);
+ }
- return TRUE;
+ return TRUE;
}
static gboolean
fetch_address_book_deltas (ebgw);
- ebgw->priv->cache_timeout = 0;
- return FALSE;
+ ebgw->priv->cache_timeout = 0;
+ return FALSE;
}
static void
EBookBackendGroupwise *ebgw;
EBookBackendGroupwisePrivate *priv;
gchar *dirname, *filename, *tmp;
- gchar *book_name;
- gchar *uri;
+ gchar *book_name;
+ gchar *uri;
gchar **tokens;
const gchar *cache_dir;
const gchar *port;
{
EBookBackendGroupwise *bgw;
- EBookBackendGroupwisePrivate *priv;
+ EBookBackendGroupwisePrivate *priv;
bgw = E_BOOK_BACKEND_GROUPWISE (object);
- priv = bgw->priv;
+ priv = bgw->priv;
if (enable_debug)
printf ("\ne_book_backend_groupwise_dispose...\n");
/* Clean up */
- if (priv->cache_timeout) {
- g_source_remove (priv->cache_timeout);
- priv->cache_timeout = 0;
- }
+ if (priv->cache_timeout) {
+ g_source_remove (priv->cache_timeout);
+ priv->cache_timeout = 0;
+ }
- if (priv->dlock) {
- g_mutex_lock (priv->dlock->mutex);
- priv->dlock->exit = TRUE;
- g_mutex_unlock (priv->dlock->mutex);
+ if (priv->dlock) {
+ g_mutex_lock (priv->dlock->mutex);
+ priv->dlock->exit = TRUE;
+ g_mutex_unlock (priv->dlock->mutex);
- g_cond_signal (priv->dlock->cond);
+ g_cond_signal (priv->dlock->cond);
- if (priv->dthread)
- g_thread_join (priv->dthread);
+ if (priv->dthread)
+ g_thread_join (priv->dthread);
- g_mutex_free (priv->dlock->mutex);
- g_cond_free (priv->dlock->cond);
- g_free (priv->dlock);
- priv->dthread = NULL;
- }
+ g_mutex_free (priv->dlock->mutex);
+ g_cond_free (priv->dlock->cond);
+ g_free (priv->dlock);
+ priv->dthread = NULL;
+ }
if (bgw->priv) {
if (bgw->priv->file_db)
backend->priv = priv;
if (!priv->dlock) {
- priv->dlock = g_new0 (SyncUpdate, 1);
- priv->dlock->mutex = g_mutex_new ();
- priv->dlock->cond = g_cond_new ();
- }
+ priv->dlock = g_new0 (SyncUpdate, 1);
+ priv->dlock->mutex = g_mutex_new ();
+ priv->dlock->cond = g_cond_new ();
+ }
if (g_getenv ("GROUPWISE_DEBUG")) {
if (atoi (g_getenv ("GROUPWISE_DEBUG")) == 2)
gchar *current_prop = NULL;
/* XXX if it's an evolutionPerson prop and the ldap
- server doesn't support that objectclass, skip it. */
+ server doesn't support that objectclass, skip it. */
if (prop_info[i].prop_type & PROP_EVOLVE ) {
if (!bl->priv->evolutionPersonSupported)
continue;
}
/* get the value for the new contact, and compare it to
- the value in the current contact to see if we should
- update it -- if adding is TRUE, short circuit the
- check. */
+ the value in the current contact to see if we should
+ update it -- if adding is TRUE, short circuit the
+ check. */
if (prop_info[i].prop_type & PROP_TYPE_STRING) {
new_prop = e_contact_get (new, prop_info[i].field_id);
new_prop_present = (new_prop != NULL);
}
/* need to set INCLUDE to true if the field needs to
- show up in the ldap modify request */
+ show up in the ldap modify request */
if (adding) {
/* if we're creating a new contact, include it if the
- field is there at all */
+ field is there at all */
if (prop_info[i].prop_type & PROP_TYPE_STRING)
include = (new_prop_present && *new_prop); /* empty strings cause problems */
else
}
else {
/* if we're modifying an existing contact,
- include it if the current field value is
- different than the new one, if it didn't
- exist previously, or if it's been
- removed. */
+ include it if the current field value is
+ different than the new one, if it didn't
+ exist previously, or if it's been
+ removed. */
if (prop_info[i].prop_type & PROP_TYPE_STRING) {
current_prop = e_contact_get (current, prop_info[i].field_id);
current_prop_present = (current_prop != NULL);
LDAPMod *mod = g_new (LDAPMod, 1);
/* the included attribute has changed - we
- need to update the dn if it's one of the
- attributes we compute the dn from. */
+ need to update the dn if it's one of the
+ attributes we compute the dn from. */
if (new_dn_needed) {
const gchar *current_dn = e_contact_get_const (current, E_CONTACT_UID);
objectclass_mod->mod_type = g_strdup ("objectClass");
/* yes, this is a linear search for each of our
- objectclasses, but really, how many objectclasses
- are there going to be in any sane ldap entry? */
+ objectclasses, but really, how many objectclasses
+ are there going to be in any sane ldap entry? */
if (!is_rename)
FIND_INSERT (TOP);
if (is_list) {
gint new_dn_needed;
/* grab the result code, and set up the actual modify (or rename)
- if it was successful */
+ if it was successful */
g_static_rec_mutex_lock (&eds_ldap_handler_lock);
ldap_parse_result (bl->priv->ldap, res, &ldap_error,
NULL, &ldap_error_msg, NULL, NULL, 0);
{
EContactAddress *contact_addr = e_contact_get (card, field);
if (!contact_addr)
- contact_addr = g_new0 (EContactAddress, 1);
+ contact_addr = g_new0 (EContactAddress, 1);
return contact_addr;
}
work_city_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_WORK);
- contact_addr->locality = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->locality = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
work_state_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_WORK);
- contact_addr->region = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->region = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
work_po_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_WORK);
- contact_addr->po = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->po = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
work_zip_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_WORK);
- contact_addr->code = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->code = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
work_country_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_WORK);
- contact_addr->country = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->country = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_WORK, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
home_city_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_HOME);
- contact_addr->locality = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_HOME, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->locality = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_HOME, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
home_state_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_HOME);
- contact_addr->region = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_HOME, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->region = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_HOME, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
home_zip_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_HOME);
- contact_addr->code = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_HOME, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->code = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_HOME, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
home_country_populate (EContact * card, gchar **values)
{
EContactAddress *contact_addr = getormakeEContactAddress (card, E_CONTACT_ADDRESS_HOME);
- contact_addr->country = g_strdup (values[0]);
- e_contact_set (card, E_CONTACT_ADDRESS_HOME, contact_addr);
- e_contact_address_free (contact_addr);
+ contact_addr->country = g_strdup (values[0]);
+ e_contact_set (card, E_CONTACT_ADDRESS_HOME, contact_addr);
+ e_contact_address_free (contact_addr);
}
static void
static void
photo_populate (EContact *contact, struct berval **ber_values)
{
- if (ber_values && ber_values[0]) {
- EContactPhoto photo;
- photo.type = E_CONTACT_PHOTO_TYPE_INLINED;
- photo.data.inlined.mime_type = NULL;
- photo.data.inlined.data = (guchar *)ber_values[0]->bv_val;
- photo.data.inlined.length = ber_values[0]->bv_len;
-
- e_contact_set (contact, E_CONTACT_PHOTO, &photo);
- }
+ if (ber_values && ber_values[0]) {
+ EContactPhoto photo;
+ photo.type = E_CONTACT_PHOTO_TYPE_INLINED;
+ photo.data.inlined.mime_type = NULL;
+ photo.data.inlined.data = (guchar *)ber_values[0]->bv_val;
+ photo.data.inlined.length = ber_values[0]->bv_len;
+
+ e_contact_set (contact, E_CONTACT_PHOTO, &photo);
+ }
}
static struct berval **
static void
cert_populate (EContact *contact, struct berval **ber_values)
{
- if (ber_values && ber_values[0]) {
- EContactCert cert;
- cert.data = ber_values[0]->bv_val;
- cert.length = ber_values[0]->bv_len;
+ if (ber_values && ber_values[0]) {
+ EContactCert cert;
+ cert.data = ber_values[0]->bv_val;
+ cert.length = ber_values[0]->bv_len;
- e_contact_set (contact, E_CONTACT_X509_CERT, &cert);
- }
+ e_contact_set (contact, E_CONTACT_X509_CERT, &cert);
+ }
}
typedef struct {
*contact = do_create(bvcf, vcard, TRUE);
if (!*contact) {
/* XXX need a different call status for this case, i
- think */
+ think */
g_propagate_error (perror, EDB_ERROR (CONTACT_NOT_FOUND));
}
}
static void
e_address_western_extract_street (gchar *line, gchar **street, gchar **extended)
{
- const gchar *split = NULL;
+ const gchar *split = NULL;
gint cntr;
for (cntr = 0; extended_keywords[cntr] != NULL; cntr++) {
new_dest = e_destination_new ();
- new_dest->priv->source_uid = g_strdup (dest->priv->source_uid);
- new_dest->priv->contact_uid = g_strdup (dest->priv->contact_uid);
- new_dest->priv->name = g_strdup (dest->priv->name);
- new_dest->priv->email = g_strdup (dest->priv->email);
- new_dest->priv->addr = g_strdup (dest->priv->addr);
- new_dest->priv->email_num = dest->priv->email_num;
- new_dest->priv->ignored = dest->priv->ignored;
+ new_dest->priv->source_uid = g_strdup (dest->priv->source_uid);
+ new_dest->priv->contact_uid = g_strdup (dest->priv->contact_uid);
+ new_dest->priv->name = g_strdup (dest->priv->name);
+ new_dest->priv->email = g_strdup (dest->priv->email);
+ new_dest->priv->addr = g_strdup (dest->priv->addr);
+ new_dest->priv->email_num = dest->priv->email_num;
+ new_dest->priv->ignored = dest->priv->ignored;
if (dest->priv->contact)
new_dest->priv->contact = g_object_ref (dest->priv->contact);
}
/* XXX other settings? */
- new_dest->priv->raw = g_strdup (dest->priv->raw);
+ new_dest->priv->raw = g_strdup (dest->priv->raw);
return new_dest;
}
g_return_val_if_fail (destv, NULL);
/* Q: Please tell me this is only for assertion
- reasons. If this is considered to be ok behavior then you
- shouldn't use g_return's. Just a reminder;-)
+ reasons. If this is considered to be ok behavior then you
+ shouldn't use g_return's. Just a reminder;-)
A: Yes, this is just an assertion. (Though it does find the
length of the vector in the process...)
g_string_append (string, remainder);
- g_assert (g_utf8_validate (string->str, -1, NULL));
+ g_assert (g_utf8_validate (string->str, -1, NULL));
- return g_string_free (string, FALSE);
+ return g_string_free (string, FALSE);
}
/* we try to be as forgiving as we possibly can here - this isn't a
e_vcard_get_attribute (EVCard *evc,
const gchar *name)
{
- GList *attrs, *l;
+ GList *attrs, *l;
- g_return_val_if_fail (E_IS_VCARD (evc), NULL);
- g_return_val_if_fail (name != NULL, NULL);
+ g_return_val_if_fail (E_IS_VCARD (evc), NULL);
+ g_return_val_if_fail (name != NULL, NULL);
- attrs = e_vcard_get_attributes (evc);
- for (l = attrs; l; l = l->next) {
- EVCardAttribute *attr;
+ attrs = e_vcard_get_attributes (evc);
+ for (l = attrs; l; l = l->next) {
+ EVCardAttribute *attr;
- attr = (EVCardAttribute *) l->data;
- if (g_ascii_strcasecmp (attr->name, name) == 0)
- return attr;
- }
+ attr = (EVCardAttribute *) l->data;
+ if (g_ascii_strcasecmp (attr->name, name) == 0)
+ return attr;
+ }
- return NULL;
+ return NULL;
}
/**
* e_vcard_attribute_get_group:
GList *
e_book_backend_cache_get_contacts (EBookBackendCache *cache, const gchar *query)
{
- gchar *vcard_str;
- GSList *l, *lcache;
+ gchar *vcard_str;
+ GSList *l, *lcache;
GList *list = NULL;
EContact *contact;
- EBookBackendSExp *sexp = NULL;
+ EBookBackendSExp *sexp = NULL;
const gchar *uid;
g_return_val_if_fail (E_IS_BOOK_BACKEND_CACHE (cache), NULL);
return NULL;
}
- lcache = l = e_file_cache_get_objects (E_FILE_CACHE (cache));
+ lcache = l = e_file_cache_get_objects (E_FILE_CACHE (cache));
- for (; l != NULL; l = g_slist_next (l)) {
- vcard_str = l->data;
+ for (; l != NULL; l = g_slist_next (l)) {
+ vcard_str = l->data;
if (vcard_str && !strncmp (vcard_str, "BEGIN:VCARD", 11)) {
- contact = e_contact_new_from_vcard (vcard_str);
+ contact = e_contact_new_from_vcard (vcard_str);
uid = e_contact_get_const (contact, E_CONTACT_UID);
- if (contact && uid && *uid &&(query && e_book_backend_sexp_match_contact (sexp, contact)))
+ if (contact && uid && *uid &&(query && e_book_backend_sexp_match_contact (sexp, contact)))
list = g_list_prepend (list, contact);
else
g_object_unref (contact);
- }
+ }
- }
+ }
if (lcache)
g_slist_free (lcache);
if (sexp)
g_object_unref (sexp);
- return g_list_reverse (list);
+ return g_list_reverse (list);
}
/**
}
/* breaking s2 into words */
- words = NULL;
+ words = NULL;
have_nonspace = FALSE;
have_space = FALSE;
last_word = NULL;
g_assert (E_BOOK_BACKEND_GET_CLASS (backend)->set_mode);
- (* E_BOOK_BACKEND_GET_CLASS (backend)->set_mode) (backend, mode);
+ (* E_BOOK_BACKEND_GET_CLASS (backend)->set_mode) (backend, mode);
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.AddressBook",
"writable",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.AddressBook",
"connection",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
params = NULL;
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.AddressBook",
"auth_required",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_book_emit_writable() to do this.
*/ signals[__WRITABLE_SIGNAL] =
g_signal_new ("writable",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, writable),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOOLEAN,
- G_TYPE_NONE,
- 1,
- G_TYPE_BOOLEAN);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, writable),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOOLEAN,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_BOOLEAN);
g_signal_add_emission_hook (signals[__WRITABLE_SIGNAL],
- 0,
- signal_emission_hook_cb_writable,
+ 0,
+ signal_emission_hook_cb_writable,
(gpointer) "writable",
- NULL);
+ NULL);
/**
* EGdbusBook::connection:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_book_emit_connection() to do this.
*/ signals[__CONNECTION_SIGNAL] =
g_signal_new ("connection",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, connection),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOOLEAN,
- G_TYPE_NONE,
- 1,
- G_TYPE_BOOLEAN);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, connection),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOOLEAN,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_BOOLEAN);
g_signal_add_emission_hook (signals[__CONNECTION_SIGNAL],
- 0,
- signal_emission_hook_cb_connection,
+ 0,
+ signal_emission_hook_cb_connection,
(gpointer) "connection",
- NULL);
+ NULL);
/**
* EGdbusBook::auth-required:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_book_emit_auth_required() to do this.
*/ signals[__AUTH_REQUIRED_SIGNAL] =
g_signal_new ("auth-required",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, auth_required),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, auth_required),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
g_signal_add_emission_hook (signals[__AUTH_REQUIRED_SIGNAL],
- 0,
- signal_emission_hook_cb_auth_required,
+ 0,
+ signal_emission_hook_cb_auth_required,
(gpointer) "auth_required",
- NULL);
+ NULL);
/* GObject signals definitions for D-Bus methods: */
/**
*/
signals[__OPEN_METHOD] =
g_signal_new ("handle-open",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_open),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_BOOLEAN,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_BOOLEAN);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_open),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_BOOLEAN,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_BOOLEAN);
/**
* EGdbusBook::handle-remove:
* @object: The exported object emitting the signal.
*/
signals[__REMOVE_METHOD] =
g_signal_new ("handle-remove",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_remove),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_remove),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusBook::handle-get-contact:
* @object: The exported object emitting the signal.
*/
signals[__GET_CONTACT_METHOD] =
g_signal_new ("handle-get-contact",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_get_contact),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_get_contact),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusBook::handle-get-contact-list:
* @object: The exported object emitting the signal.
*/
signals[__GET_CONTACT_LIST_METHOD] =
g_signal_new ("handle-get-contact-list",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_get_contact_list),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_get_contact_list),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusBook::handle-authenticate-user:
* @object: The exported object emitting the signal.
*/
signals[__AUTHENTICATE_USER_METHOD] =
g_signal_new ("handle-authenticate-user",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_authenticate_user),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING_STRING,
- G_TYPE_BOOLEAN,
- 4,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_authenticate_user),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING_STRING,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
/**
* EGdbusBook::handle-add-contact:
* @object: The exported object emitting the signal.
*/
signals[__ADD_CONTACT_METHOD] =
g_signal_new ("handle-add-contact",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_add_contact),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_add_contact),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusBook::handle-remove-contacts:
* @object: The exported object emitting the signal.
*/
signals[__REMOVE_CONTACTS_METHOD] =
g_signal_new ("handle-remove-contacts",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_remove_contacts),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_BOXED,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRV);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_remove_contacts),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_BOXED,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRV);
/**
* EGdbusBook::handle-modify-contact:
* @object: The exported object emitting the signal.
*/
signals[__MODIFY_CONTACT_METHOD] =
g_signal_new ("handle-modify-contact",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_modify_contact),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_modify_contact),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusBook::handle-get-static-capabilities:
* @object: The exported object emitting the signal.
*/
signals[__GET_STATIC_CAPABILITIES_METHOD] =
g_signal_new ("handle-get-static-capabilities",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_get_static_capabilities),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_get_static_capabilities),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusBook::handle-get-required-fields:
* @object: The exported object emitting the signal.
*/
signals[__GET_REQUIRED_FIELDS_METHOD] =
g_signal_new ("handle-get-required-fields",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_get_required_fields),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_get_required_fields),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusBook::handle-get-supported-fields:
* @object: The exported object emitting the signal.
*/
signals[__GET_SUPPORTED_FIELDS_METHOD] =
g_signal_new ("handle-get-supported-fields",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_get_supported_fields),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_get_supported_fields),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusBook::handle-get-supported-auth-methods:
* @object: The exported object emitting the signal.
*/
signals[__GET_SUPPORTED_AUTH_METHODS_METHOD] =
g_signal_new ("handle-get-supported-auth-methods",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_get_supported_auth_methods),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_get_supported_auth_methods),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusBook::handle-get-book-view:
* @object: The exported object emitting the signal.
*/
signals[__GET_BOOK_VIEW_METHOD] =
g_signal_new ("handle-get-book-view",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_get_book_view),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_UINT,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING,
- G_TYPE_UINT);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_get_book_view),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_UINT,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING,
+ G_TYPE_UINT);
/**
* EGdbusBook::handle-get-changes:
* @object: The exported object emitting the signal.
*/
signals[__GET_CHANGES_METHOD] =
g_signal_new ("handle-get-changes",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_get_changes),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_get_changes),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusBook::handle-cancel-operation:
* @object: The exported object emitting the signal.
*/
signals[__CANCEL_OPERATION_METHOD] =
g_signal_new ("handle-cancel-operation",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_cancel_operation),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_cancel_operation),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusBook::handle-close:
* @object: The exported object emitting the signal.
*/
signals[__CLOSE_METHOD] =
g_signal_new ("handle-close",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookIface, handle_close),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookIface, handle_close),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/* GObject property definitions for D-Bus properties: */
}
{
GVariant *_params;
_params = g_variant_new ("(b)",
- in_only_if_exists);
+ in_only_if_exists);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"open",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(b)",
- in_only_if_exists);
+ in_only_if_exists);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"open",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"remove",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"remove",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_uid);
+ in_uid);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getContact",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_vcard);
+ out_vcard);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_uid);
+ in_uid);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getContact",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_vcard);
+ out_vcard);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_query);
+ in_query);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getContactList",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^as)",
- out_vcards);
+ out_vcards);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_query);
+ in_query);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getContactList",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^as)",
- out_vcards);
+ out_vcards);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(sss)",
- in_user,
- in_passwd,
- in_auth_method);
+ in_user,
+ in_passwd,
+ in_auth_method);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"authenticateUser",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(sss)",
- in_user,
- in_passwd,
- in_auth_method);
+ in_user,
+ in_passwd,
+ in_auth_method);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"authenticateUser",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_vcard);
+ in_vcard);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"addContact",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_uid);
+ out_uid);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_vcard);
+ in_vcard);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"addContact",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_uid);
+ out_uid);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(^as)",
- in_list);
+ in_list);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"removeContacts",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(^as)",
- in_list);
+ in_list);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"removeContacts",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_vcard);
+ in_vcard);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"modifyContact",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_vcard);
+ in_vcard);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"modifyContact",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getStaticCapabilities",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_capabilities);
+ out_capabilities);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getStaticCapabilities",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_capabilities);
+ out_capabilities);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getRequiredFields",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^as)",
- out_fields);
+ out_fields);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getRequiredFields",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^as)",
- out_fields);
+ out_fields);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getSupportedFields",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^as)",
- out_fields);
+ out_fields);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getSupportedFields",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^as)",
- out_fields);
+ out_fields);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getSupportedAuthMethods",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^as)",
- out_auth_methods);
+ out_auth_methods);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getSupportedAuthMethods",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^as)",
- out_auth_methods);
+ out_auth_methods);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(su)",
- in_query,
- in_max_results);
+ in_query,
+ in_max_results);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getBookView",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(o)",
- out_view);
+ out_view);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(su)",
- in_query,
- in_max_results);
+ in_query,
+ in_max_results);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getBookView",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(o)",
- out_view);
+ out_view);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_change_id);
+ in_change_id);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getChanges",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(*)",
- out_changes);
+ out_changes);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_change_id);
+ in_change_id);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getChanges",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(*)",
- out_changes);
+ out_changes);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"cancelOperation",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"cancelOperation",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"close",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"close",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_vcard);
+ out_vcard);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^as)",
- out_vcards);
+ out_vcards);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_uid);
+ out_uid);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_capabilities);
+ out_capabilities);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^as)",
- out_fields);
+ out_fields);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^as)",
- out_fields);
+ out_fields);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^as)",
- out_auth_methods);
+ out_auth_methods);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(o)",
- out_view);
+ out_view);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(*)",
- out_changes);
+ out_changes);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
case __OPEN_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- gboolean arg_only_if_exists;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ gboolean arg_only_if_exists;
+ g_variant_get (parameters,
"(b)",
- &arg_only_if_exists);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_only_if_exists, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_only_if_exists);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_only_if_exists, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __REMOVE_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_CONTACT_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- const gchar *arg_uid;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ const gchar *arg_uid;
+ g_variant_get (parameters,
"(&s)",
- &arg_uid);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_uid, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_uid);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_uid, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_CONTACT_LIST_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- const gchar *arg_query;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ const gchar *arg_query;
+ g_variant_get (parameters,
"(&s)",
- &arg_query);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_query, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_query);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_query, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __AUTHENTICATE_USER_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- const gchar *arg_user;
- const gchar *arg_passwd;
- const gchar *arg_auth_method;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ const gchar *arg_user;
+ const gchar *arg_passwd;
+ const gchar *arg_auth_method;
+ g_variant_get (parameters,
"(&s&s&s)",
- &arg_user,
- &arg_passwd,
- &arg_auth_method);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_user, arg_passwd, arg_auth_method, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_user,
+ &arg_passwd,
+ &arg_auth_method);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_user, arg_passwd, arg_auth_method, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __ADD_CONTACT_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- const gchar *arg_vcard;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ const gchar *arg_vcard;
+ g_variant_get (parameters,
"(&s)",
- &arg_vcard);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_vcard, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_vcard);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_vcard, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __REMOVE_CONTACTS_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- const gchar * const *arg_list;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ const gchar * const *arg_list;
+ g_variant_get (parameters,
"(^a&s)",
- &arg_list);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_list, &handled);
- g_free ((gpointer) arg_list);
- if (!handled)
- goto not_implemented;
+ &arg_list);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_list, &handled);
+ g_free ((gpointer) arg_list);
+ if (!handled)
+ goto not_implemented;
}
break;
case __MODIFY_CONTACT_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- const gchar *arg_vcard;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ const gchar *arg_vcard;
+ g_variant_get (parameters,
"(&s)",
- &arg_vcard);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_vcard, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_vcard);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_vcard, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_STATIC_CAPABILITIES_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_REQUIRED_FIELDS_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_SUPPORTED_FIELDS_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_SUPPORTED_AUTH_METHODS_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_BOOK_VIEW_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- const gchar *arg_query;
- guint arg_max_results;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ const gchar *arg_query;
+ guint arg_max_results;
+ g_variant_get (parameters,
"(&su)",
- &arg_query,
- &arg_max_results);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_query, arg_max_results, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_query,
+ &arg_max_results);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_query, arg_max_results, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_CHANGES_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- const gchar *arg_change_id;
- g_variant_get (parameters,
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ const gchar *arg_change_id;
+ g_variant_get (parameters,
"(&s)",
- &arg_change_id);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_change_id, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_change_id);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_change_id, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __CANCEL_OPERATION_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __CLOSE_METHOD:
{
- EGdbusBook *object = E_GDBUS_BOOK (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBook *object = E_GDBUS_BOOK (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
default:
not_implemented:
g_dbus_method_invocation_return_error (invocation,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"Method `%s' is not implemented",
- method_name);
+ method_name);
break;
}
};
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
break;
}
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
ret = FALSE;
break;
}
GVariant *cached_value;
cached_value = g_hash_table_lookup (pvc, property_name);
if (cached_value == NULL || !g_variant_equal (cached_value, value))
- {
- g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
+ {
+ g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
g_variant_builder_add (builder, "{sv}", property_name, value);
- has_changes = TRUE;
- }
+ has_changes = TRUE;
+ }
}
if (has_changes)
{
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
g_variant_new ("(sa{sv}as)",
"org.gnome.evolution.dataserver.AddressBook",
- builder,
- invalidated_builder),
- NULL);
+ builder,
+ invalidated_builder),
+ NULL);
}
else
{
idle_source = g_idle_source_new ();
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
g_source_set_callback (idle_source,
- emit_notifications_in_idle,
- g_object_ref (object),
- (GDestroyNotify) g_object_unref);
+ emit_notifications_in_idle,
+ g_object_ref (object),
+ (GDestroyNotify) g_object_unref);
idle_id = g_source_attach (idle_source, g_main_context_get_thread_default ());
g_source_unref (idle_source);
g_object_set_data (object, "gdbus-codegen-notification-idle-id", GUINT_TO_POINTER (idle_id));
g_object_set_data_full (G_OBJECT (object), "gdbus-codegen-pvc", (gpointer) pvc, (GDestroyNotify) g_hash_table_unref);
g_signal_connect (object, "notify", G_CALLBACK (on_notify), NULL);
return g_dbus_connection_register_object (connection,
- object_path,
- (GDBusInterfaceInfo *) &_e_gdbus_book_interface_info,
- &e_gdbus_book_interface_vtable,
- object,
- (GDestroyNotify) on_object_unregistered,
- error);
+ object_path,
+ (GDBusInterfaceInfo *) &_e_gdbus_book_interface_info,
+ &e_gdbus_book_interface_vtable,
+ object,
+ (GDestroyNotify) on_object_unregistered,
+ error);
}
/**
e_gdbus_book_proxy_init (EGdbusBookProxy *proxy)
{
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy),
- (GDBusInterfaceInfo *) &_e_gdbus_book_interface_info);
+ (GDBusInterfaceInfo *) &_e_gdbus_book_interface_info);
}
static void
{
case __WRITABLE_SIGNAL:
{
- gboolean arg_value;
- g_variant_get (parameters,
+ gboolean arg_value;
+ g_variant_get (parameters,
"(b)",
- &arg_value);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_value);
+ &arg_value);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_value);
}
break;
case __CONNECTION_SIGNAL:
{
- gboolean arg_connected;
- g_variant_get (parameters,
+ gboolean arg_connected;
+ g_variant_get (parameters,
"(b)",
- &arg_connected);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_connected);
+ &arg_connected);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_connected);
}
break;
case __AUTH_REQUIRED_SIGNAL:
{
- g_signal_emit (proxy,
- signals[signal_id],
- 0);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0);
}
break;
"org.freedesktop.DBus.Properties.Set",
g_variant_new ("(ssv)",
"org.gnome.evolution.dataserver.AddressBook",
- property_name,
- new_value),
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- NULL,
- (GAsyncReadyCallback) property_set_cb,
- (gpointer) property_name);
+ property_name,
+ new_value),
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ NULL,
+ (GAsyncReadyCallback) property_set_cb,
+ (gpointer) property_name);
g_variant_unref (new_value);
}
{
gname = lookup_property_gname_from_property_name (key);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
for (n = 0; invalidated_properties[n] != NULL; n++)
{
gname = lookup_property_gname_from_property_name (invalidated_properties[n]);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
}
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_BOOK_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBook",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_BOOK (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_BOOK_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBook",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_BOOK (initable);
else
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_BOOK_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBook",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_BOOK (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_BOOK_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBook",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_BOOK (initable);
else
/* Signal handlers for receiving D-Bus signals: */
void (*writable) (
- EGdbusBook *object,
- gboolean arg_value);
+ EGdbusBook *object,
+ gboolean arg_value);
void (*connection) (
- EGdbusBook *object,
- gboolean arg_connected);
+ EGdbusBook *object,
+ gboolean arg_connected);
void (*auth_required) (
- EGdbusBook *object);
+ EGdbusBook *object);
/* Signal handlers for handling D-Bus method calls: */
gboolean (*handle_open) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- gboolean in_only_if_exists);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ gboolean in_only_if_exists);
gboolean (*handle_remove) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_contact) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_uid);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_uid);
gboolean (*handle_get_contact_list) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_query);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_query);
gboolean (*handle_authenticate_user) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_user,
- const gchar *in_passwd,
- const gchar *in_auth_method);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_user,
+ const gchar *in_passwd,
+ const gchar *in_auth_method);
gboolean (*handle_add_contact) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_vcard);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_vcard);
gboolean (*handle_remove_contacts) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- const gchar * const *in_list);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ const gchar * const *in_list);
gboolean (*handle_modify_contact) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_vcard);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_vcard);
gboolean (*handle_get_static_capabilities) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_required_fields) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_supported_fields) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_supported_auth_methods) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_book_view) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_query,
- guint in_max_results);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_query,
+ guint in_max_results);
gboolean (*handle_get_changes) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_change_id);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_change_id);
gboolean (*handle_cancel_operation) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_close) (
- EGdbusBook *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBook *object,
+ GDBusMethodInvocation *invocation);
};
/* C Bindings for properties */
*/
signals[__GET_BOOK_METHOD] =
g_signal_new ("handle-get-book",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookFactoryIface, handle_get_book),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookFactoryIface, handle_get_book),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/* GObject property definitions for D-Bus properties: */
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_source);
+ in_source);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getBook",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(o)",
- out_path);
+ out_path);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_source);
+ in_source);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getBook",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(o)",
- out_path);
+ out_path);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(o)",
- out_path);
+ out_path);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
case __GET_BOOK_METHOD:
{
- EGdbusBookFactory *object = E_GDBUS_BOOK_FACTORY (user_data);
- gboolean handled;
- const gchar *arg_source;
- g_variant_get (parameters,
+ EGdbusBookFactory *object = E_GDBUS_BOOK_FACTORY (user_data);
+ gboolean handled;
+ const gchar *arg_source;
+ g_variant_get (parameters,
"(&s)",
- &arg_source);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_source, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_source);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_source, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
default:
not_implemented:
g_dbus_method_invocation_return_error (invocation,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"Method `%s' is not implemented",
- method_name);
+ method_name);
break;
}
};
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
break;
}
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
ret = FALSE;
break;
}
GVariant *cached_value;
cached_value = g_hash_table_lookup (pvc, property_name);
if (cached_value == NULL || !g_variant_equal (cached_value, value))
- {
- g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
+ {
+ g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
g_variant_builder_add (builder, "{sv}", property_name, value);
- has_changes = TRUE;
- }
+ has_changes = TRUE;
+ }
}
if (has_changes)
{
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
g_variant_new ("(sa{sv}as)",
"org.gnome.evolution.dataserver.AddressBookFactory",
- builder,
- invalidated_builder),
- NULL);
+ builder,
+ invalidated_builder),
+ NULL);
}
else
{
idle_source = g_idle_source_new ();
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
g_source_set_callback (idle_source,
- emit_notifications_in_idle,
- g_object_ref (object),
- (GDestroyNotify) g_object_unref);
+ emit_notifications_in_idle,
+ g_object_ref (object),
+ (GDestroyNotify) g_object_unref);
idle_id = g_source_attach (idle_source, g_main_context_get_thread_default ());
g_source_unref (idle_source);
g_object_set_data (object, "gdbus-codegen-notification-idle-id", GUINT_TO_POINTER (idle_id));
g_object_set_data_full (G_OBJECT (object), "gdbus-codegen-pvc", (gpointer) pvc, (GDestroyNotify) g_hash_table_unref);
g_signal_connect (object, "notify", G_CALLBACK (on_notify), NULL);
return g_dbus_connection_register_object (connection,
- object_path,
- (GDBusInterfaceInfo *) &_e_gdbus_book_factory_interface_info,
- &e_gdbus_book_factory_interface_vtable,
- object,
- (GDestroyNotify) on_object_unregistered,
- error);
+ object_path,
+ (GDBusInterfaceInfo *) &_e_gdbus_book_factory_interface_info,
+ &e_gdbus_book_factory_interface_vtable,
+ object,
+ (GDestroyNotify) on_object_unregistered,
+ error);
}
/**
e_gdbus_book_factory_proxy_init (EGdbusBookFactoryProxy *proxy)
{
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy),
- (GDBusInterfaceInfo *) &_e_gdbus_book_factory_interface_info);
+ (GDBusInterfaceInfo *) &_e_gdbus_book_factory_interface_info);
}
static void
"org.freedesktop.DBus.Properties.Set",
g_variant_new ("(ssv)",
"org.gnome.evolution.dataserver.AddressBookFactory",
- property_name,
- new_value),
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- NULL,
- (GAsyncReadyCallback) property_set_cb,
- (gpointer) property_name);
+ property_name,
+ new_value),
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ NULL,
+ (GAsyncReadyCallback) property_set_cb,
+ (gpointer) property_name);
g_variant_unref (new_value);
}
{
gname = lookup_property_gname_from_property_name (key);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
for (n = 0; invalidated_properties[n] != NULL; n++)
{
gname = lookup_property_gname_from_property_name (invalidated_properties[n]);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
}
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_BOOK_FACTORY_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBookFactory",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_BOOK_FACTORY (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_BOOK_FACTORY_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBookFactory",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_BOOK_FACTORY (initable);
else
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_BOOK_FACTORY_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBookFactory",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_BOOK_FACTORY (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_BOOK_FACTORY_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBookFactory",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_BOOK_FACTORY (initable);
else
/* Signal handlers for handling D-Bus method calls: */
gboolean (*handle_get_book) (
- EGdbusBookFactory *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_source);
+ EGdbusBookFactory *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_source);
};
/* C Bindings for properties */
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.AddressBookView",
"ContactsAdded",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.AddressBookView",
"ContactsChanged",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.AddressBookView",
"ContactsRemoved",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.AddressBookView",
"StatusMessage",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.AddressBookView",
"Complete",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_book_view_emit_contacts_added() to do this.
*/ signals[__CONTACTS_ADDED_SIGNAL] =
g_signal_new ("contacts-added",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookViewIface, contacts_added),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRV);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookViewIface, contacts_added),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRV);
g_signal_add_emission_hook (signals[__CONTACTS_ADDED_SIGNAL],
- 0,
- signal_emission_hook_cb_contacts_added,
+ 0,
+ signal_emission_hook_cb_contacts_added,
(gpointer) "ContactsAdded",
- NULL);
+ NULL);
/**
* EGdbusBookView::contacts-changed:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_book_view_emit_contacts_changed() to do this.
*/ signals[__CONTACTS_CHANGED_SIGNAL] =
g_signal_new ("contacts-changed",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookViewIface, contacts_changed),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRV);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookViewIface, contacts_changed),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRV);
g_signal_add_emission_hook (signals[__CONTACTS_CHANGED_SIGNAL],
- 0,
- signal_emission_hook_cb_contacts_changed,
+ 0,
+ signal_emission_hook_cb_contacts_changed,
(gpointer) "ContactsChanged",
- NULL);
+ NULL);
/**
* EGdbusBookView::contacts-removed:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_book_view_emit_contacts_removed() to do this.
*/ signals[__CONTACTS_REMOVED_SIGNAL] =
g_signal_new ("contacts-removed",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookViewIface, contacts_removed),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRV);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookViewIface, contacts_removed),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRV);
g_signal_add_emission_hook (signals[__CONTACTS_REMOVED_SIGNAL],
- 0,
- signal_emission_hook_cb_contacts_removed,
+ 0,
+ signal_emission_hook_cb_contacts_removed,
(gpointer) "ContactsRemoved",
- NULL);
+ NULL);
/**
* EGdbusBookView::status-message:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_book_view_emit_status_message() to do this.
*/ signals[__STATUS_MESSAGE_SIGNAL] =
g_signal_new ("status-message",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookViewIface, status_message),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__STRING,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookViewIface, status_message),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__STRING,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRING);
g_signal_add_emission_hook (signals[__STATUS_MESSAGE_SIGNAL],
- 0,
- signal_emission_hook_cb_status_message,
+ 0,
+ signal_emission_hook_cb_status_message,
(gpointer) "StatusMessage",
- NULL);
+ NULL);
/**
* EGdbusBookView::complete:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_book_view_emit_complete() to do this.
*/ signals[__COMPLETE_SIGNAL] =
g_signal_new ("complete",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookViewIface, complete),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__UINT_STRING,
- G_TYPE_NONE,
- 2,
- G_TYPE_UINT,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookViewIface, complete),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__UINT_STRING,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_UINT,
+ G_TYPE_STRING);
g_signal_add_emission_hook (signals[__COMPLETE_SIGNAL],
- 0,
- signal_emission_hook_cb_complete,
+ 0,
+ signal_emission_hook_cb_complete,
(gpointer) "Complete",
- NULL);
+ NULL);
/* GObject signals definitions for D-Bus methods: */
/**
*/
signals[__START_METHOD] =
g_signal_new ("handle-start",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookViewIface, handle_start),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookViewIface, handle_start),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusBookView::handle-stop:
* @object: The exported object emitting the signal.
*/
signals[__STOP_METHOD] =
g_signal_new ("handle-stop",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookViewIface, handle_stop),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookViewIface, handle_stop),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusBookView::handle-dispose:
* @object: The exported object emitting the signal.
*/
signals[__DISPOSE_METHOD] =
g_signal_new ("handle-dispose",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusBookViewIface, handle_dispose),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusBookViewIface, handle_dispose),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/* GObject property definitions for D-Bus properties: */
}
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"start",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"start",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"stop",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"stop",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"dispose",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"dispose",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
case __START_METHOD:
{
- EGdbusBookView *object = E_GDBUS_BOOK_VIEW (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBookView *object = E_GDBUS_BOOK_VIEW (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __STOP_METHOD:
{
- EGdbusBookView *object = E_GDBUS_BOOK_VIEW (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBookView *object = E_GDBUS_BOOK_VIEW (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __DISPOSE_METHOD:
{
- EGdbusBookView *object = E_GDBUS_BOOK_VIEW (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusBookView *object = E_GDBUS_BOOK_VIEW (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
default:
not_implemented:
g_dbus_method_invocation_return_error (invocation,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"Method `%s' is not implemented",
- method_name);
+ method_name);
break;
}
};
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
break;
}
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
ret = FALSE;
break;
}
GVariant *cached_value;
cached_value = g_hash_table_lookup (pvc, property_name);
if (cached_value == NULL || !g_variant_equal (cached_value, value))
- {
- g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
+ {
+ g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
g_variant_builder_add (builder, "{sv}", property_name, value);
- has_changes = TRUE;
- }
+ has_changes = TRUE;
+ }
}
if (has_changes)
{
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
g_variant_new ("(sa{sv}as)",
"org.gnome.evolution.dataserver.AddressBookView",
- builder,
- invalidated_builder),
- NULL);
+ builder,
+ invalidated_builder),
+ NULL);
}
else
{
idle_source = g_idle_source_new ();
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
g_source_set_callback (idle_source,
- emit_notifications_in_idle,
- g_object_ref (object),
- (GDestroyNotify) g_object_unref);
+ emit_notifications_in_idle,
+ g_object_ref (object),
+ (GDestroyNotify) g_object_unref);
idle_id = g_source_attach (idle_source, g_main_context_get_thread_default ());
g_source_unref (idle_source);
g_object_set_data (object, "gdbus-codegen-notification-idle-id", GUINT_TO_POINTER (idle_id));
g_object_set_data_full (G_OBJECT (object), "gdbus-codegen-pvc", (gpointer) pvc, (GDestroyNotify) g_hash_table_unref);
g_signal_connect (object, "notify", G_CALLBACK (on_notify), NULL);
return g_dbus_connection_register_object (connection,
- object_path,
- (GDBusInterfaceInfo *) &_e_gdbus_book_view_interface_info,
- &e_gdbus_book_view_interface_vtable,
- object,
- (GDestroyNotify) on_object_unregistered,
- error);
+ object_path,
+ (GDBusInterfaceInfo *) &_e_gdbus_book_view_interface_info,
+ &e_gdbus_book_view_interface_vtable,
+ object,
+ (GDestroyNotify) on_object_unregistered,
+ error);
}
/**
e_gdbus_book_view_proxy_init (EGdbusBookViewProxy *proxy)
{
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy),
- (GDBusInterfaceInfo *) &_e_gdbus_book_view_interface_info);
+ (GDBusInterfaceInfo *) &_e_gdbus_book_view_interface_info);
}
static void
{
case __CONTACTS_ADDED_SIGNAL:
{
- const gchar * const *arg_vcards;
- g_variant_get (parameters,
+ const gchar * const *arg_vcards;
+ g_variant_get (parameters,
"(^a&s)",
- &arg_vcards);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_vcards);
- g_free ((gpointer) arg_vcards);
+ &arg_vcards);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_vcards);
+ g_free ((gpointer) arg_vcards);
}
break;
case __CONTACTS_CHANGED_SIGNAL:
{
- const gchar * const *arg_vcards;
- g_variant_get (parameters,
+ const gchar * const *arg_vcards;
+ g_variant_get (parameters,
"(^a&s)",
- &arg_vcards);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_vcards);
- g_free ((gpointer) arg_vcards);
+ &arg_vcards);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_vcards);
+ g_free ((gpointer) arg_vcards);
}
break;
case __CONTACTS_REMOVED_SIGNAL:
{
- const gchar * const *arg_ids;
- g_variant_get (parameters,
+ const gchar * const *arg_ids;
+ g_variant_get (parameters,
"(^a&s)",
- &arg_ids);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_ids);
- g_free ((gpointer) arg_ids);
+ &arg_ids);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_ids);
+ g_free ((gpointer) arg_ids);
}
break;
case __STATUS_MESSAGE_SIGNAL:
{
- const gchar *arg_message;
- g_variant_get (parameters,
+ const gchar *arg_message;
+ g_variant_get (parameters,
"(&s)",
- &arg_message);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_message);
+ &arg_message);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_message);
}
break;
case __COMPLETE_SIGNAL:
{
- guint arg_status;
- const gchar *arg_message;
- g_variant_get (parameters,
+ guint arg_status;
+ const gchar *arg_message;
+ g_variant_get (parameters,
"(u&s)",
- &arg_status,
- &arg_message);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_status, arg_message);
+ &arg_status,
+ &arg_message);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_status, arg_message);
}
break;
"org.freedesktop.DBus.Properties.Set",
g_variant_new ("(ssv)",
"org.gnome.evolution.dataserver.AddressBookView",
- property_name,
- new_value),
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- NULL,
- (GAsyncReadyCallback) property_set_cb,
- (gpointer) property_name);
+ property_name,
+ new_value),
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ NULL,
+ (GAsyncReadyCallback) property_set_cb,
+ (gpointer) property_name);
g_variant_unref (new_value);
}
{
gname = lookup_property_gname_from_property_name (key);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
for (n = 0; invalidated_properties[n] != NULL; n++)
{
gname = lookup_property_gname_from_property_name (invalidated_properties[n]);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
}
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_BOOK_VIEW_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBookView",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_BOOK_VIEW (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_BOOK_VIEW_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBookView",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_BOOK_VIEW (initable);
else
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_BOOK_VIEW_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBookView",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_BOOK_VIEW (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_BOOK_VIEW_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.AddressBookView",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_BOOK_VIEW (initable);
else
/* Signal handlers for receiving D-Bus signals: */
void (*contacts_added) (
- EGdbusBookView *object,
- const gchar * const *arg_vcards);
+ EGdbusBookView *object,
+ const gchar * const *arg_vcards);
void (*contacts_changed) (
- EGdbusBookView *object,
- const gchar * const *arg_vcards);
+ EGdbusBookView *object,
+ const gchar * const *arg_vcards);
void (*contacts_removed) (
- EGdbusBookView *object,
- const gchar * const *arg_ids);
+ EGdbusBookView *object,
+ const gchar * const *arg_ids);
void (*status_message) (
- EGdbusBookView *object,
- const gchar *arg_message);
+ EGdbusBookView *object,
+ const gchar *arg_message);
void (*complete) (
- EGdbusBookView *object,
- guint arg_status,
- const gchar *arg_message);
+ EGdbusBookView *object,
+ guint arg_status,
+ const gchar *arg_message);
/* Signal handlers for handling D-Bus method calls: */
gboolean (*handle_start) (
- EGdbusBookView *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBookView *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_stop) (
- EGdbusBookView *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBookView *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_dispose) (
- EGdbusBookView *object,
- GDBusMethodInvocation *invocation);
+ EGdbusBookView *object,
+ GDBusMethodInvocation *invocation);
};
/* C Bindings for properties */
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__UINT_STRING) (gpointer data1,
- guint arg_1,
- gpointer arg_2,
- gpointer data2);
+ guint arg_1,
+ gpointer arg_2,
+ gpointer data2);
register GMarshalFunc_VOID__UINT_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__UINT_STRING) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_uint (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- data2);
+ g_marshal_value_peek_uint (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ data2);
}
/* BOOLEAN:OBJECT (e-gdbus-marshallers.list:5) */
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT) (gpointer data1,
- gpointer arg_1,
- gpointer data2);
+ gpointer arg_1,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_BOOLEAN) (gpointer data1,
- gpointer arg_1,
- gboolean arg_2,
- gpointer data2);
+ gpointer arg_1,
+ gboolean arg_2,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_BOOLEAN callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_BOOLEAN) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_boolean (param_values + 2),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_boolean (param_values + 2),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING_STRING) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer arg_3,
- gpointer arg_4,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer arg_3,
+ gpointer arg_4,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- g_marshal_value_peek_string (param_values + 3),
- g_marshal_value_peek_string (param_values + 4),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_string (param_values + 3),
+ g_marshal_value_peek_string (param_values + 4),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_BOXED) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_BOXED callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_BOXED) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_boxed (param_values + 2),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_boxed (param_values + 2),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING_UINT) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- guint arg_3,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ guint arg_3,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_STRING_UINT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING_UINT) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- g_marshal_value_peek_uint (param_values + 3),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_uint (param_values + 3),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gboolean
ebook_test_utils_callback_quit (gpointer user_data)
{
- EBookTestClosure *closure = user_data;
- g_main_loop_quit ((GMainLoop*) closure->user_data);
+ EBookTestClosure *closure = user_data;
+ g_main_loop_quit ((GMainLoop*) closure->user_data);
- return FALSE;
+ return FALSE;
}
gchar *
ebook_test_utils_new_vcard_from_test_case (const gchar *case_name)
{
- gchar *filename;
- gchar *case_filename;
- GFile* file;
- GError *error = NULL;
- gchar *vcard;
+ gchar *filename;
+ gchar *case_filename;
+ GFile* file;
+ GError *error = NULL;
+ gchar *vcard;
case_filename = g_strdup_printf ("%s.vcf", case_name);
- filename = g_build_filename (SRCDIR, EBOOK_TEST_UTILS_DATA_DIR, EBOOK_TEST_UTILS_VCARDS_DIR, case_filename, NULL);
- file = g_file_new_for_path (filename);
- if (!g_file_load_contents (file, NULL, &vcard, NULL, NULL, &error)) {
+ filename = g_build_filename (SRCDIR, EBOOK_TEST_UTILS_DATA_DIR, EBOOK_TEST_UTILS_VCARDS_DIR, case_filename, NULL);
+ file = g_file_new_for_path (filename);
+ if (!g_file_load_contents (file, NULL, &vcard, NULL, NULL, &error)) {
g_warning ("failed to read test contact file '%s': %s",
- filename, error->message);
- exit (1);
- }
+ filename, error->message);
+ exit (1);
+ }
- g_free (case_filename);
- g_free (filename);
- g_object_unref (file);
+ g_free (case_filename);
+ g_free (filename);
+ g_object_unref (file);
- return vcard;
+ return vcard;
}
gchar *
const gchar *case_name,
EContact **contact)
{
- gchar *vcard;
- EContact *contact_orig;
- EContact *contact_final;
- gchar *uid;
+ gchar *vcard;
+ EContact *contact_orig;
+ EContact *contact_final;
+ gchar *uid;
- vcard = ebook_test_utils_new_vcard_from_test_case (case_name);
- contact_orig = e_contact_new_from_vcard (vcard);
- uid = g_strdup (ebook_test_utils_book_add_contact (book, contact_orig));
- contact_final = ebook_test_utils_book_get_contact (book, uid);
+ vcard = ebook_test_utils_new_vcard_from_test_case (case_name);
+ contact_orig = e_contact_new_from_vcard (vcard);
+ uid = g_strdup (ebook_test_utils_book_add_contact (book, contact_orig));
+ contact_final = ebook_test_utils_book_get_contact (book, uid);
/* verify the contact was added "successfully" (not thorough) */
- g_assert (ebook_test_utils_contacts_are_equal_shallow (contact_orig, contact_final));
+ g_assert (ebook_test_utils_contacts_are_equal_shallow (contact_orig, contact_final));
- if (contact)
+ if (contact)
*contact = g_object_ref (contact_final);
- return uid;
+ return uid;
}
/* This is not a thorough comparison (which is difficult, assuming we give the
EContact *b)
{
- const gchar *uid_a, *uid_b;
+ const gchar *uid_a, *uid_b;
/* Avoid warnings if one or more are NULL, to make this function
* "NULL-friendly" */
- if (!a && !b)
- return TRUE;
- if (!E_IS_CONTACT (a) || !E_IS_CONTACT (b))
- return FALSE;
+ if (!a && !b)
+ return TRUE;
+ if (!E_IS_CONTACT (a) || !E_IS_CONTACT (b))
+ return FALSE;
- uid_a = e_contact_get_const (a, E_CONTACT_UID);
- uid_b = e_contact_get_const (b, E_CONTACT_UID);
+ uid_a = e_contact_get_const (a, E_CONTACT_UID);
+ uid_b = e_contact_get_const (b, E_CONTACT_UID);
- return g_strcmp0 (uid_a, uid_b) == 0;
+ return g_strcmp0 (uid_a, uid_b) == 0;
}
const gchar *
ebook_test_utils_book_add_contact (EBook *book,
EContact *contact)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_book_add_contact (book, contact, &error)) {
- const gchar *uri;
+ if (!e_book_add_contact (book, contact, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to add contact to addressbook: `%s': %s",
- uri, error->message);
- exit (1);
- }
+ uri, error->message);
+ exit (1);
+ }
- return e_contact_get_const (contact, E_CONTACT_UID);
+ return e_contact_get_const (contact, E_CONTACT_UID);
}
static void
const gchar *uid,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously add the contact '%s': "
"status %d (%s)", uid, error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully asynchronously added the contact "
"addressbook\n");
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_add_contact_async (book, contact,
- (EBookIdAsyncCallback) add_contact_cb, closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_add_contact_async (book, contact,
+ (EBookIdAsyncCallback) add_contact_cb, closure)) {
g_warning ("failed to set up contact add");
- exit (1);
- }
+ exit (1);
+ }
}
void
ebook_test_utils_book_commit_contact (EBook *book,
EContact *contact)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_book_commit_contact (book, contact, &error)) {
- const gchar *uid;
- const gchar *uri;
+ if (!e_book_commit_contact (book, contact, &error)) {
+ const gchar *uid;
+ const gchar *uri;
- uid = (const gchar *) e_contact_get_const (contact, E_CONTACT_UID);
- uri = e_book_get_uri (book);
+ uid = (const gchar *) e_contact_get_const (contact, E_CONTACT_UID);
+ uri = e_book_get_uri (book);
g_warning ("failed to commit changes to contact '%s' to addressbook: `%s': %s",
- uid, uri, error->message);
- exit (1);
- }
+ uid, uri, error->message);
+ exit (1);
+ }
}
static void
const GError *error,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously commit the contact: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully asynchronously committed the contact to the "
"addressbook\n");
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_commit_contact_async (book, contact,
- (EBookAsyncCallback) commit_contact_cb, closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_commit_contact_async (book, contact,
+ (EBookAsyncCallback) commit_contact_cb, closure)) {
g_warning ("failed to set up contact commit");
- exit (1);
- }
+ exit (1);
+ }
}
EContact*
ebook_test_utils_book_get_contact (EBook *book,
const gchar *uid)
{
- EContact *contact = NULL;
- GError *error = NULL;
+ EContact *contact = NULL;
+ GError *error = NULL;
- if (!e_book_get_contact (book, uid, &contact, &error)) {
- const gchar *uri;
+ if (!e_book_get_contact (book, uid, &contact, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to get contact '%s' in addressbook: `%s': "
"%s", uid, uri, error->message);
- exit (1);
- }
+ exit (1);
+ }
- return contact;
+ return contact;
}
static void
EContact *contact,
EBookTestClosure *closure)
{
- const gchar *uid;
+ const gchar *uid;
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously get the contact: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
- uid = e_contact_get_const (contact, E_CONTACT_UID);
+ uid = e_contact_get_const (contact, E_CONTACT_UID);
test_print ("successfully asynchronously retrieved the contact '%s'\n",
- uid);
+ uid);
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_get_contact_async (book, uid,
- (EBookContactAsyncCallback) get_contact_cb,
- closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_get_contact_async (book, uid,
+ (EBookContactAsyncCallback) get_contact_cb,
+ closure)) {
g_warning ("failed to set up async getContact");
- exit (1);
- }
+ exit (1);
+ }
}
GList*
ebook_test_utils_book_get_required_fields (EBook *book)
{
- GList *fields = NULL;
- GError *error = NULL;
+ GList *fields = NULL;
+ GError *error = NULL;
- if (!e_book_get_required_fields (book, &fields, &error)) {
- const gchar *uri;
+ if (!e_book_get_required_fields (book, &fields, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to get required fields for addressbook "
"`%s': %s", uri, error->message);
- exit (1);
- }
+ exit (1);
+ }
- return fields;
+ return fields;
}
static void
EList *fields,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously get the required fields: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
- closure->list = fields;
+ closure->list = fields;
test_print ("successfully asynchronously retrieved the required fields\n");
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_get_required_fields_async (book,
- (EBookEListAsyncCallback) get_required_fields_cb,
- closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_get_required_fields_async (book,
+ (EBookEListAsyncCallback) get_required_fields_cb,
+ closure)) {
g_warning ("failed to set up async getRequiredFields");
- exit (1);
- }
+ exit (1);
+ }
}
const gchar *
ebook_test_utils_book_get_static_capabilities (EBook *book)
{
- GError *error = NULL;
- const gchar *caps;
+ GError *error = NULL;
+ const gchar *caps;
- if (!(caps = e_book_get_static_capabilities (book, &error))) {
- const gchar *uri;
+ if (!(caps = e_book_get_static_capabilities (book, &error))) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to get capabilities for addressbook: `%s': "
"%s", uri, error->message);
- exit (1);
- }
+ exit (1);
+ }
- return caps;
+ return caps;
}
GList*
ebook_test_utils_book_get_supported_auth_methods (EBook *book)
{
- GList *fields = NULL;
- GError *error = NULL;
+ GList *fields = NULL;
+ GError *error = NULL;
- if (!e_book_get_supported_auth_methods (book, &fields, &error)) {
- const gchar *uri;
+ if (!e_book_get_supported_auth_methods (book, &fields, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to get supported auth methods for "
"addressbook `%s': %s", uri, error->message);
- exit (1);
- }
+ exit (1);
+ }
- return fields;
+ return fields;
}
static void
EList *methods,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously get the supported auth "
"methods: status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
- closure->list = methods;
+ closure->list = methods;
test_print ("successfully asynchronously retrieved the supported auth "
"methods\n");
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_get_supported_auth_methods_async (book,
- (EBookEListAsyncCallback) get_supported_auth_methods_cb,
- closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_get_supported_auth_methods_async (book,
+ (EBookEListAsyncCallback) get_supported_auth_methods_cb,
+ closure)) {
g_warning ("failed to set up async getSupportedAuthMethods");
- exit (1);
- }
+ exit (1);
+ }
}
GList*
ebook_test_utils_book_get_supported_fields (EBook *book)
{
- GList *fields = NULL;
- GError *error = NULL;
+ GList *fields = NULL;
+ GError *error = NULL;
- if (!e_book_get_supported_fields (book, &fields, &error)) {
- const gchar *uri;
+ if (!e_book_get_supported_fields (book, &fields, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to get supported fields for addressbook "
"`%s': %s", uri, error->message);
- exit (1);
- }
+ exit (1);
+ }
- return fields;
+ return fields;
}
static void
EList *fields,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously get the supported fields: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
- closure->list = fields;
+ closure->list = fields;
test_print ("successfully asynchronously retrieved the supported fields\n");
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_get_supported_fields_async (book,
- (EBookEListAsyncCallback) get_supported_fields_cb,
- closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_get_supported_fields_async (book,
+ (EBookEListAsyncCallback) get_supported_fields_cb,
+ closure)) {
g_warning ("failed to set up async getSupportedFields");
- exit (1);
- }
+ exit (1);
+ }
}
void
ebook_test_utils_book_remove_contact (EBook *book,
const gchar *uid)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_book_remove_contact (book, uid, &error)) {
- const gchar *uri;
+ if (!e_book_remove_contact (book, uid, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to remove contact '%s' from addressbook: `%s': %s",
- uid, uri, error->message);
- exit (1);
- }
+ uid, uri, error->message);
+ exit (1);
+ }
}
static void
const GError *error,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously remove the contact: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully asynchronously removed the contact\n");
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_remove_contact_async (book, contact,
- (EBookAsyncCallback) remove_contact_cb,
- closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_remove_contact_async (book, contact,
+ (EBookAsyncCallback) remove_contact_cb,
+ closure)) {
g_warning ("failed to set up async removeContacts (for a single contact)");
- exit (1);
- }
+ exit (1);
+ }
}
static void
const GError *error,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously remove the contact by id: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully asynchronously removed the contact by id\n");
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_remove_contact_by_id_async (book, uid,
- (EBookAsyncCallback) remove_contact_by_id_cb,
- closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_remove_contact_by_id_async (book, uid,
+ (EBookAsyncCallback) remove_contact_by_id_cb,
+ closure)) {
g_warning ("failed to set up async removeContacts (by id)");
- exit (1);
- }
+ exit (1);
+ }
}
void
ebook_test_utils_book_remove_contacts (EBook *book,
GList *ids)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_book_remove_contacts (book, ids, &error)) {
- const gchar *uri;
+ if (!e_book_remove_contacts (book, ids, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to remove contacts from addressbook: `%s': %s",
- uri, error->message);
- exit (1);
- }
+ uri, error->message);
+ exit (1);
+ }
}
static void
const GError *error,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously remove the contacts: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully asynchronously removed the contacts\n");
- if (closure) {
- (*closure->cb) (closure);
- g_free (closure);
- }
+ if (closure) {
+ (*closure->cb) (closure);
+ g_free (closure);
+ }
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_remove_contacts_async (book, uids,
- (EBookAsyncCallback) remove_contacts_cb,
- closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_remove_contacts_async (book, uids,
+ (EBookAsyncCallback) remove_contacts_cb,
+ closure)) {
g_warning ("failed to set up async removeContacts");
- exit (1);
- }
+ exit (1);
+ }
}
EBook*
ebook_test_utils_book_new_from_uri (const gchar *uri)
{
- EBook *book;
+ EBook *book;
GError *error = NULL;
test_print ("loading addressbook\n");
book = e_book_new_from_uri (uri, &error);
if (!book) {
g_error ("failed to create addressbook: `%s': %s", uri,
- error->message);
+ error->message);
}
return book;
EBook*
ebook_test_utils_book_new_temp (gchar **uri)
{
- EBook *book;
+ EBook *book;
gchar *file_template;
- gchar *uri_result;
+ gchar *uri_result;
- file_template = g_build_filename (g_get_tmp_dir (),
+ file_template = g_build_filename (g_get_tmp_dir (),
"ebook-test-XXXXXX/", NULL);
g_mkstemp (file_template);
book = ebook_test_utils_book_new_from_uri (uri_result);
- if (uri)
+ if (uri)
*uri = g_strdup (uri_result);
- g_free (uri_result);
+ g_free (uri_result);
- return book;
+ return book;
}
void
ebook_test_utils_book_open (EBook *book,
gboolean only_if_exists)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_book_open (book, only_if_exists, &error)) {
- const gchar *uri;
+ if (!e_book_open (book, only_if_exists, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to open addressbook: `%s': %s", uri,
- error->message);
- exit (1);
- }
+ error->message);
+ exit (1);
+ }
}
void
ebook_test_utils_book_remove (EBook *book)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_book_remove (book, &error)) {
+ if (!e_book_remove (book, &error)) {
g_warning ("failed to remove book; %s\n", error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully removed the temporary addressbook\n");
- g_object_unref (book);
+ g_object_unref (book);
}
static void
remove_cb (EBook *book, const GError *error, EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously remove the book: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully asynchronously removed the temporary "
"addressbook\n");
- if (closure)
- (*closure->cb) (closure);
+ if (closure)
+ (*closure->cb) (closure);
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_remove_async (book, (EBookAsyncCallback) remove_cb, closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_remove_async (book, (EBookAsyncCallback) remove_cb, closure)) {
g_warning ("failed to set up book removal");
- exit (1);
- }
+ exit (1);
+ }
}
void
EBookQuery *query,
EBookView **view)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_book_get_book_view (book, query, NULL, -1, view, &error)) {
- const gchar *uri;
+ if (!e_book_get_book_view (book, query, NULL, -1, view, &error)) {
+ const gchar *uri;
- uri = e_book_get_uri (book);
+ uri = e_book_get_uri (book);
g_warning ("failed to get view for addressbook: `%s': %s", uri,
- error->message);
- exit (1);
- }
+ error->message);
+ exit (1);
+ }
}
static void
EBookView *view,
EBookTestClosure *closure)
{
- if (error) {
+ if (error) {
g_warning ("failed to asynchronously get book view for the "
"book: status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
- closure->view = view;
+ closure->view = view;
test_print ("successfully asynchronously retrieved the book view\n");
- if (closure)
- (*closure->cb) (closure);
+ if (closure)
+ (*closure->cb) (closure);
}
void
GSourceFunc callback,
gpointer user_data)
{
- EBookTestClosure *closure;
+ EBookTestClosure *closure;
- closure = g_new0 (EBookTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
- if (!e_book_get_book_view_async (book, query, NULL, -1, (EBookBookViewAsyncCallback) get_book_view_cb, closure)) {
+ closure = g_new0 (EBookTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
+ if (!e_book_get_book_view_async (book, query, NULL, -1, (EBookBookViewAsyncCallback) get_book_view_cb, closure)) {
g_warning ("failed to set up book view retrieval");
- exit (1);
- }
+ exit (1);
+ }
}
g_type_init ();
book = ebook_test_utils_book_new_temp (&uri);
- ebook_test_utils_book_open (book, FALSE);
+ ebook_test_utils_book_open (book, FALSE);
/* get an initial change set */
if (!e_book_get_changes (book, "changeidtest", &changes, &error)) {
loop = g_main_loop_new (NULL, TRUE);
g_main_loop_run (loop);
- e_book_query_unref (query);
+ e_book_query_unref (query);
ebook_test_utils_book_remove (book);
/*
g_main_loop_run (loop);
- e_book_query_unref (query);
+ e_book_query_unref (query);
ebook_test_utils_book_remove (book);
return 0;
g_object_unref (closure->list);
- g_main_loop_quit ((GMainLoop*) (closure->user_data));
+ g_main_loop_quit ((GMainLoop*) (closure->user_data));
}
gint
gint
main (gint argc, gchar **argv)
{
- EBook *book;
- GMainLoop *loop;
- gchar *uid;
+ EBook *book;
+ GMainLoop *loop;
+ gchar *uid;
- g_type_init ();
+ g_type_init ();
/*
* Async version
*/
- book = ebook_test_utils_book_new_temp (NULL);
- ebook_test_utils_book_open (book, FALSE);
+ book = ebook_test_utils_book_new_temp (NULL);
+ ebook_test_utils_book_open (book, FALSE);
uid = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", NULL);
- loop = g_main_loop_new (NULL, TRUE);
- ebook_test_utils_book_async_remove_contact_by_id (book, uid,
+ loop = g_main_loop_new (NULL, TRUE);
+ ebook_test_utils_book_async_remove_contact_by_id (book, uid,
ebook_test_utils_callback_quit, loop);
- g_main_loop_run (loop);
+ g_main_loop_run (loop);
- ebook_test_utils_book_remove (book);
+ ebook_test_utils_book_remove (book);
g_free (uid);
- return 0;
+ return 0;
}
gint
main (gint argc, gchar **argv)
{
- EBook *book;
- GMainLoop *loop;
- EContact *contact_final;
- gchar *uid;
+ EBook *book;
+ GMainLoop *loop;
+ EContact *contact_final;
+ gchar *uid;
- g_type_init ();
+ g_type_init ();
/*
* Setup
*/
- book = ebook_test_utils_book_new_temp (NULL);
- ebook_test_utils_book_open (book, FALSE);
+ book = ebook_test_utils_book_new_temp (NULL);
+ ebook_test_utils_book_open (book, FALSE);
/*
* Sync version
*/
uid = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", NULL);
- ebook_test_utils_book_remove_contact (book, uid);
+ ebook_test_utils_book_remove_contact (book, uid);
contact_final = NULL;
e_book_get_contact (book, uid, &contact_final, NULL);
- g_assert (contact_final == NULL);
+ g_assert (contact_final == NULL);
test_print ("successfully added and removed contact '%s'\n", uid);
- ebook_test_utils_book_remove (book);
- g_free (uid);
+ ebook_test_utils_book_remove (book);
+ g_free (uid);
/*
* Async version
*/
- book = ebook_test_utils_book_new_temp (NULL);
- ebook_test_utils_book_open (book, FALSE);
+ book = ebook_test_utils_book_new_temp (NULL);
+ ebook_test_utils_book_open (book, FALSE);
contact_final = NULL;
/* contact_final has 2 refs by the end of this */
uid = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", &contact_final);
- loop = g_main_loop_new (NULL, TRUE);
+ loop = g_main_loop_new (NULL, TRUE);
/* contact_final is unref'd by e_book_remove_contact() here */
- ebook_test_utils_book_async_remove_contact (book, contact_final,
+ ebook_test_utils_book_async_remove_contact (book, contact_final,
ebook_test_utils_callback_quit, loop);
- g_main_loop_run (loop);
+ g_main_loop_run (loop);
- ebook_test_utils_book_remove (book);
+ ebook_test_utils_book_remove (book);
g_object_unref (contact_final);
g_free (uid);
- return 0;
+ return 0;
}
gint
main (gint argc, gchar **argv)
{
- EBook *book;
- GMainLoop *loop;
- EContact *contact_final;
- gchar *uid_1, *uid_2;
+ EBook *book;
+ GMainLoop *loop;
+ EContact *contact_final;
+ gchar *uid_1, *uid_2;
GList *uids = NULL;
- g_type_init ();
+ g_type_init ();
/*
* Setup
*/
- book = ebook_test_utils_book_new_temp (NULL);
- ebook_test_utils_book_open (book, FALSE);
+ book = ebook_test_utils_book_new_temp (NULL);
+ ebook_test_utils_book_open (book, FALSE);
/*
* Sync version
uid_2 = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-2", NULL);
uids = g_list_prepend (uids, uid_1);
uids = g_list_prepend (uids, uid_2);
- ebook_test_utils_book_remove_contacts (book, uids);
+ ebook_test_utils_book_remove_contacts (book, uids);
contact_final = NULL;
e_book_get_contact (book, uid_1, &contact_final, NULL);
- g_assert (contact_final == NULL);
+ g_assert (contact_final == NULL);
e_book_get_contact (book, uid_2, &contact_final, NULL);
- g_assert (contact_final == NULL);
+ g_assert (contact_final == NULL);
test_print ("successfully added and removed contacts\n");
- ebook_test_utils_book_remove (book);
- g_free (uid_1);
- g_free (uid_2);
+ ebook_test_utils_book_remove (book);
+ g_free (uid_1);
+ g_free (uid_2);
g_list_free (uids);
/*
* Async version
*/
- book = ebook_test_utils_book_new_temp (NULL);
- ebook_test_utils_book_open (book, FALSE);
+ book = ebook_test_utils_book_new_temp (NULL);
+ ebook_test_utils_book_open (book, FALSE);
uid_1 = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-1", NULL);
uid_2 = ebook_test_utils_book_add_contact_from_test_case_verify (book, "simple-2", NULL);
uids = g_list_prepend (uids, uid_1);
uids = g_list_prepend (uids, uid_2);
- loop = g_main_loop_new (NULL, TRUE);
- ebook_test_utils_book_async_remove_contacts (book, uids,
+ loop = g_main_loop_new (NULL, TRUE);
+ ebook_test_utils_book_async_remove_contacts (book, uids,
ebook_test_utils_callback_quit, loop);
- g_main_loop_run (loop);
+ g_main_loop_run (loop);
- ebook_test_utils_book_remove (book);
- g_free (uid_1);
- g_free (uid_2);
+ ebook_test_utils_book_remove (book);
+ g_free (uid_1);
+ g_free (uid_2);
g_list_free (uids);
- return 0;
+ return 0;
}
exit (0);
}
- ebook_test_utils_book_open (book, FALSE);
+ ebook_test_utils_book_open (book, FALSE);
printf ("printing one contact\n");
print_one_email (book);
static BookRecord *
book_record_new (ECalBackendContacts *cbc, ESource *source)
{
- EBook *book;
- GList *fields = NULL;
- EBookQuery *query;
- EBookView *book_view;
- BookRecord *br;
+ EBook *book;
+ GList *fields = NULL;
+ EBookQuery *query;
+ EBookView *book_view;
+ BookRecord *br;
GError *error = NULL;
book = e_book_new (source, &error);
- if (!book || !e_book_open (book, TRUE, &error) || error) {
+ if (!book || !e_book_open (book, TRUE, &error) || error) {
g_warning ("%s: Failed to open book '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
if (book)
g_object_unref (book);
}
/* Create book view */
- fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FILE_AS));
- fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_BIRTH_DATE));
- fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_ANNIVERSARY));
+ fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_FILE_AS));
+ fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_BIRTH_DATE));
+ fields = g_list_append (fields, (gchar *)e_contact_field_name (E_CONTACT_ANNIVERSARY));
query = e_book_query_any_field_contains ("");
- if (!e_book_get_book_view (book, query, fields, -1, &book_view, &error)) {
+ if (!e_book_get_book_view (book, query, fields, -1, &book_view, &error)) {
g_warning ("%s: Failed to get book view on '%s': %s", G_STRFUNC, e_source_peek_name (source), error ? error->message : "Unknown error");
- e_book_query_unref (query);
- g_object_unref (book);
- g_list_free (fields);
+ e_book_query_unref (query);
+ g_object_unref (book);
+ g_list_free (fields);
if (error)
g_error_free (error);
- return NULL;
- }
- e_book_query_unref (query);
+ return NULL;
+ }
+ e_book_query_unref (query);
g_list_free (fields);
g_signal_connect (book_view, "contacts_added", G_CALLBACK (contacts_added_cb), cbc);
g_signal_connect (book_view, "contacts_removed", G_CALLBACK (contacts_removed_cb), cbc);
g_signal_connect (book_view, "contacts_changed", G_CALLBACK (contacts_changed_cb), cbc);
- e_book_view_start (book_view);
+ e_book_view_start (book_view);
- br = g_new (BookRecord, 1);
+ br = g_new (BookRecord, 1);
br->cbc = cbc;
- br->book = book;
- br->book_view = book_view;
+ br->book = book;
+ br->book_view = book_view;
- return br;
+ return br;
}
static gboolean
static void
book_record_free (BookRecord *br)
{
- if (!br)
- return;
+ if (!br)
+ return;
g_hash_table_foreach_remove (br->cbc->priv->tracked_contacts, remove_by_book, br->book);
- g_object_unref (br->book_view);
- g_object_unref (br->book);
+ g_object_unref (br->book_view);
+ g_object_unref (br->book);
- g_free (br);
+ g_free (br);
}
/* ContactRecord methods */
static ContactRecord *
contact_record_new (ECalBackendContacts *cbc, EBook *book, EContact *contact)
{
- ContactRecord *cr = g_new0 (ContactRecord, 1);
+ ContactRecord *cr = g_new0 (ContactRecord, 1);
gchar *comp_str;
- cr->cbc = cbc;
+ cr->cbc = cbc;
cr->book = book;
- cr->contact = contact;
- cr->comp_birthday = create_birthday (cbc, contact);
- cr->comp_anniversary = create_anniversary (cbc, contact);
+ cr->contact = contact;
+ cr->comp_birthday = create_birthday (cbc, contact);
+ cr->comp_anniversary = create_anniversary (cbc, contact);
if (cr->comp_birthday) {
comp_str = e_cal_component_get_as_string (cr->comp_birthday);
g_free (comp_str);
}
- g_object_ref (G_OBJECT (contact));
+ g_object_ref (G_OBJECT (contact));
- return cr;
+ return cr;
}
static void
contact_record_free (ContactRecord *cr)
{
- gchar *comp_str;
+ gchar *comp_str;
ECalComponentId *id;
- g_object_unref (G_OBJECT (cr->contact));
+ g_object_unref (G_OBJECT (cr->contact));
/* Remove the birthday event */
if (cr->comp_birthday) {
g_object_unref (G_OBJECT (cr->comp_anniversary));
}
- g_free (cr);
+ g_free (cr);
}
/* ContactRecordCB methods */
static ContactRecordCB *
contact_record_cb_new (ECalBackendContacts *cbc, ECalBackendSExp *sexp)
{
- ContactRecordCB *cb_data = g_new (ContactRecordCB, 1);
+ ContactRecordCB *cb_data = g_new (ContactRecordCB, 1);
- cb_data->cbc = cbc;
- cb_data->sexp = sexp;
- cb_data->result = NULL;
+ cb_data->cbc = cbc;
+ cb_data->sexp = sexp;
+ cb_data->result = NULL;
- return cb_data;
+ return cb_data;
}
static void
contact_record_cb_free (ContactRecordCB *cb_data)
{
- g_list_foreach (cb_data->result, (GFunc) g_free, NULL);
- g_list_free (cb_data->result);
+ g_list_foreach (cb_data->result, (GFunc) g_free, NULL);
+ g_list_free (cb_data->result);
- g_free (cb_data);
+ g_free (cb_data);
}
static void
contact_record_cb (gpointer key, gpointer value, gpointer user_data)
{
- ContactRecordCB *cb_data = user_data;
- ContactRecord *record = value;
-
- if (record->comp_birthday && e_cal_backend_sexp_match_comp (cb_data->sexp, record->comp_birthday, E_CAL_BACKEND (cb_data->cbc))) {
- gchar * comp_str = e_cal_component_get_as_string (record->comp_birthday);
- cb_data->result = g_list_append (cb_data->result, comp_str);
- }
-
- if (record->comp_anniversary && e_cal_backend_sexp_match_comp (cb_data->sexp, record->comp_anniversary, E_CAL_BACKEND (cb_data->cbc))) {
- gchar * comp_str = e_cal_component_get_as_string (record->comp_anniversary);
- cb_data->result = g_list_append (cb_data->result, comp_str);
- }
+ ContactRecordCB *cb_data = user_data;
+ ContactRecord *record = value;
+
+ if (record->comp_birthday && e_cal_backend_sexp_match_comp (cb_data->sexp, record->comp_birthday, E_CAL_BACKEND (cb_data->cbc))) {
+ gchar * comp_str = e_cal_component_get_as_string (record->comp_birthday);
+ cb_data->result = g_list_append (cb_data->result, comp_str);
+ }
+
+ if (record->comp_anniversary && e_cal_backend_sexp_match_comp (cb_data->sexp, record->comp_anniversary, E_CAL_BACKEND (cb_data->cbc))) {
+ gchar * comp_str = e_cal_component_get_as_string (record->comp_anniversary);
+ cb_data->result = g_list_append (cb_data->result, comp_str);
+ }
}
static gboolean
const gchar *base_uri;
const gchar *prop;
- base_uri = e_source_group_peek_base_uri (group);
- if (!base_uri)
- return FALSE;
+ base_uri = e_source_group_peek_base_uri (group);
+ if (!base_uri)
+ return FALSE;
prop = e_source_get_property (source, "use-in-contacts-calendar");
static void
add_source (ECalBackendContacts *cbc, ESource *source)
{
- BookRecord *br = book_record_new (cbc, source);
- const gchar *uid = e_source_peek_uid (source);
+ BookRecord *br = book_record_new (cbc, source);
+ const gchar *uid = e_source_peek_uid (source);
if (!br)
return;
- g_hash_table_insert (cbc->priv->addressbooks, g_strdup (uid), br);
+ g_hash_table_insert (cbc->priv->addressbooks, g_strdup (uid), br);
}
static void
source_added_cb (ESourceGroup *group, ESource *source, gpointer user_data)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
- g_return_if_fail (cbc);
+ g_return_if_fail (cbc);
if (is_source_usable (source, group))
add_source (cbc, source);
static void
source_removed_cb (ESourceGroup *group, ESource *source, gpointer user_data)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
- const gchar *uid = e_source_peek_uid (source);
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
+ const gchar *uid = e_source_peek_uid (source);
- g_return_if_fail (cbc);
+ g_return_if_fail (cbc);
- g_hash_table_remove (cbc->priv->addressbooks, uid);
+ g_hash_table_remove (cbc->priv->addressbooks, uid);
}
static void
source_list_changed_cb (ESourceList *source_list, gpointer user_data)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
- GSList *g, *s;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
+ GSList *g, *s;
- g_return_if_fail (cbc);
+ g_return_if_fail (cbc);
for (g = e_source_list_peek_groups (source_list); g; g = g->next) {
ESourceGroup *group = E_SOURCE_GROUP (g->data);
static void
source_group_added_cb (ESourceList *source_list, ESourceGroup *group, gpointer user_data)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
- GSList *i;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
+ GSList *i;
- g_return_if_fail (cbc);
+ g_return_if_fail (cbc);
for (i = e_source_group_peek_sources (group); i; i = i->next) {
ESource *source = E_SOURCE (i->data);
static void
source_group_removed_cb (ESourceList *source_list, ESourceGroup *group, gpointer user_data)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
- GSList *i = NULL;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
+ GSList *i = NULL;
- g_return_if_fail (cbc);
+ g_return_if_fail (cbc);
/* Unload all address books from this group */
- for (i = e_source_group_peek_sources (group); i; i = i->next) {
- ESource *source = E_SOURCE (i->data);
- const gchar *uid = e_source_peek_uid (source);
+ for (i = e_source_group_peek_sources (group); i; i = i->next) {
+ ESource *source = E_SOURCE (i->data);
+ const gchar *uid = e_source_peek_uid (source);
- g_hash_table_remove (cbc->priv->addressbooks, uid);
- }
+ g_hash_table_remove (cbc->priv->addressbooks, uid);
+ }
}
/************************************************************************************/
static void
contacts_changed_cb (EBookView *book_view, const GList *contacts, gpointer user_data)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
EBook *book = e_book_view_get_book (book_view);
- const GList *i;
+ const GList *i;
- for (i = contacts; i; i = i->next) {
- EContact *contact = E_CONTACT (i->data);
- const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID);
- EContactDate *birthday, *anniversary;
+ for (i = contacts; i; i = i->next) {
+ EContact *contact = E_CONTACT (i->data);
+ const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID);
+ EContactDate *birthday, *anniversary;
/* Because this is a change of contact, then always remove old tracked data
and if possible, add with (possibly) new values.
*/
g_hash_table_remove (cbc->priv->tracked_contacts, (gchar *)uid);
- birthday = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
- anniversary = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
+ birthday = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
+ anniversary = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
- if (birthday || anniversary) {
- ContactRecord *cr = contact_record_new (cbc, book, contact);
- g_hash_table_insert (cbc->priv->tracked_contacts, g_strdup (uid), cr);
- }
+ if (birthday || anniversary) {
+ ContactRecord *cr = contact_record_new (cbc, book, contact);
+ g_hash_table_insert (cbc->priv->tracked_contacts, g_strdup (uid), cr);
+ }
- e_contact_date_free (birthday);
- e_contact_date_free (anniversary);
- }
+ e_contact_date_free (birthday);
+ e_contact_date_free (anniversary);
+ }
}
static void
contacts_added_cb (EBookView *book_view, const GList *contacts, gpointer user_data)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
EBook *book = e_book_view_get_book (book_view);
- const GList *i;
+ const GList *i;
/* See if any new contacts have BIRTHDAY or ANNIVERSARY fields */
- for (i = contacts; i; i = i->next)
- {
- EContact *contact = E_CONTACT (i->data);
- EContactDate *birthday, *anniversary;
+ for (i = contacts; i; i = i->next)
+ {
+ EContact *contact = E_CONTACT (i->data);
+ EContactDate *birthday, *anniversary;
- birthday = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
- anniversary = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
+ birthday = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
+ anniversary = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
- if (birthday || anniversary) {
- ContactRecord *cr = contact_record_new (cbc, book, contact);
- const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID);
+ if (birthday || anniversary) {
+ ContactRecord *cr = contact_record_new (cbc, book, contact);
+ const gchar *uid = e_contact_get_const (contact, E_CONTACT_UID);
- g_hash_table_insert (cbc->priv->tracked_contacts, g_strdup (uid), cr);
- }
+ g_hash_table_insert (cbc->priv->tracked_contacts, g_strdup (uid), cr);
+ }
- e_contact_date_free (birthday);
- e_contact_date_free (anniversary);
- }
+ e_contact_date_free (birthday);
+ e_contact_date_free (anniversary);
+ }
}
static void
contacts_removed_cb (EBookView *book_view, const GList *contact_ids, gpointer user_data)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
- const GList *i;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (user_data);
+ const GList *i;
/* Stop tracking these */
- for (i = contact_ids; i; i = i->next)
- g_hash_table_remove (cbc->priv->tracked_contacts, i->data);
+ for (i = contact_ids; i; i = i->next)
+ g_hash_table_remove (cbc->priv->tracked_contacts, i->data);
}
/************************************************************************************/
update_alarm_cb (gpointer key, gpointer value, gpointer user_data)
{
ECalBackendContacts *cbc = user_data;
- ContactRecord *record = value;
+ ContactRecord *record = value;
g_return_if_fail (cbc != NULL);
g_return_if_fail (record != NULL);
- if (record->comp_birthday)
+ if (record->comp_birthday)
manage_comp_alarm_update (cbc, record->comp_birthday);
- if (record->comp_anniversary)
- manage_comp_alarm_update (cbc, record->comp_anniversary);
+ if (record->comp_anniversary)
+ manage_comp_alarm_update (cbc, record->comp_anniversary);
}
static gboolean
static ECalComponent *
create_component (ECalBackendContacts *cbc, const gchar *uid, EContactDate *cdate, const gchar *summary)
{
- ECalComponent *cal_comp;
+ ECalComponent *cal_comp;
ECalComponentText comp_summary;
- icalcomponent *ical_comp;
- struct icaltimetype itt;
- ECalComponentDateTime dt;
+ icalcomponent *ical_comp;
+ struct icaltimetype itt;
+ ECalComponentDateTime dt;
struct icalrecurrencetype r;
- GSList recur_list;
+ GSList recur_list;
- g_return_val_if_fail (E_IS_CAL_BACKEND_CONTACTS (cbc), NULL);
+ g_return_val_if_fail (E_IS_CAL_BACKEND_CONTACTS (cbc), NULL);
- if (!cdate)
- return NULL;
+ if (!cdate)
+ return NULL;
- ical_comp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
+ ical_comp = icalcomponent_new (ICAL_VEVENT_COMPONENT);
/* Create the event object */
- cal_comp = e_cal_component_new ();
+ cal_comp = e_cal_component_new ();
e_cal_component_set_icalcomponent (cal_comp, ical_comp);
/* Set uid */
e_cal_component_set_uid (cal_comp, uid);
/* Set all-day event's date from contact data */
- itt = cdate_to_icaltime (cdate);
- dt.value = &itt;
- dt.tzid = NULL;
- e_cal_component_set_dtstart (cal_comp, &dt);
+ itt = cdate_to_icaltime (cdate);
+ dt.value = &itt;
+ dt.tzid = NULL;
+ e_cal_component_set_dtstart (cal_comp, &dt);
itt = cdate_to_icaltime (cdate);
icaltime_adjust (&itt, 1, 0, 0, 0);
e_cal_component_set_dtend (cal_comp, &dt);
/* Create yearly recurrence */
- icalrecurrencetype_clear (&r);
- r.freq = ICAL_YEARLY_RECURRENCE;
+ icalrecurrencetype_clear (&r);
+ r.freq = ICAL_YEARLY_RECURRENCE;
r.interval = 1;
- recur_list.data = &r;
- recur_list.next = NULL;
- e_cal_component_set_rrule_list (cal_comp, &recur_list);
+ recur_list.data = &r;
+ recur_list.next = NULL;
+ e_cal_component_set_rrule_list (cal_comp, &recur_list);
/* Create summary */
- comp_summary.value = summary;
- comp_summary.altrep = NULL;
- e_cal_component_set_summary (cal_comp, &comp_summary);
+ comp_summary.value = summary;
+ comp_summary.altrep = NULL;
+ e_cal_component_set_summary (cal_comp, &comp_summary);
/* Set category and visibility */
if (g_str_has_suffix (uid, ANNIVERSARY_UID_EXT))
/* Don't forget to call commit()! */
e_cal_component_commit_sequence (cal_comp);
- return cal_comp;
+ return cal_comp;
}
static ECalComponent *
create_birthday (ECalBackendContacts *cbc, EContact *contact)
{
- EContactDate *cdate;
- ECalComponent *cal_comp;
+ EContactDate *cdate;
+ ECalComponent *cal_comp;
gchar *summary;
- const gchar *name;
- gchar *uid;
+ const gchar *name;
+ gchar *uid;
- cdate = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
- name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
+ cdate = e_contact_get (contact, E_CONTACT_BIRTH_DATE);
+ name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
uid = g_strdup_printf ("%s%s", (gchar *) e_contact_get_const (contact, E_CONTACT_UID), BIRTHDAY_UID_EXT);
summary = g_strdup_printf (_("Birthday: %s"), name);
- cal_comp = create_component (cbc, uid, cdate, summary);
+ cal_comp = create_component (cbc, uid, cdate, summary);
- e_contact_date_free (cdate);
- g_free (uid);
- g_free (summary);
+ e_contact_date_free (cdate);
+ g_free (uid);
+ g_free (summary);
- return cal_comp;
+ return cal_comp;
}
static ECalComponent *
create_anniversary (ECalBackendContacts *cbc, EContact *contact)
{
- EContactDate *cdate;
- ECalComponent *cal_comp;
+ EContactDate *cdate;
+ ECalComponent *cal_comp;
gchar *summary;
- const gchar *name;
- gchar *uid;
+ const gchar *name;
+ gchar *uid;
- cdate = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
- name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
+ cdate = e_contact_get (contact, E_CONTACT_ANNIVERSARY);
+ name = e_contact_get_const (contact, E_CONTACT_FILE_AS);
uid = g_strdup_printf ("%s%s", (gchar *) e_contact_get_const (contact, E_CONTACT_UID), ANNIVERSARY_UID_EXT);
summary = g_strdup_printf (_("Anniversary: %s"), name);
- cal_comp = create_component (cbc, uid, cdate, summary);
+ cal_comp = create_component (cbc, uid, cdate, summary);
- e_contact_date_free (cdate);
- g_free (uid);
- g_free (summary);
+ e_contact_date_free (cdate);
+ g_free (uid);
+ g_free (summary);
- return cal_comp;
+ return cal_comp;
}
/************************************************************************************/
const gchar *uid, const gchar *rid,
gchar **object, GError **perror)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
- ECalBackendContactsPrivate *priv = cbc->priv;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
+ ECalBackendContactsPrivate *priv = cbc->priv;
ContactRecord *record;
gchar *real_uid;
return;
}
- if (record->comp_birthday && g_str_has_suffix (uid, BIRTHDAY_UID_EXT)) {
+ if (record->comp_birthday && g_str_has_suffix (uid, BIRTHDAY_UID_EXT)) {
*object = e_cal_component_get_as_string (record->comp_birthday);
d(g_message ("Return birthday: %s", *object));
return;
}
- if (record->comp_anniversary && g_str_has_suffix (uid, ANNIVERSARY_UID_EXT)) {
+ if (record->comp_anniversary && g_str_has_suffix (uid, ANNIVERSARY_UID_EXT)) {
*object = e_cal_component_get_as_string (record->comp_anniversary);
d(g_message ("Return anniversary: %s", *object));
return;
- }
+ }
d(g_message ("Returning nothing for uid: %s", uid));
static gpointer
init_sources_cb (ECalBackendContacts *cbc)
{
- ECalBackendContactsPrivate *priv;
- GSList *i;
+ ECalBackendContactsPrivate *priv;
+ GSList *i;
g_return_val_if_fail (cbc != NULL, NULL);
priv = cbc->priv;
/* Create address books for existing sources */
- for (i = e_source_list_peek_groups (priv->addressbook_sources); i; i = i->next) {
- ESourceGroup *source_group = E_SOURCE_GROUP (i->data);
+ for (i = e_source_list_peek_groups (priv->addressbook_sources); i; i = i->next) {
+ ESourceGroup *source_group = E_SOURCE_GROUP (i->data);
- source_group_added_cb (priv->addressbook_sources, source_group, cbc);
- }
+ source_group_added_cb (priv->addressbook_sources, source_group, cbc);
+ }
/* Listen for source list changes */
g_signal_connect (priv->addressbook_sources, "changed", G_CALLBACK (source_list_changed_cb), cbc);
gboolean only_if_exists,
const gchar *username, const gchar *password, GError **perror)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
- ECalBackendContactsPrivate *priv = cbc->priv;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
+ ECalBackendContactsPrivate *priv = cbc->priv;
GError *error = NULL;
- if (priv->addressbook_loaded)
- return;
+ if (priv->addressbook_loaded)
+ return;
- if (priv->default_zone && priv->default_zone != icaltimezone_get_utc_timezone ()) {
+ if (priv->default_zone && priv->default_zone != icaltimezone_get_utc_timezone ()) {
icalcomponent *icalcomp = icaltimezone_get_component (priv->default_zone);
icaltimezone *zone = icaltimezone_new ();
return;
}
- priv->addressbook_loaded = TRUE;
+ priv->addressbook_loaded = TRUE;
}
static gboolean
e_cal_backend_contacts_is_loaded (ECalBackend *backend)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
- ECalBackendContactsPrivate *priv = cbc->priv;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
+ ECalBackendContactsPrivate *priv = cbc->priv;
- return priv->addressbook_loaded;
+ return priv->addressbook_loaded;
}
/* Add_timezone handler for the file backend */
e_cal_backend_contacts_get_object_list (ECalBackendSync *backend, EDataCal *cal,
const gchar *sexp_string, GList **objects, GError **perror)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
- ECalBackendContactsPrivate *priv = cbc->priv;
- ECalBackendSExp *sexp = e_cal_backend_sexp_new (sexp_string);
- ContactRecordCB *cb_data;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
+ ECalBackendContactsPrivate *priv = cbc->priv;
+ ECalBackendSExp *sexp = e_cal_backend_sexp_new (sexp_string);
+ ContactRecordCB *cb_data;
if (!sexp) {
g_propagate_error (perror, EDC_ERROR (InvalidQuery));
}
cb_data = contact_record_cb_new (cbc, sexp);
- g_hash_table_foreach (priv->tracked_contacts, contact_record_cb, cb_data);
+ g_hash_table_foreach (priv->tracked_contacts, contact_record_cb, cb_data);
*objects = cb_data->result;
/* Don't call cb_data_free as that would destroy the results
static void
e_cal_backend_contacts_start_query (ECalBackend *backend, EDataCalView *query)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
- ECalBackendContactsPrivate *priv = cbc->priv;
- ECalBackendSExp *sexp;
- ContactRecordCB *cb_data;
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
+ ECalBackendContactsPrivate *priv = cbc->priv;
+ ECalBackendSExp *sexp;
+ ContactRecordCB *cb_data;
- sexp = e_data_cal_view_get_object_sexp (query);
+ sexp = e_data_cal_view_get_object_sexp (query);
if (!sexp) {
GError *error = EDC_ERROR (InvalidQuery);
e_data_cal_view_notify_done (query, error);
return;
}
- cb_data = contact_record_cb_new (cbc, sexp);
+ cb_data = contact_record_cb_new (cbc, sexp);
- g_hash_table_foreach (priv->tracked_contacts, contact_record_cb, cb_data);
- e_data_cal_view_notify_objects_added (query, cb_data->result);
+ g_hash_table_foreach (priv->tracked_contacts, contact_record_cb, cb_data);
+ e_data_cal_view_notify_objects_added (query, cb_data->result);
- contact_record_cb_free (cb_data);
+ contact_record_cb_free (cb_data);
e_data_cal_view_notify_done (query, NULL /* Success */);
}
static icaltimezone *
e_cal_backend_contacts_internal_get_default_timezone (ECalBackend *backend)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
return cbc->priv->default_zone;
}
static icaltimezone *
e_cal_backend_contacts_internal_get_timezone (ECalBackend *backend, const gchar *tzid)
{
- ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
+ ECalBackendContacts *cbc = E_CAL_BACKEND_CONTACTS (backend);
- return cbc->priv->default_zone;
+ return cbc->priv->default_zone;
}
/***********************************************************************************
priv->default_zone = NULL;
g_object_unref (priv->addressbook_sources);
g_hash_table_destroy (priv->addressbooks);
- g_hash_table_destroy (priv->tracked_contacts);
- g_hash_table_destroy (priv->zones);
+ g_hash_table_destroy (priv->tracked_contacts);
+ g_hash_table_destroy (priv->zones);
if (priv->notifyid1)
gconf_client_notify_remove (priv->conf_client, priv->notifyid1);
if (priv->notifyid2)
e_book_get_addressbooks (&priv->addressbook_sources, NULL);
- priv->addressbooks = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, (GDestroyNotify) book_record_free);
- priv->tracked_contacts = g_hash_table_new_full (g_str_hash, g_str_equal,
- g_free, (GDestroyNotify)contact_record_free);
+ priv->addressbooks = g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, (GDestroyNotify) book_record_free);
+ priv->tracked_contacts = g_hash_table_new_full (g_str_hash, g_str_equal,
+ g_free, (GDestroyNotify)contact_record_free);
priv->zones = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, free_zone);
priv->default_zone = icaltimezone_get_utc_timezone ();
static void
e_cal_backend_contacts_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid, GError **perror)
{
- ECalBackendContacts *cbcontacts;
- ECalBackendContactsPrivate *priv;
+ ECalBackendContacts *cbcontacts;
+ ECalBackendContactsPrivate *priv;
- cbcontacts = E_CAL_BACKEND_CONTACTS (backend);
- priv = cbcontacts->priv;
+ cbcontacts = E_CAL_BACKEND_CONTACTS (backend);
+ priv = cbcontacts->priv;
- g_propagate_error (perror, EDC_ERROR (PermissionDenied));
+ g_propagate_error (perror, EDC_ERROR (PermissionDenied));
}
/* Class initialization function for the contacts backend */
icalcomponent *vcalendar_comp = user_data;
icaltimezone* zone;
- if (!tzid || !tzid[0])
- return NULL;
+ if (!tzid || !tzid[0])
+ return NULL;
else if (!strcmp (tzid, "UTC"))
- return icaltimezone_get_utc_timezone ();
+ return icaltimezone_get_utc_timezone ();
zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
get_rid_icaltime (ECalComponent *comp)
{
ECalComponentRange range;
- struct icaltimetype tt;
+ struct icaltimetype tt;
- e_cal_component_get_recurid (comp, &range);
- if (!range.datetime.value)
- return icaltime_null_time ();
- tt = *range.datetime.value;
- e_cal_component_free_range (&range);
+ e_cal_component_get_recurid (comp, &range);
+ if (!range.datetime.value)
+ return icaltime_null_time ();
+ tt = *range.datetime.value;
+ e_cal_component_free_range (&range);
- return tt;
+ return tt;
}
/* Adds component to the interval tree
cbfile = E_CAL_BACKEND_FILE (backend);
priv = cbfile->priv;
- g_static_rec_mutex_lock (&priv->idle_save_rmutex);
+ g_static_rec_mutex_lock (&priv->idle_save_rmutex);
/* Claim a succesful open if we are already open */
if (priv->path && priv->comp_uid_hash) {
/* Success */
goto done;
- }
+ }
str_uri = get_uri_string (E_CAL_BACKEND (backend));
if (!str_uri) {
err = EDC_ERROR_NO_URI ();
goto done;
- }
+ }
priv->read_only = FALSE;
if (g_access (str_uri, R_OK) == 0) {
g_free (str_uri);
done:
- g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
+ g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
if (err)
g_propagate_error (perror, err);
ECalBackendFile *cbfile;
ECalBackendFilePrivate *priv;
gchar *str_uri = NULL, *dirname = NULL;
- gchar *full_path = NULL;
+ gchar *full_path = NULL;
const gchar *fname;
GDir *dir = NULL;
GError *error = NULL, *err = NULL;
cbfile = E_CAL_BACKEND_FILE (backend);
priv = cbfile->priv;
- g_static_rec_mutex_lock (&priv->idle_save_rmutex);
+ g_static_rec_mutex_lock (&priv->idle_save_rmutex);
str_uri = get_uri_string (E_CAL_BACKEND (backend));
if (!str_uri) {
err = EDC_ERROR_NO_URI ();
- goto done;
- }
+ goto done;
+ }
if (g_access (str_uri, W_OK) != 0) {
err = EDC_ERROR (PermissionDenied);
- goto done;
+ goto done;
}
/* remove all files in the directory */
dir = g_dir_open (dirname, 0, &error);
if (!dir) {
err = e_data_cal_create_error (PermissionDenied, error ? error->message : NULL);
- goto done;
+ goto done;
}
while ((fname = g_dir_read_name (dir))) {
full_path = g_build_filename (dirname, fname, NULL);
if (g_unlink (full_path) != 0) {
err = EDC_ERROR (OtherError);
- goto done;
+ goto done;
}
g_free (full_path);
- full_path = NULL;
+ full_path = NULL;
}
/* remove the directory itself */
if (g_rmdir (dirname) != 0) {
err = EDC_ERROR (OtherError);
- }
+ }
done:
- if (dir) {
- g_dir_close (dir);
- }
+ if (dir) {
+ g_dir_close (dir);
+ }
g_free (str_uri);
g_free (dirname);
- g_free (full_path);
+ g_free (full_path);
- g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
+ g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
/* lie here a bit, but otherwise the calendar will not be removed, even it should */
if (err) {
g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
g_propagate_error (error, EDC_ERROR (ObjectNotFound));
return;
- }
+ }
*object = icalcomponent_as_ical_string_r (icalcomp);
g_list_free (del_comps);
/* check and patch timezones */
- if (!err) {
- if (!e_cal_check_timezones (toplevel_comp,
- NULL,
- e_cal_tzlookup_icomp,
- priv->icalcomp,
- &err)) {
+ if (!err) {
+ if (!e_cal_check_timezones (toplevel_comp,
+ NULL,
+ e_cal_tzlookup_icomp,
+ priv->icalcomp,
+ &err)) {
/*
* This makes assumptions about what kind of
* errors can occur inside e_cal_check_timezones().
* is the code really identical with the calendar
* status?
*/
- goto error;
- }
- }
+ goto error;
+ }
+ }
/* Merge the iCalendar components with our existing VCALENDAR,
resolving any conflicting TZIDs. */
g_return_if_fail (file_name != NULL);
priv = cbfile->priv;
- g_static_rec_mutex_lock (&priv->idle_save_rmutex);
+ g_static_rec_mutex_lock (&priv->idle_save_rmutex);
if (priv->file_name)
g_free (priv->file_name);
priv->file_name = g_strdup (file_name);
- g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
+ g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
}
const gchar *
GError *err = NULL;
priv = cbfile->priv;
- g_static_rec_mutex_lock (&priv->idle_save_rmutex);
+ g_static_rec_mutex_lock (&priv->idle_save_rmutex);
str_uri = get_uri_string (E_CAL_BACKEND (cbfile));
if (!str_uri) {
err = EDC_ERROR_NO_URI ();
- goto done;
- }
+ goto done;
+ }
if (g_access (str_uri, R_OK) == 0) {
reload_cal (cbfile, str_uri, &err);
priv->read_only = TRUE;
}
done:
- g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
+ g_static_rec_mutex_unlock (&priv->idle_save_rmutex);
if (err)
g_propagate_error (perror, err);
g_return_if_fail (categories_by_id != NULL || categories_by_name != NULL || cnc != NULL);
for (; category_names != NULL; category_names = g_slist_next (category_names)) {
- if (!category_names->data || strlen (category_names->data) == 0 )
- continue;
- id = g_hash_table_lookup (categories_by_name, category_names->data);
- if (id)
- category_ids = g_list_append (category_ids, g_strdup (id));
- else {
- EGwItem *category_item;
- category_item = e_gw_item_new_empty ();
- e_gw_item_set_item_type (category_item, E_GW_ITEM_TYPE_CATEGORY);
- e_gw_item_set_category_name (category_item, category_names->data);
- status = e_gw_connection_create_item (cnc, category_item, &id);
- if (status == E_GW_CONNECTION_STATUS_OK && id != NULL) {
+ if (!category_names->data || strlen (category_names->data) == 0 )
+ continue;
+ id = g_hash_table_lookup (categories_by_name, category_names->data);
+ if (id)
+ category_ids = g_list_append (category_ids, g_strdup (id));
+ else {
+ EGwItem *category_item;
+ category_item = e_gw_item_new_empty ();
+ e_gw_item_set_item_type (category_item, E_GW_ITEM_TYPE_CATEGORY);
+ e_gw_item_set_category_name (category_item, category_names->data);
+ status = e_gw_connection_create_item (cnc, category_item, &id);
+ if (status == E_GW_CONNECTION_STATUS_OK && id != NULL) {
gchar **components = g_strsplit (id, "@", -1);
- gchar *temp_id = components[0];
-
- g_hash_table_insert (categories_by_name, g_strdup (category_names->data), g_strdup (temp_id));
- g_hash_table_insert (categories_by_id, g_strdup (temp_id), g_strdup (category_names->data));
- category_ids = g_list_append (category_ids, g_strdup (temp_id));
- g_free (id);
- g_strfreev (components);
- }
- g_object_unref (category_item);
- }
- }
- e_gw_item_set_categories (item, category_ids);
+ gchar *temp_id = components[0];
+
+ g_hash_table_insert (categories_by_name, g_strdup (category_names->data), g_strdup (temp_id));
+ g_hash_table_insert (categories_by_id, g_strdup (temp_id), g_strdup (category_names->data));
+ category_ids = g_list_append (category_ids, g_strdup (temp_id));
+ g_free (id);
+ g_strfreev (components);
+ }
+ g_object_unref (category_item);
+ }
+ }
+ e_gw_item_set_categories (item, category_ids);
}
static void
const gchar *t;
gchar *name;
GList *category_ids;
- GSList *categories;
+ GSList *categories;
GHashTable *categories_by_id;
gboolean is_allday;
icaltimezone *default_zone;
start_freebusy_session (EGwConnection *cnc, GList *users,
time_t start, time_t end, gchar **session)
{
- SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param;
- GList *l;
- icaltimetype icaltime;
+ SoupSoapMessage *msg;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param;
+ GList *l;
+ icaltimetype icaltime;
icaltimezone *utc;
- gchar *start_date, *end_date;
+ gchar *start_date, *end_date;
if (users == NULL)
- return E_GW_CONNECTION_STATUS_INVALID_OBJECT;
+ return E_GW_CONNECTION_STATUS_INVALID_OBJECT;
/* build the SOAP message */
msg = e_gw_message_new_with_header (e_gw_connection_get_uri (cnc),
* email id apart from the name*/
soup_soap_message_start_element (msg, "users", NULL, NULL);
- for ( l = users; l != NULL; l = g_list_next (l)) {
+ for ( l = users; l != NULL; l = g_list_next (l)) {
soup_soap_message_start_element (msg, "user", NULL, NULL);
e_gw_message_write_string_parameter (msg, "email", NULL, l->data);
soup_soap_message_end_element (msg);
- }
+ }
- soup_soap_message_end_element (msg);
+ soup_soap_message_end_element (msg);
utc = icaltimezone_get_utc_timezone ();
icaltime = icaltime_from_timet_with_zone (start, FALSE, utc);
}
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK)
- {
- g_object_unref (msg);
- g_object_unref (response);
- return status;
- }
+ if (status != E_GW_CONNECTION_STATUS_OK)
+ {
+ g_object_unref (msg);
+ g_object_unref (response);
+ return status;
+ }
/* if status is OK - parse result, return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "freeBusySessionId");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
*session = soup_soap_parameter_get_string_value (param);
/* free memory */
static EGwConnectionStatus
close_freebusy_session (EGwConnection *cnc, const gchar *session)
{
- SoupSoapMessage *msg;
+ SoupSoapMessage *msg;
SoupSoapResponse *response;
EGwConnectionStatus status;
e_gw_connection_get_session_id (cnc),
"closeFreeBusySessionRequest");
e_gw_message_write_string_parameter (msg, "freeBusySessionId", NULL, session);
- e_gw_message_write_footer (msg);
+ e_gw_message_write_footer (msg);
/* send message to server */
response = e_gw_connection_send_message (cnc, msg);
status = e_gw_connection_parse_response_status (response);
- g_object_unref (msg);
- g_object_unref (response);
- return status;
+ g_object_unref (msg);
+ g_object_unref (response);
+ return status;
}
EGwConnectionStatus
e_gw_connection_get_freebusy_info (ECalBackendGroupwise *cbgw, GList *users, time_t start, time_t end, GList **freebusy)
{
- SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param, *subparam, *param_outstanding;
+ SoupSoapMessage *msg;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param, *subparam, *param_outstanding;
EGwConnection *cnc;
- gchar *session;
+ gchar *session;
gchar *outstanding = NULL;
gboolean resend_request = TRUE;
gint request_iteration = 0;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_CONNECTION);
/* Perform startFreeBusySession */
- status = start_freebusy_session (cnc, users, start, end, &session);
+ status = start_freebusy_session (cnc, users, start, end, &session);
/*FIXME log error messages */
- if (status != E_GW_CONNECTION_STATUS_OK)
- return status;
+ if (status != E_GW_CONNECTION_STATUS_OK)
+ return status;
resend :
while (resend_request) {
e_gw_connection_get_session_id (cnc),
"getFreeBusyRequest");
e_gw_message_write_string_parameter (msg, "freeBusySessionId", NULL, session);
- e_gw_message_write_footer (msg);
+ e_gw_message_write_footer (msg);
/* send message to server */
response = e_gw_connection_send_message (cnc, msg);
}
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
- g_object_unref (msg);
- g_object_unref (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
+ g_object_unref (msg);
+ g_object_unref (response);
g_free (session);
- return status;
- }
+ return status;
+ }
param = soup_soap_response_get_first_parameter_by_name (response, "freeBusyStats");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
g_free (session);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
param_outstanding = soup_soap_parameter_get_first_child_by_name (param, "outstanding");
if (param_outstanding)
/* FIXME the FreeBusyStats are not used currently. */
param = soup_soap_response_get_first_parameter_by_name (response, "freeBusyInfo");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
resend_request = FALSE;
e_cal_backend_groupwise_priv_unlock (cbgw);
}
- g_object_unref (msg);
- g_object_unref (response);
+ g_object_unref (msg);
+ g_object_unref (response);
} /* end of while loop */
status = close_freebusy_session (cnc, session);
g_free (session);
- return status;
+ return status;
}
#define SET_DELTA(fieldname) G_STMT_START{ \
{
ECalBackendGroupwisePrivate *priv;
EGwConnectionStatus status;
- ECalComponent *comp;
- GList *list = NULL, *l;
+ ECalComponent *comp;
+ GList *list = NULL, *l;
gboolean done = FALSE, forward = FALSE;
gint cursor = 0;
guint32 total, num = 0;
cnc_status = e_gw_connection_get_categories (priv->cnc, &priv->categories_by_id, &priv->categories_by_name);
if (cnc_status != E_GW_CONNECTION_STATUS_OK) {
g_warning (G_STRLOC ": Could not get the categories from the server");
- }
+ }
priv->mode = CAL_MODE_REMOTE;
ECalComponent *comp;
- comp = e_cal_component_new ();
+ comp = e_cal_component_new ();
switch (e_cal_backend_get_kind (E_CAL_BACKEND (backend))) {
case ICAL_VEVENT_COMPONENT:
{
ECalBackendGroupwise *cbgw;
ECalBackendGroupwisePrivate *priv;
- GSList *components, *l;
+ GSList *components, *l;
ECalBackendSExp *cbsexp;
gboolean search_needed = TRUE;
time_t occur_start = -1, occur_end = -1;
: e_cal_backend_store_get_components (priv->store);
for (l = components; l != NULL; l = l->next) {
- ECalComponent *comp = E_CAL_COMPONENT (l->data);
+ ECalComponent *comp = E_CAL_COMPONENT (l->data);
if (e_cal_backend_get_kind (E_CAL_BACKEND (backend)) ==
icalcomponent_isa (e_cal_component_get_icalcomponent (comp))) {
*objects = g_list_append (*objects, e_cal_component_get_as_string (comp));
}
}
- }
+ }
g_object_unref (cbsexp);
g_slist_foreach (components, (GFunc) g_object_unref, NULL);
{
ECalBackendGroupwise *cbgw;
ECalBackendGroupwisePrivate *priv;
- GList *objects = NULL;
+ GList *objects = NULL;
GError *err = NULL;
cbgw = E_CAL_BACKEND_GROUPWISE (backend);
priv = cbgw->priv;
- e_cal_backend_groupwise_get_object_list (E_CAL_BACKEND_SYNC (backend), NULL,
+ e_cal_backend_groupwise_get_object_list (E_CAL_BACKEND_SYNC (backend), NULL,
e_data_cal_view_get_text (query), &objects, &err);
- if (err) {
+ if (err) {
e_data_cal_view_notify_done (query, err);
g_error_free (err);
- return;
+ return;
}
/* notify listeners of all objects */
g_free (unescaped_uri);
e_cal_backend_groupwise_get_object_list (E_CAL_BACKEND_SYNC (cbgw), NULL, "#t", &list, &err);
- if (err) {
+ if (err) {
g_propagate_error (perror, err);
- return;
+ return;
}
/* Calculate adds and modifies */
e_cal_backend_groupwise_get_changes (ECalBackendSync *backend, EDataCal *cal, const gchar *change_id,
GList **adds, GList **modifies, GList **deletes, GError **error)
{
- ECalBackendGroupwise *cbgw;
+ ECalBackendGroupwise *cbgw;
cbgw = E_CAL_BACKEND_GROUPWISE (backend);
e_return_data_cal_error_if_fail (E_IS_CAL_BACKEND_GROUPWISE (cbgw), InvalidArg);
e_cal_backend_groupwise_create_object (ECalBackendSync *backend, EDataCal *cal, gchar **calobj, gchar **uid, GError **error)
{
ECalBackendGroupwise *cbgw;
- ECalBackendGroupwisePrivate *priv;
+ ECalBackendGroupwisePrivate *priv;
icalcomponent *icalcomp;
ECalComponent *comp;
EGwConnectionStatus status;
CalObjModType mod, gchar **old_object, gchar **new_object, GError **error)
{
ECalBackendGroupwise *cbgw;
- ECalBackendGroupwisePrivate *priv;
+ ECalBackendGroupwisePrivate *priv;
icalcomponent *icalcomp;
ECalComponent *comp, *cache_comp = NULL;
EGwConnectionStatus status;
gchar **object, GError **perror)
{
ECalBackendGroupwise *cbgw;
- ECalBackendGroupwisePrivate *priv;
+ ECalBackendGroupwisePrivate *priv;
EGwConnectionStatus status;
gchar *calobj = NULL;
GError *err = NULL;
e_cal_backend_groupwise_receive_objects (ECalBackendSync *backend, EDataCal *cal, const gchar *calobj, GError **perror)
{
ECalBackendGroupwise *cbgw;
- ECalBackendGroupwisePrivate *priv;
+ ECalBackendGroupwisePrivate *priv;
icalcomponent *icalcomp, *subcomp;
icalcomponent_kind kind;
GError *err = NULL;
/***** static icaltimezone *
resolve_tzid (const gchar *tzid, gpointer user_data)
{
- icalcomponent *vcalendar_comp = user_data;
+ icalcomponent *vcalendar_comp = user_data;
- if (!tzid || !tzid[0])
- return NULL;
+ if (!tzid || !tzid[0])
+ return NULL;
else if (!strcmp (tzid, "UTC"))
- return icaltimezone_get_utc_timezone ();
+ return icaltimezone_get_utc_timezone ();
- return icalcomponent_get_timezone (vcalendar_comp, tzid);
+ return icalcomponent_get_timezone (vcalendar_comp, tzid);
} *****/
static gboolean
time_t instance_end,
gpointer data)
{
- icalcomponent *vfb = data;
- icalproperty *prop;
- icalparameter *param;
- struct icalperiodtype ipt;
- icaltimezone *utc_zone;
+ icalcomponent *vfb = data;
+ icalproperty *prop;
+ icalparameter *param;
+ struct icalperiodtype ipt;
+ icaltimezone *utc_zone;
- utc_zone = icaltimezone_get_utc_timezone ();
+ utc_zone = icaltimezone_get_utc_timezone ();
- ipt.start = icaltime_from_timet_with_zone (instance_start, FALSE, utc_zone);
- ipt.end = icaltime_from_timet_with_zone (instance_end, FALSE, utc_zone);
- ipt.duration = icaldurationtype_null_duration ();
+ ipt.start = icaltime_from_timet_with_zone (instance_start, FALSE, utc_zone);
+ ipt.end = icaltime_from_timet_with_zone (instance_end, FALSE, utc_zone);
+ ipt.duration = icaldurationtype_null_duration ();
/* add busy information to the vfb component */
- prop = icalproperty_new (ICAL_FREEBUSY_PROPERTY);
- icalproperty_set_freebusy (prop, ipt);
+ prop = icalproperty_new (ICAL_FREEBUSY_PROPERTY);
+ icalproperty_set_freebusy (prop, ipt);
- param = icalparameter_new_fbtype (ICAL_FBTYPE_BUSY);
- icalproperty_add_parameter (prop, param);
+ param = icalparameter_new_fbtype (ICAL_FBTYPE_BUSY);
+ icalproperty_add_parameter (prop, param);
- icalcomponent_add_property (vfb, prop);
+ icalcomponent_add_property (vfb, prop);
- return TRUE;
+ return TRUE;
}
static icalcomponent *
create_user_free_busy (ECalBackendHttp *cbhttp, const gchar *address, const gchar *cn,
time_t start, time_t end)
{
- GSList *slist = NULL, *l;
- icalcomponent *vfb;
- icaltimezone *utc_zone;
- ECalBackendSExp *obj_sexp;
- ECalBackendHttpPrivate *priv;
- ECalBackendStore *store;
- gchar *query, *iso_start, *iso_end;
+ GSList *slist = NULL, *l;
+ icalcomponent *vfb;
+ icaltimezone *utc_zone;
+ ECalBackendSExp *obj_sexp;
+ ECalBackendHttpPrivate *priv;
+ ECalBackendStore *store;
+ gchar *query, *iso_start, *iso_end;
- priv = cbhttp->priv;
- store = priv->store;
+ priv = cbhttp->priv;
+ store = priv->store;
/* create the (unique) VFREEBUSY object that we'll return */
- vfb = icalcomponent_new_vfreebusy ();
- if (address != NULL) {
- icalproperty *prop;
- icalparameter *param;
-
- prop = icalproperty_new_organizer (address);
- if (prop != NULL && cn != NULL) {
- param = icalparameter_new_cn (cn);
- icalproperty_add_parameter (prop, param);
- }
- if (prop != NULL)
- icalcomponent_add_property (vfb, prop);
- }
- utc_zone = icaltimezone_get_utc_timezone ();
- icalcomponent_set_dtstart (vfb, icaltime_from_timet_with_zone (start, FALSE, utc_zone));
- icalcomponent_set_dtend (vfb, icaltime_from_timet_with_zone (end, FALSE, utc_zone));
+ vfb = icalcomponent_new_vfreebusy ();
+ if (address != NULL) {
+ icalproperty *prop;
+ icalparameter *param;
+
+ prop = icalproperty_new_organizer (address);
+ if (prop != NULL && cn != NULL) {
+ param = icalparameter_new_cn (cn);
+ icalproperty_add_parameter (prop, param);
+ }
+ if (prop != NULL)
+ icalcomponent_add_property (vfb, prop);
+ }
+ utc_zone = icaltimezone_get_utc_timezone ();
+ icalcomponent_set_dtstart (vfb, icaltime_from_timet_with_zone (start, FALSE, utc_zone));
+ icalcomponent_set_dtend (vfb, icaltime_from_timet_with_zone (end, FALSE, utc_zone));
/* add all objects in the given interval */
- iso_start = isodate_from_time_t (start);
- iso_end = isodate_from_time_t (end);
+ iso_start = isodate_from_time_t (start);
+ iso_end = isodate_from_time_t (end);
query = g_strdup_printf ("occur-in-time-range? (make-time \"%s\") (make-time \"%s\")",
- iso_start, iso_end);
- obj_sexp = e_cal_backend_sexp_new (query);
- g_free (query);
- g_free (iso_start);
- g_free (iso_end);
+ iso_start, iso_end);
+ obj_sexp = e_cal_backend_sexp_new (query);
+ g_free (query);
+ g_free (iso_start);
+ g_free (iso_end);
- if (!obj_sexp)
- return vfb;
- if (!obj_sexp)
- return vfb;
+ if (!obj_sexp)
+ return vfb;
+ if (!obj_sexp)
+ return vfb;
- slist = e_cal_backend_store_get_components (store);
+ slist = e_cal_backend_store_get_components (store);
- for (l = slist; l; l = g_slist_next (l)) {
- ECalComponent *comp = l->data;
- icalcomponent *icalcomp, *vcalendar_comp;
- icalproperty *prop;
+ for (l = slist; l; l = g_slist_next (l)) {
+ ECalComponent *comp = l->data;
+ icalcomponent *icalcomp, *vcalendar_comp;
+ icalproperty *prop;
- icalcomp = e_cal_component_get_icalcomponent (comp);
- if (!icalcomp)
- continue;
+ icalcomp = e_cal_component_get_icalcomponent (comp);
+ if (!icalcomp)
+ continue;
/* If the event is TRANSPARENT, skip it. */
- prop = icalcomponent_get_first_property (icalcomp,
- ICAL_TRANSP_PROPERTY);
- if (prop) {
- icalproperty_transp transp_val = icalproperty_get_transp (prop);
- if (transp_val == ICAL_TRANSP_TRANSPARENT ||
- transp_val == ICAL_TRANSP_TRANSPARENTNOCONFLICT)
- continue;
- }
-
- if (!e_cal_backend_sexp_match_comp (obj_sexp, l->data, E_CAL_BACKEND (cbhttp)))
- continue;
-
- vcalendar_comp = icalcomponent_get_parent (icalcomp);
- if (!vcalendar_comp)
- vcalendar_comp = icalcomp;
- e_cal_recur_generate_instances (comp, start, end,
- free_busy_instance,
- vfb,
- resolve_tzid,
- vcalendar_comp,
- (icaltimezone *)e_cal_backend_store_get_default_timezone (store));
- }
- g_object_unref (obj_sexp);
-
- return vfb;
+ prop = icalcomponent_get_first_property (icalcomp,
+ ICAL_TRANSP_PROPERTY);
+ if (prop) {
+ icalproperty_transp transp_val = icalproperty_get_transp (prop);
+ if (transp_val == ICAL_TRANSP_TRANSPARENT ||
+ transp_val == ICAL_TRANSP_TRANSPARENTNOCONFLICT)
+ continue;
+ }
+
+ if (!e_cal_backend_sexp_match_comp (obj_sexp, l->data, E_CAL_BACKEND (cbhttp)))
+ continue;
+
+ vcalendar_comp = icalcomponent_get_parent (icalcomp);
+ if (!vcalendar_comp)
+ vcalendar_comp = icalcomp;
+ e_cal_recur_generate_instances (comp, start, end,
+ free_busy_instance,
+ vfb,
+ resolve_tzid,
+ vcalendar_comp,
+ (icaltimezone *)e_cal_backend_store_get_default_timezone (store));
+ }
+ g_object_unref (obj_sexp);
+
+ return vfb;
}
/* Get_free_busy handler for the file backend */
return;
}
- if (users == NULL) {
+ if (users == NULL) {
if (e_cal_backend_mail_account_get_default (&address, &name)) {
- vfb = create_user_free_busy (cbhttp, address, name, start, end);
- calobj = icalcomponent_as_ical_string_r (vfb);
+ vfb = create_user_free_busy (cbhttp, address, name, start, end);
+ calobj = icalcomponent_as_ical_string_r (vfb);
*freebusy = g_list_append (*freebusy, calobj);
- icalcomponent_free (vfb);
- g_free (address);
- g_free (name);
+ icalcomponent_free (vfb);
+ g_free (address);
+ g_free (name);
}
} else {
- GList *l;
- for (l = users; l != NULL; l = l->next ) {
- address = l->data;
- if (e_cal_backend_mail_account_is_valid (address, &name)) {
- vfb = create_user_free_busy (cbhttp, address, name, start, end);
- calobj = icalcomponent_as_ical_string_r (vfb);
+ GList *l;
+ for (l = users; l != NULL; l = l->next ) {
+ address = l->data;
+ if (e_cal_backend_mail_account_is_valid (address, &name)) {
+ vfb = create_user_free_busy (cbhttp, address, name, start, end);
+ calobj = icalcomponent_as_ical_string_r (vfb);
*freebusy = g_list_append (*freebusy, calobj);
- icalcomponent_free (vfb);
- g_free (name);
- }
- }
+ icalcomponent_free (vfb);
+ g_free (name);
+ }
+ }
}
}
icomp = icaltimezone_get_builtin_timezone (location);
if (icomp) {
- return icaltimezone_get_tzid (icomp);
+ return icaltimezone_get_tzid (icomp);
}
/* try a bit harder by stripping trailing suffix */
buffer = g_malloc (len + 1);
if (buffer) {
- memcpy (buffer, location, len);
- buffer[len] = 0;
- icomp = icaltimezone_get_builtin_timezone (buffer);
- g_free (buffer);
- if (icomp) {
- return icaltimezone_get_tzid (icomp);
- }
+ memcpy (buffer, location, len);
+ buffer[len] = 0;
+ icomp = icaltimezone_get_builtin_timezone (buffer);
+ g_free (buffer);
+ if (icomp) {
+ return icaltimezone_get_tzid (icomp);
+ }
}
return NULL;
*/
eostr = len - 1;
while (eostr >= 0 &&
- isdigit (tzid[eostr])) {
- eostr--;
+ isdigit (tzid[eostr])) {
+ eostr--;
}
while (eostr >= 0 &&
- isspace (tzid[eostr])) {
- eostr--;
+ isspace (tzid[eostr])) {
+ eostr--;
}
if (eostr + 1 < len) {
- gchar *strippedtzid = g_strndup (tzid, eostr + 1);
- if (strippedtzid) {
- systzid = e_cal_match_tzid (strippedtzid);
- g_free (strippedtzid);
- if (systzid) {
- goto done;
- }
- }
+ gchar *strippedtzid = g_strndup (tzid, eostr + 1);
+ if (strippedtzid) {
+ systzid = e_cal_match_tzid (strippedtzid);
+ g_free (strippedtzid);
+ if (systzid) {
+ goto done;
+ }
+ }
}
/*
* is a known location; start with the whole string (just in case)
*/
for (location = tzid;
- location && location[0];
- location = strchr (location + 1, '/')) {
- systzid = e_cal_match_location (location[0] == '/' ?
- location + 1 :
- location);
- if (systzid) {
- goto done;
- }
+ location && location[0];
+ location = strchr (location + 1, '/')) {
+ systzid = e_cal_match_location (location[0] == '/' ?
+ location + 1 :
+ location);
+ if (systzid) {
+ goto done;
+ }
}
/* TODO: lookup table for Exchange TZIDs */
*
* So better avoid matching against it...
*/
- return NULL;
+ return NULL;
} else {
- return systzid;
+ return systzid;
}
}
gchar *tzid = NULL;
if (icalcomponent_isa (subcomp) != ICAL_VTIMEZONE_COMPONENT) {
- icalproperty *prop = icalcomponent_get_first_property (subcomp,
- ICAL_ANY_PROPERTY);
- while (prop) {
- icalparameter *param = icalproperty_get_first_parameter (prop,
- ICAL_TZID_PARAMETER);
- while (param) {
- const gchar *oldtzid;
- const gchar *newtzid;
-
- g_free (tzid);
- tzid = g_strdup (icalparameter_get_tzid (param));
-
- if (!g_hash_table_lookup_extended (mapping,
- tzid,
- (gpointer *)&oldtzid,
- (gpointer *)&newtzid)) {
+ icalproperty *prop = icalcomponent_get_first_property (subcomp,
+ ICAL_ANY_PROPERTY);
+ while (prop) {
+ icalparameter *param = icalproperty_get_first_parameter (prop,
+ ICAL_TZID_PARAMETER);
+ while (param) {
+ const gchar *oldtzid;
+ const gchar *newtzid;
+
+ g_free (tzid);
+ tzid = g_strdup (icalparameter_get_tzid (param));
+
+ if (!g_hash_table_lookup_extended (mapping,
+ tzid,
+ (gpointer *)&oldtzid,
+ (gpointer *)&newtzid)) {
/* Corresponding VTIMEZONE not seen before! */
- newtzid = e_cal_match_tzid (tzid);
- }
- if (newtzid) {
- icalparameter_set_tzid (param, newtzid);
- }
- param = icalproperty_get_next_parameter (prop,
- ICAL_TZID_PARAMETER);
- }
- prop = icalcomponent_get_next_property (subcomp,
- ICAL_ANY_PROPERTY);
- }
+ newtzid = e_cal_match_tzid (tzid);
+ }
+ if (newtzid) {
+ icalparameter_set_tzid (param, newtzid);
+ }
+ param = icalproperty_get_next_parameter (prop,
+ ICAL_TZID_PARAMETER);
+ }
+ prop = icalcomponent_get_next_property (subcomp,
+ ICAL_ANY_PROPERTY);
+ }
}
g_free (tzid);
zone = icaltimezone_get_builtin_timezone_from_tzid (tzid);
if (zone) {
- icalcomponent_add_component (comp,
- icalcomponent_new_clone (icaltimezone_get_component (zone)));
+ icalcomponent_add_component (comp,
+ icalcomponent_new_clone (icaltimezone_get_component (zone)));
}
}
*error = NULL;
if (!mapping || !zone) {
- goto nomem;
+ goto nomem;
}
/* iterate over all VTIMEZONE definitions */
subcomp = icalcomponent_get_first_component (comp,
- ICAL_VTIMEZONE_COMPONENT);
+ ICAL_VTIMEZONE_COMPONENT);
while (subcomp) {
- if (icaltimezone_set_component (zone, subcomp)) {
- g_free (tzid);
- tzid = g_strdup (icaltimezone_get_tzid (zone));
- if (tzid) {
- const gchar *newtzid = e_cal_match_tzid (tzid);
- if (newtzid) {
+ if (icaltimezone_set_component (zone, subcomp)) {
+ g_free (tzid);
+ tzid = g_strdup (icaltimezone_get_tzid (zone));
+ if (tzid) {
+ const gchar *newtzid = e_cal_match_tzid (tzid);
+ if (newtzid) {
/* matched against system time zone */
- g_free (key);
- key = g_strdup (tzid);
- if (!key) {
- goto nomem;
- }
-
- g_free (value);
- value = g_strdup (newtzid);
- if (!value) {
- goto nomem;
- }
-
- g_hash_table_insert (mapping, key, value);
- g_hash_table_insert (systemtzids, value, NULL);
- key =
- value = NULL;
- } else {
- gint counter;
-
- zonestr = icalcomponent_as_ical_string_r (subcomp);
+ g_free (key);
+ key = g_strdup (tzid);
+ if (!key) {
+ goto nomem;
+ }
+
+ g_free (value);
+ value = g_strdup (newtzid);
+ if (!value) {
+ goto nomem;
+ }
+
+ g_hash_table_insert (mapping, key, value);
+ g_hash_table_insert (systemtzids, value, NULL);
+ key =
+ value = NULL;
+ } else {
+ gint counter;
+
+ zonestr = icalcomponent_as_ical_string_r (subcomp);
/* check for collisions with existing timezones */
- for (counter = 0;
- counter < 100 /* sanity limit */;
- counter++) {
- icaltimezone *existing_zone;
+ for (counter = 0;
+ counter < 100 /* sanity limit */;
+ counter++) {
+ icaltimezone *existing_zone;
- if (counter) {
- g_free (value);
+ if (counter) {
+ g_free (value);
value = g_strdup_printf("%s %d", tzid, counter);
- }
- existing_zone = tzlookup (counter ? value : tzid,
- custom,
- error);
- if (!existing_zone) {
- if (*error) {
- goto failed;
- } else {
- break;
- }
- }
- g_free (buffer);
- buffer = icalcomponent_as_ical_string_r (icaltimezone_get_component (existing_zone));
-
- if (counter) {
+ }
+ existing_zone = tzlookup (counter ? value : tzid,
+ custom,
+ error);
+ if (!existing_zone) {
+ if (*error) {
+ goto failed;
+ } else {
+ break;
+ }
+ }
+ g_free (buffer);
+ buffer = icalcomponent_as_ical_string_r (icaltimezone_get_component (existing_zone));
+
+ if (counter) {
gchar *fulltzid = g_strdup_printf("TZID:%s", value);
gsize baselen = strlen("TZID:") + strlen(tzid);
- gsize fulllen = strlen (fulltzid);
- gchar *tzidprop;
+ gsize fulllen = strlen (fulltzid);
+ gchar *tzidprop;
/*
* Map TZID with counter suffix back to basename.
*/
- tzidprop = strstr (buffer, fulltzid);
- if (tzidprop) {
- memmove (tzidprop + baselen,
- tzidprop + fulllen,
- strlen (tzidprop + fulllen) + 1);
- }
- g_free (fulltzid);
- }
+ tzidprop = strstr (buffer, fulltzid);
+ if (tzidprop) {
+ memmove (tzidprop + baselen,
+ tzidprop + fulllen,
+ strlen (tzidprop + fulllen) + 1);
+ }
+ g_free (fulltzid);
+ }
/*
* If the strings are identical, then the
* is expected to occur rarely (if at all) in
* practice.
*/
- if (!strcmp (zonestr, buffer)) {
- break;
- }
- }
+ if (!strcmp (zonestr, buffer)) {
+ break;
+ }
+ }
- if (!counter) {
+ if (!counter) {
/* does not exist, nothing to do */
- } else {
+ } else {
/* timezone renamed */
- icalproperty *prop = icalcomponent_get_first_property (subcomp,
- ICAL_TZID_PROPERTY);
- while (prop) {
+ icalproperty *prop = icalcomponent_get_first_property (subcomp,
+ ICAL_TZID_PROPERTY);
+ while (prop) {
icalproperty_set_value_from_string(prop, value, "NO");
- prop = icalcomponent_get_next_property (subcomp,
- ICAL_ANY_PROPERTY);
- }
- g_free (key);
- key = g_strdup (tzid);
- g_hash_table_insert (mapping, key, value);
- key =
- value = NULL;
- }
- }
- }
- }
-
- subcomp = icalcomponent_get_next_component (comp,
- ICAL_VTIMEZONE_COMPONENT);
+ prop = icalcomponent_get_next_property (subcomp,
+ ICAL_ANY_PROPERTY);
+ }
+ g_free (key);
+ key = g_strdup (tzid);
+ g_hash_table_insert (mapping, key, value);
+ key =
+ value = NULL;
+ }
+ }
+ }
+ }
+
+ subcomp = icalcomponent_get_next_component (comp,
+ ICAL_VTIMEZONE_COMPONENT);
}
/*
* now replace all TZID parameters in place
*/
subcomp = icalcomponent_get_first_component (comp,
- ICAL_ANY_COMPONENT);
+ ICAL_ANY_COMPONENT);
while (subcomp) {
/*
* Leave VTIMEZONE unchanged, iterate over properties of
* little additional gain. However, newly used time zones are
* added below.
*/
- patch_tzids (subcomp, mapping);
- subcomp = icalcomponent_get_next_component (comp,
- ICAL_ANY_COMPONENT);
+ patch_tzids (subcomp, mapping);
+ subcomp = icalcomponent_get_next_component (comp,
+ ICAL_ANY_COMPONENT);
}
for (l = comps; l; l = l->next) {
- patch_tzids (l->data, mapping);
+ patch_tzids (l->data, mapping);
}
/*
success = FALSE;
done:
if (mapping) {
- g_hash_table_destroy (mapping);
+ g_hash_table_destroy (mapping);
}
if (systemtzids) {
- g_hash_table_destroy (systemtzids);
+ g_hash_table_destroy (systemtzids);
}
if (zone) {
- icaltimezone_free (zone, 1);
+ icaltimezone_free (zone, 1);
}
g_free (tzid);
g_free (zonestr);
gchar *
e_cal_component_gen_uid (void)
{
- gchar *iso, *ret;
+ gchar *iso, *ret;
static const gchar *hostname;
time_t t = time (NULL);
static gint serial;
gchar *
e_cal_component_get_recurid_as_string (ECalComponent *comp)
{
- ECalComponentRange range;
- struct icaltimetype tt;
+ ECalComponentRange range;
+ struct icaltimetype tt;
if (!e_cal_component_is_instance (comp))
return NULL;
- e_cal_component_get_recurid (comp, &range);
- if (!range.datetime.value) {
+ e_cal_component_get_recurid (comp, &range);
+ if (!range.datetime.value) {
e_cal_component_free_range (&range);
return g_strdup ("0");
}
- tt = *range.datetime.value;
- e_cal_component_free_range (&range);
+ tt = *range.datetime.value;
+ e_cal_component_free_range (&range);
- return icaltime_is_valid_time (tt) && !icaltime_is_null_time (tt) ?
+ return icaltime_is_valid_time (tt) && !icaltime_is_null_time (tt) ?
icaltime_as_ical_string_r (tt) : g_strdup ("0");
}
static gchar *
system_timezone_read_etc_timezone (void)
{
- FILE *etc_timezone;
- GString *reading;
- gint c;
+ FILE *etc_timezone;
+ GString *reading;
+ gint c;
etc_timezone = g_fopen (ETC_TIMEZONE, "r");
- if (!etc_timezone)
- return NULL;
+ if (!etc_timezone)
+ return NULL;
reading = g_string_new ("");
- c = fgetc (etc_timezone);
+ c = fgetc (etc_timezone);
/* only get the first line, we'll validate the value later */
- while (c != EOF && !g_ascii_isspace (c)) {
- reading = g_string_append_c (reading, c);
- c = fgetc (etc_timezone);
- }
+ while (c != EOF && !g_ascii_isspace (c)) {
+ reading = g_string_append_c (reading, c);
+ c = fgetc (etc_timezone);
+ }
- fclose (etc_timezone);
+ fclose (etc_timezone);
- if (reading->str && reading->str[0] != '\0')
- return g_string_free (reading, FALSE);
- else
- g_string_free (reading, TRUE);
+ if (reading->str && reading->str[0] != '\0')
+ return g_string_free (reading, FALSE);
+ else
+ g_string_free (reading, TRUE);
- return NULL;
+ return NULL;
}
/* Read a file that looks like a key-file (but there's no need for groups)
system_timezone_read_key_file (const gchar *filename,
const gchar *key)
{
- GIOChannel *channel;
- gchar *key_eq;
- gchar *line;
- gchar *retval;
+ GIOChannel *channel;
+ gchar *key_eq;
+ gchar *line;
+ gchar *retval;
- if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR))
- return NULL;
+ if (!g_file_test (filename, G_FILE_TEST_IS_REGULAR))
+ return NULL;
channel = g_io_channel_new_file (filename, "r", NULL);
- if (!channel)
- return NULL;
+ if (!channel)
+ return NULL;
key_eq = g_strdup_printf ("%s=", key);
- retval = NULL;
+ retval = NULL;
- while (g_io_channel_read_line (channel, &line, NULL,
- NULL, NULL) == G_IO_STATUS_NORMAL) {
- if (g_str_has_prefix (line, key_eq)) {
- gchar *value;
- gint len;
+ while (g_io_channel_read_line (channel, &line, NULL,
+ NULL, NULL) == G_IO_STATUS_NORMAL) {
+ if (g_str_has_prefix (line, key_eq)) {
+ gchar *value;
+ gint len;
- value = line + strlen (key_eq);
- g_strstrip (value);
+ value = line + strlen (key_eq);
+ g_strstrip (value);
- len = strlen (value);
+ len = strlen (value);
- if (value[0] == '\"') {
- if (value[len - 1] == '\"') {
- if (retval)
- g_free (retval);
+ if (value[0] == '\"') {
+ if (value[len - 1] == '\"') {
+ if (retval)
+ g_free (retval);
- retval = g_strndup (value + 1,
- len - 2);
- }
- } else {
- if (retval)
- g_free (retval);
+ retval = g_strndup (value + 1,
+ len - 2);
+ }
+ } else {
+ if (retval)
+ g_free (retval);
- retval = g_strdup (line + strlen (key_eq));
- }
+ retval = g_strdup (line + strlen (key_eq));
+ }
- g_strstrip (retval);
- }
+ g_strstrip (retval);
+ }
- g_free (line);
- }
+ g_free (line);
+ }
- g_free (key_eq);
- g_io_channel_unref (channel);
+ g_free (key_eq);
+ g_io_channel_unref (channel);
- return retval;
+ return retval;
}
/* This works for Fedora and Mandriva */
static gchar *
system_timezone_read_etc_sysconfig_clock (void)
{
- return system_timezone_read_key_file (ETC_SYSCONFIG_CLOCK,
+ return system_timezone_read_key_file (ETC_SYSCONFIG_CLOCK,
"ZONE");
}
static gchar *
system_timezone_read_etc_sysconfig_clock_alt (void)
{
- return system_timezone_read_key_file (ETC_SYSCONFIG_CLOCK,
+ return system_timezone_read_key_file (ETC_SYSCONFIG_CLOCK,
"TIMEZONE");
}
static gchar *
system_timezone_read_etc_TIMEZONE (void)
{
- return system_timezone_read_key_file (ETC_TIMEZONE_MAJ,
+ return system_timezone_read_key_file (ETC_TIMEZONE_MAJ,
"TZ");
}
static gchar *
system_timezone_read_etc_rc_conf (void)
{
- return system_timezone_read_key_file (ETC_RC_CONF,
+ return system_timezone_read_key_file (ETC_RC_CONF,
"TIMEZONE");
}
static gchar *
system_timezone_read_etc_conf_d_clock (void)
{
- return system_timezone_read_key_file (ETC_CONF_D_CLOCK,
+ return system_timezone_read_key_file (ETC_CONF_D_CLOCK,
"TIMEZONE");
}
static void
objects_added_cb (EGdbusCalView *gdbus_calview, const gchar * const *objects, ECalView *view)
{
- GList *list;
+ GList *list;
g_return_if_fail (E_IS_CAL_VIEW (view));
g_object_ref (view);
static void
objects_modified_cb (EGdbusCalView *gdbus_calview, const gchar * const *objects, ECalView *view)
{
- GList *list;
+ GList *list;
g_return_if_fail (E_IS_CAL_VIEW (view));
g_object_ref (view);
static void
objects_removed_cb (EGdbusCalView *gdbus_calview, const gchar * const *uids, ECalView *view)
{
- GList *list;
+ GList *list;
g_return_if_fail (E_IS_CAL_VIEW (view));
g_object_ref (view);
gdbus_cal_disconnect (ecal);
- g_signal_emit (G_OBJECT (ecal), e_cal_signals[BACKEND_DIED], 0);
+ g_signal_emit (G_OBJECT (ecal), e_cal_signals[BACKEND_DIED], 0);
}
static void
GList *
e_cal_backend_cache_get_components (ECalBackendCache *cache)
{
- gchar *comp_str;
- GSList *l;
+ gchar *comp_str;
+ GSList *l;
GList *list = NULL;
icalcomponent *icalcomp;
ECalComponent *comp = NULL;
/* return null if cache is not a valid Backend Cache. */
g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
- l = e_file_cache_get_objects (E_FILE_CACHE (cache));
- if (!l)
- return NULL;
- for (; l != NULL; l = g_slist_next (l)) {
- comp_str = l->data;
- if (comp_str) {
- icalcomp = icalparser_parse_string (comp_str);
- if (icalcomp) {
+ l = e_file_cache_get_objects (E_FILE_CACHE (cache));
+ if (!l)
+ return NULL;
+ for (; l != NULL; l = g_slist_next (l)) {
+ comp_str = l->data;
+ if (comp_str) {
+ icalcomp = icalparser_parse_string (comp_str);
+ if (icalcomp) {
icalcomponent_kind kind;
kind = icalcomponent_isa (icalcomp);
}
} else
icalcomponent_free (icalcomp);
- }
- }
+ }
+ }
- }
+ }
- return list;
+ return list;
}
/**
GSList *
e_cal_backend_cache_get_components_by_uid (ECalBackendCache *cache, const gchar *uid)
{
- gchar *comp_str;
- GSList *l;
+ gchar *comp_str;
+ GSList *l;
GSList *list = NULL;
icalcomponent *icalcomp;
ECalComponent *comp = NULL;
/* return null if cache is not a valid Backend Cache. */
g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
- l = e_file_cache_get_objects (E_FILE_CACHE (cache));
- if (!l)
- return NULL;
- for (; l != NULL; l = g_slist_next (l)) {
- comp_str = l->data;
- if (comp_str) {
- icalcomp = icalparser_parse_string (comp_str);
- if (icalcomp) {
+ l = e_file_cache_get_objects (E_FILE_CACHE (cache));
+ if (!l)
+ return NULL;
+ for (; l != NULL; l = g_slist_next (l)) {
+ comp_str = l->data;
+ if (comp_str) {
+ icalcomp = icalparser_parse_string (comp_str);
+ if (icalcomp) {
icalcomponent_kind kind;
kind = icalcomponent_isa (icalcomp);
}
} else
icalcomponent_free (icalcomp);
- }
- }
+ }
+ }
- }
+ }
- return list;
+ return list;
}
/**
e_cal_backend_cache_get_keys (ECalBackendCache *cache)
{
g_return_val_if_fail (E_IS_CAL_BACKEND_CACHE (cache), NULL);
- return e_file_cache_get_keys (E_FILE_CACHE (cache));
+ return e_file_cache_get_keys (E_FILE_CACHE (cache));
}
/**
{
EIntervalTree *tree;
tree = g_object_new (E_TYPE_INTERVALTREE, NULL);
- return tree;
+ return tree;
}
{
SearchContext *ctx = user_data;
- if (!tzid || !tzid[0])
- return NULL;
+ if (!tzid || !tzid[0])
+ return NULL;
else if (!strcmp (tzid, "UTC"))
- return icaltimezone_get_utc_timezone ();
+ return icaltimezone_get_utc_timezone ();
- return e_cal_backend_internal_get_timezone (ctx->backend, tzid);
+ return e_cal_backend_internal_get_timezone (ctx->backend, tzid);
}
/* (occur-in-time-range? START END)
priv = E_CAL_BACKEND_STORE_GET_PRIVATE (store);
if (!(l = e_intervaltree_search (priv->intervaltree, start, end)))
- return NULL;
+ return NULL;
for (; l != NULL; l = g_list_next (l)) {
ECalComponent *comp = l->data;
void
e_cal_backend_notify_auth_required (ECalBackend *backend)
{
- ECalBackendPrivate *priv = backend->priv;
- GList *l;
+ ECalBackendPrivate *priv = backend->priv;
+ GList *l;
- for (l = priv->clients; l; l = l->next)
- e_data_cal_notify_auth_required (l->data);
+ for (l = priv->clients; l; l = l->next)
+ e_data_cal_notify_auth_required (l->data);
}
/**
e_data_cal_notify_query (cal, invocation, EDC_ERROR (Success), path);
- g_free (path);
+ g_free (path);
return TRUE;
}
params = NULL;
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.Calendar",
"auth_required",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.Calendar",
"backend_error",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.Calendar",
"readonly",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.Calendar",
"mode",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_emit_auth_required() to do this.
*/ signals[__AUTH_REQUIRED_SIGNAL] =
g_signal_new ("auth-required",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, auth_required),
- NULL,
- NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE,
- 0);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, auth_required),
+ NULL,
+ NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE,
+ 0);
g_signal_add_emission_hook (signals[__AUTH_REQUIRED_SIGNAL],
- 0,
- signal_emission_hook_cb_auth_required,
+ 0,
+ signal_emission_hook_cb_auth_required,
(gpointer) "auth_required",
- NULL);
+ NULL);
/**
* EGdbusCal::backend-error:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_emit_backend_error() to do this.
*/ signals[__BACKEND_ERROR_SIGNAL] =
g_signal_new ("backend-error",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, backend_error),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__STRING,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, backend_error),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__STRING,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRING);
g_signal_add_emission_hook (signals[__BACKEND_ERROR_SIGNAL],
- 0,
- signal_emission_hook_cb_backend_error,
+ 0,
+ signal_emission_hook_cb_backend_error,
(gpointer) "backend_error",
- NULL);
+ NULL);
/**
* EGdbusCal::readonly:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_emit_readonly() to do this.
*/ signals[__READONLY_SIGNAL] =
g_signal_new ("readonly",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, readonly),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOOLEAN,
- G_TYPE_NONE,
- 1,
- G_TYPE_BOOLEAN);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, readonly),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOOLEAN,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_BOOLEAN);
g_signal_add_emission_hook (signals[__READONLY_SIGNAL],
- 0,
- signal_emission_hook_cb_readonly,
+ 0,
+ signal_emission_hook_cb_readonly,
(gpointer) "readonly",
- NULL);
+ NULL);
/**
* EGdbusCal::mode:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_emit_mode() to do this.
*/ signals[__MODE_SIGNAL] =
g_signal_new ("mode",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, mode),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__INT,
- G_TYPE_NONE,
- 1,
- G_TYPE_INT);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, mode),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__INT,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_INT);
g_signal_add_emission_hook (signals[__MODE_SIGNAL],
- 0,
- signal_emission_hook_cb_mode,
+ 0,
+ signal_emission_hook_cb_mode,
(gpointer) "mode",
- NULL);
+ NULL);
/* GObject signals definitions for D-Bus methods: */
/**
*/
signals[__GET_URI_METHOD] =
g_signal_new ("handle-get-uri",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_uri),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_uri),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-get-cache-dir:
* @object: The exported object emitting the signal.
*/
signals[__GET_CACHE_DIR_METHOD] =
g_signal_new ("handle-get-cache-dir",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_cache_dir),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_cache_dir),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-open:
* @object: The exported object emitting the signal.
*/
signals[__OPEN_METHOD] =
g_signal_new ("handle-open",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_open),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_BOOLEAN_STRING_STRING,
- G_TYPE_BOOLEAN,
- 4,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_BOOLEAN,
- G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_open),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_BOOLEAN_STRING_STRING,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_BOOLEAN,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-refresh:
* @object: The exported object emitting the signal.
*/
signals[__REFRESH_METHOD] =
g_signal_new ("handle-refresh",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_refresh),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_refresh),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-close:
* @object: The exported object emitting the signal.
*/
signals[__CLOSE_METHOD] =
g_signal_new ("handle-close",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_close),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_close),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-remove:
* @object: The exported object emitting the signal.
*/
signals[__REMOVE_METHOD] =
g_signal_new ("handle-remove",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_remove),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_remove),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-is-read-only:
* @object: The exported object emitting the signal.
*/
signals[__IS_READ_ONLY_METHOD] =
g_signal_new ("handle-is-read-only",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_is_read_only),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_is_read_only),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-get-cal-address:
* @object: The exported object emitting the signal.
*/
signals[__GET_CAL_ADDRESS_METHOD] =
g_signal_new ("handle-get-cal-address",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_cal_address),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_cal_address),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-get-alarm-email-address:
* @object: The exported object emitting the signal.
*/
signals[__GET_ALARM_EMAIL_ADDRESS_METHOD] =
g_signal_new ("handle-get-alarm-email-address",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_alarm_email_address),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_alarm_email_address),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-get-ldap-attribute:
* @object: The exported object emitting the signal.
*/
signals[__GET_LDAP_ATTRIBUTE_METHOD] =
g_signal_new ("handle-get-ldap-attribute",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_ldap_attribute),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_ldap_attribute),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-get-scheduling-information:
* @object: The exported object emitting the signal.
*/
signals[__GET_SCHEDULING_INFORMATION_METHOD] =
g_signal_new ("handle-get-scheduling-information",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_scheduling_information),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_scheduling_information),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-set-mode:
* @object: The exported object emitting the signal.
*/
signals[__SET_MODE_METHOD] =
g_signal_new ("handle-set-mode",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_set_mode),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_UINT,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_UINT);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_set_mode),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_UINT,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_UINT);
/**
* EGdbusCal::handle-get-default-object:
* @object: The exported object emitting the signal.
*/
signals[__GET_DEFAULT_OBJECT_METHOD] =
g_signal_new ("handle-get-default-object",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_default_object),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_default_object),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCal::handle-get-object:
* @object: The exported object emitting the signal.
*/
signals[__GET_OBJECT_METHOD] =
g_signal_new ("handle-get-object",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_object),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_object),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-get-object-list:
* @object: The exported object emitting the signal.
*/
signals[__GET_OBJECT_LIST_METHOD] =
g_signal_new ("handle-get-object-list",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_object_list),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_object_list),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-get-changes:
* @object: The exported object emitting the signal.
*/
signals[__GET_CHANGES_METHOD] =
g_signal_new ("handle-get-changes",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_changes),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_changes),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-get-free-busy:
* @object: The exported object emitting the signal.
*/
signals[__GET_FREE_BUSY_METHOD] =
g_signal_new ("handle-get-free-busy",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_free_busy),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_BOXED_UINT_UINT,
- G_TYPE_BOOLEAN,
- 4,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRV,
- G_TYPE_UINT,
- G_TYPE_UINT);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_free_busy),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_BOXED_UINT_UINT,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRV,
+ G_TYPE_UINT,
+ G_TYPE_UINT);
/**
* EGdbusCal::handle-discard-alarm:
* @object: The exported object emitting the signal.
*/
signals[__DISCARD_ALARM_METHOD] =
g_signal_new ("handle-discard-alarm",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_discard_alarm),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_discard_alarm),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-create-object:
* @object: The exported object emitting the signal.
*/
signals[__CREATE_OBJECT_METHOD] =
g_signal_new ("handle-create-object",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_create_object),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_create_object),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-modify-object:
* @object: The exported object emitting the signal.
*/
signals[__MODIFY_OBJECT_METHOD] =
g_signal_new ("handle-modify-object",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_modify_object),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_UINT,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING,
- G_TYPE_UINT);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_modify_object),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_UINT,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING,
+ G_TYPE_UINT);
/**
* EGdbusCal::handle-remove-object:
* @object: The exported object emitting the signal.
*/
signals[__REMOVE_OBJECT_METHOD] =
g_signal_new ("handle-remove-object",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_remove_object),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING_UINT,
- G_TYPE_BOOLEAN,
- 4,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING,
- G_TYPE_STRING,
- G_TYPE_UINT);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_remove_object),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING_UINT,
+ G_TYPE_BOOLEAN,
+ 4,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING,
+ G_TYPE_STRING,
+ G_TYPE_UINT);
/**
* EGdbusCal::handle-receive-objects:
* @object: The exported object emitting the signal.
*/
signals[__RECEIVE_OBJECTS_METHOD] =
g_signal_new ("handle-receive-objects",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_receive_objects),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_receive_objects),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-send-objects:
* @object: The exported object emitting the signal.
*/
signals[__SEND_OBJECTS_METHOD] =
g_signal_new ("handle-send-objects",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_send_objects),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_send_objects),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-get-attachment-list:
* @object: The exported object emitting the signal.
*/
signals[__GET_ATTACHMENT_LIST_METHOD] =
g_signal_new ("handle-get-attachment-list",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_attachment_list),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_attachment_list),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_STRING,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-get-query:
* @object: The exported object emitting the signal.
*/
signals[__GET_QUERY_METHOD] =
g_signal_new ("handle-get-query",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_query),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_query),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-get-timezone:
* @object: The exported object emitting the signal.
*/
signals[__GET_TIMEZONE_METHOD] =
g_signal_new ("handle-get-timezone",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_get_timezone),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_get_timezone),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-add-timezone:
* @object: The exported object emitting the signal.
*/
signals[__ADD_TIMEZONE_METHOD] =
g_signal_new ("handle-add-timezone",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_add_timezone),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_add_timezone),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/**
* EGdbusCal::handle-set-default-timezone:
* @object: The exported object emitting the signal.
*/
signals[__SET_DEFAULT_TIMEZONE_METHOD] =
g_signal_new ("handle-set-default-timezone",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalIface, handle_set_default_timezone),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
- G_TYPE_BOOLEAN,
- 2,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalIface, handle_set_default_timezone),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING,
+ G_TYPE_BOOLEAN,
+ 2,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING);
/* GObject property definitions for D-Bus properties: */
}
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getUri",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_str_uri_copy);
+ out_str_uri_copy);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getUri",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_str_uri_copy);
+ out_str_uri_copy);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getCacheDir",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_dirname);
+ out_dirname);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getCacheDir",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_dirname);
+ out_dirname);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(bss)",
- in_only_if_exists,
- in_username,
- in_password);
+ in_only_if_exists,
+ in_username,
+ in_password);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"open",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(bss)",
- in_only_if_exists,
- in_username,
- in_password);
+ in_only_if_exists,
+ in_username,
+ in_password);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"open",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"refresh",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"refresh",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"close",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"close",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"remove",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"remove",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"isReadOnly",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"isReadOnly",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getCalAddress",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_address);
+ out_address);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getCalAddress",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_address);
+ out_address);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getAlarmEmailAddress",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_address);
+ out_address);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getAlarmEmailAddress",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_address);
+ out_address);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getLdapAttribute",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_address);
+ out_address);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getLdapAttribute",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_address);
+ out_address);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getSchedulingInformation",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_capabilities);
+ out_capabilities);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getSchedulingInformation",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_capabilities);
+ out_capabilities);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(u)",
- in_mode);
+ in_mode);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"setMode",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(u)",
- in_mode);
+ in_mode);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"setMode",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getDefaultObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_object);
+ out_object);
}
g_variant_unref (_result);
_ret = TRUE;
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getDefaultObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_object);
+ out_object);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(ss)",
- in_uid,
- in_rid);
+ in_uid,
+ in_rid);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_object);
+ out_object);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(ss)",
- in_uid,
- in_rid);
+ in_uid,
+ in_rid);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_object);
+ out_object);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_sexp);
+ in_sexp);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getObjectList",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^as)",
- out_objects);
+ out_objects);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_sexp);
+ in_sexp);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getObjectList",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^as)",
- out_objects);
+ out_objects);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_change_id);
+ in_change_id);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getChanges",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^as^as^as)",
- out_additions,
- out_modifications,
- out_removals);
+ out_additions,
+ out_modifications,
+ out_removals);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_change_id);
+ in_change_id);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getChanges",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^as^as^as)",
- out_additions,
- out_modifications,
- out_removals);
+ out_additions,
+ out_modifications,
+ out_removals);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(^asuu)",
- in_user_list,
- in_start,
- in_end);
+ in_user_list,
+ in_start,
+ in_end);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getFreeBusy",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^as)",
- out_freebusy);
+ out_freebusy);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(^asuu)",
- in_user_list,
- in_start,
- in_end);
+ in_user_list,
+ in_start,
+ in_end);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getFreeBusy",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^as)",
- out_freebusy);
+ out_freebusy);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(ss)",
- in_uid,
- in_auid);
+ in_uid,
+ in_auid);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"discardAlarm",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(ss)",
- in_uid,
- in_auid);
+ in_uid,
+ in_auid);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"discardAlarm",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_calobj);
+ in_calobj);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"createObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_uid);
+ out_uid);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_calobj);
+ in_calobj);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"createObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_uid);
+ out_uid);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(su)",
- in_calobj,
- in_mod);
+ in_calobj,
+ in_mod);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"modifyObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(su)",
- in_calobj,
- in_mod);
+ in_calobj,
+ in_mod);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"modifyObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(ssu)",
- in_uid,
- in_rid,
- in_mod);
+ in_uid,
+ in_rid,
+ in_mod);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"removeObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(ssu)",
- in_uid,
- in_rid,
- in_mod);
+ in_uid,
+ in_rid,
+ in_mod);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"removeObject",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_calobj);
+ in_calobj);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"receiveObjects",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_calobj);
+ in_calobj);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"receiveObjects",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_calobj);
+ in_calobj);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"sendObjects",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^ass)",
- out_users,
- out_calobj);
+ out_users,
+ out_calobj);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_calobj);
+ in_calobj);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"sendObjects",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^ass)",
- out_users,
- out_calobj);
+ out_users,
+ out_calobj);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(ss)",
- in_uid,
- in_rid);
+ in_uid,
+ in_rid);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getAttachmentList",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(^as)",
- out_attachments);
+ out_attachments);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(ss)",
- in_uid,
- in_rid);
+ in_uid,
+ in_rid);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getAttachmentList",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(^as)",
- out_attachments);
+ out_attachments);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_sexp);
+ in_sexp);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getQuery",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(o)",
- out_query);
+ out_query);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_sexp);
+ in_sexp);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getQuery",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(o)",
- out_query);
+ out_query);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_tzid);
+ in_tzid);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getTimezone",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(s)",
- out_object);
+ out_object);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_tzid);
+ in_tzid);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getTimezone",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(s)",
- out_object);
+ out_object);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_tz);
+ in_tz);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"addTimezone",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_tz);
+ in_tz);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"addTimezone",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- in_tz);
+ in_tz);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"setDefaultTimezone",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(s)",
- in_tz);
+ in_tz);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"setDefaultTimezone",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_str_uri_copy);
+ out_str_uri_copy);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_dirname);
+ out_dirname);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_address);
+ out_address);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_address);
+ out_address);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_address);
+ out_address);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_capabilities);
+ out_capabilities);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_object);
+ out_object);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_object);
+ out_object);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^as)",
- out_objects);
+ out_objects);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^as^as^as)",
- out_additions,
- out_modifications,
- out_removals);
+ out_additions,
+ out_modifications,
+ out_removals);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^as)",
- out_freebusy);
+ out_freebusy);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_uid);
+ out_uid);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^ass)",
- out_users,
- out_calobj);
+ out_users,
+ out_calobj);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(^as)",
- out_attachments);
+ out_attachments);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(o)",
- out_query);
+ out_query);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
GVariant *_params;
_params = g_variant_new ("(s)",
- out_object);
+ out_object);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
case __GET_URI_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_CACHE_DIR_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __OPEN_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- gboolean arg_only_if_exists;
- const gchar *arg_username;
- const gchar *arg_password;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ gboolean arg_only_if_exists;
+ const gchar *arg_username;
+ const gchar *arg_password;
+ g_variant_get (parameters,
"(b&s&s)",
- &arg_only_if_exists,
- &arg_username,
- &arg_password);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_only_if_exists, arg_username, arg_password, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_only_if_exists,
+ &arg_username,
+ &arg_password);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_only_if_exists, arg_username, arg_password, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __REFRESH_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __CLOSE_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __REMOVE_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __IS_READ_ONLY_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_CAL_ADDRESS_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_ALARM_EMAIL_ADDRESS_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_LDAP_ATTRIBUTE_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_SCHEDULING_INFORMATION_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __SET_MODE_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- guint arg_mode;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ guint arg_mode;
+ g_variant_get (parameters,
"(u)",
- &arg_mode);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_mode, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_mode);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_mode, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_DEFAULT_OBJECT_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_OBJECT_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_uid;
- const gchar *arg_rid;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_uid;
+ const gchar *arg_rid;
+ g_variant_get (parameters,
"(&s&s)",
- &arg_uid,
- &arg_rid);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_uid, arg_rid, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_uid,
+ &arg_rid);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_uid, arg_rid, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_OBJECT_LIST_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_sexp;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_sexp;
+ g_variant_get (parameters,
"(&s)",
- &arg_sexp);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_sexp, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_sexp);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_sexp, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_CHANGES_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_change_id;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_change_id;
+ g_variant_get (parameters,
"(&s)",
- &arg_change_id);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_change_id, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_change_id);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_change_id, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_FREE_BUSY_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar * const *arg_user_list;
- guint arg_start;
- guint arg_end;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar * const *arg_user_list;
+ guint arg_start;
+ guint arg_end;
+ g_variant_get (parameters,
"(^a&suu)",
- &arg_user_list,
- &arg_start,
- &arg_end);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_user_list, arg_start, arg_end, &handled);
- g_free ((gpointer) arg_user_list);
- if (!handled)
- goto not_implemented;
+ &arg_user_list,
+ &arg_start,
+ &arg_end);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_user_list, arg_start, arg_end, &handled);
+ g_free ((gpointer) arg_user_list);
+ if (!handled)
+ goto not_implemented;
}
break;
case __DISCARD_ALARM_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_uid;
- const gchar *arg_auid;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_uid;
+ const gchar *arg_auid;
+ g_variant_get (parameters,
"(&s&s)",
- &arg_uid,
- &arg_auid);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_uid, arg_auid, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_uid,
+ &arg_auid);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_uid, arg_auid, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __CREATE_OBJECT_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_calobj;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_calobj;
+ g_variant_get (parameters,
"(&s)",
- &arg_calobj);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_calobj, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_calobj);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_calobj, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __MODIFY_OBJECT_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_calobj;
- guint arg_mod;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_calobj;
+ guint arg_mod;
+ g_variant_get (parameters,
"(&su)",
- &arg_calobj,
- &arg_mod);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_calobj, arg_mod, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_calobj,
+ &arg_mod);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_calobj, arg_mod, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __REMOVE_OBJECT_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_uid;
- const gchar *arg_rid;
- guint arg_mod;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_uid;
+ const gchar *arg_rid;
+ guint arg_mod;
+ g_variant_get (parameters,
"(&s&su)",
- &arg_uid,
- &arg_rid,
- &arg_mod);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_uid, arg_rid, arg_mod, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_uid,
+ &arg_rid,
+ &arg_mod);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_uid, arg_rid, arg_mod, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __RECEIVE_OBJECTS_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_calobj;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_calobj;
+ g_variant_get (parameters,
"(&s)",
- &arg_calobj);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_calobj, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_calobj);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_calobj, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __SEND_OBJECTS_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_calobj;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_calobj;
+ g_variant_get (parameters,
"(&s)",
- &arg_calobj);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_calobj, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_calobj);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_calobj, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_ATTACHMENT_LIST_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_uid;
- const gchar *arg_rid;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_uid;
+ const gchar *arg_rid;
+ g_variant_get (parameters,
"(&s&s)",
- &arg_uid,
- &arg_rid);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_uid, arg_rid, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_uid,
+ &arg_rid);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_uid, arg_rid, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_QUERY_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_sexp;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_sexp;
+ g_variant_get (parameters,
"(&s)",
- &arg_sexp);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_sexp, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_sexp);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_sexp, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __GET_TIMEZONE_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_tzid;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_tzid;
+ g_variant_get (parameters,
"(&s)",
- &arg_tzid);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_tzid, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_tzid);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_tzid, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __ADD_TIMEZONE_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_tz;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_tz;
+ g_variant_get (parameters,
"(&s)",
- &arg_tz);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_tz, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_tz);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_tz, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __SET_DEFAULT_TIMEZONE_METHOD:
{
- EGdbusCal *object = E_GDBUS_CAL (user_data);
- gboolean handled;
- const gchar *arg_tz;
- g_variant_get (parameters,
+ EGdbusCal *object = E_GDBUS_CAL (user_data);
+ gboolean handled;
+ const gchar *arg_tz;
+ g_variant_get (parameters,
"(&s)",
- &arg_tz);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_tz, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_tz);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_tz, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
default:
not_implemented:
g_dbus_method_invocation_return_error (invocation,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"Method `%s' is not implemented",
- method_name);
+ method_name);
break;
}
};
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
break;
}
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
ret = FALSE;
break;
}
GVariant *cached_value;
cached_value = g_hash_table_lookup (pvc, property_name);
if (cached_value == NULL || !g_variant_equal (cached_value, value))
- {
- g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
+ {
+ g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
g_variant_builder_add (builder, "{sv}", property_name, value);
- has_changes = TRUE;
- }
+ has_changes = TRUE;
+ }
}
if (has_changes)
{
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
g_variant_new ("(sa{sv}as)",
"org.gnome.evolution.dataserver.Calendar",
- builder,
- invalidated_builder),
- NULL);
+ builder,
+ invalidated_builder),
+ NULL);
}
else
{
idle_source = g_idle_source_new ();
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
g_source_set_callback (idle_source,
- emit_notifications_in_idle,
- g_object_ref (object),
- (GDestroyNotify) g_object_unref);
+ emit_notifications_in_idle,
+ g_object_ref (object),
+ (GDestroyNotify) g_object_unref);
idle_id = g_source_attach (idle_source, g_main_context_get_thread_default ());
g_source_unref (idle_source);
g_object_set_data (object, "gdbus-codegen-notification-idle-id", GUINT_TO_POINTER (idle_id));
g_object_set_data_full (G_OBJECT (object), "gdbus-codegen-pvc", (gpointer) pvc, (GDestroyNotify) g_hash_table_unref);
g_signal_connect (object, "notify", G_CALLBACK (on_notify), NULL);
return g_dbus_connection_register_object (connection,
- object_path,
- (GDBusInterfaceInfo *) &_e_gdbus_cal_interface_info,
- &e_gdbus_cal_interface_vtable,
- object,
- (GDestroyNotify) on_object_unregistered,
- error);
+ object_path,
+ (GDBusInterfaceInfo *) &_e_gdbus_cal_interface_info,
+ &e_gdbus_cal_interface_vtable,
+ object,
+ (GDestroyNotify) on_object_unregistered,
+ error);
}
/**
e_gdbus_cal_proxy_init (EGdbusCalProxy *proxy)
{
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy),
- (GDBusInterfaceInfo *) &_e_gdbus_cal_interface_info);
+ (GDBusInterfaceInfo *) &_e_gdbus_cal_interface_info);
}
static void
{
case __AUTH_REQUIRED_SIGNAL:
{
- g_signal_emit (proxy,
- signals[signal_id],
- 0);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0);
}
break;
case __BACKEND_ERROR_SIGNAL:
{
- const gchar *arg_error;
- g_variant_get (parameters,
+ const gchar *arg_error;
+ g_variant_get (parameters,
"(&s)",
- &arg_error);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_error);
+ &arg_error);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_error);
}
break;
case __READONLY_SIGNAL:
{
- gboolean arg_is_readonly;
- g_variant_get (parameters,
+ gboolean arg_is_readonly;
+ g_variant_get (parameters,
"(b)",
- &arg_is_readonly);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_is_readonly);
+ &arg_is_readonly);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_is_readonly);
}
break;
case __MODE_SIGNAL:
{
- gint arg_mode;
- g_variant_get (parameters,
+ gint arg_mode;
+ g_variant_get (parameters,
"(i)",
- &arg_mode);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_mode);
+ &arg_mode);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_mode);
}
break;
"org.freedesktop.DBus.Properties.Set",
g_variant_new ("(ssv)",
"org.gnome.evolution.dataserver.Calendar",
- property_name,
- new_value),
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- NULL,
- (GAsyncReadyCallback) property_set_cb,
- (gpointer) property_name);
+ property_name,
+ new_value),
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ NULL,
+ (GAsyncReadyCallback) property_set_cb,
+ (gpointer) property_name);
g_variant_unref (new_value);
}
{
gname = lookup_property_gname_from_property_name (key);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
for (n = 0; invalidated_properties[n] != NULL; n++)
{
gname = lookup_property_gname_from_property_name (invalidated_properties[n]);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
}
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_CAL_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.Calendar",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_CAL (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_CAL_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.Calendar",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_CAL (initable);
else
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_CAL_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.Calendar",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_CAL (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_CAL_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.Calendar",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_CAL (initable);
else
/* Signal handlers for receiving D-Bus signals: */
void (*auth_required) (
- EGdbusCal *object);
+ EGdbusCal *object);
void (*backend_error) (
- EGdbusCal *object,
- const gchar *arg_error);
+ EGdbusCal *object,
+ const gchar *arg_error);
void (*readonly) (
- EGdbusCal *object,
- gboolean arg_is_readonly);
+ EGdbusCal *object,
+ gboolean arg_is_readonly);
void (*mode) (
- EGdbusCal *object,
- gint arg_mode);
+ EGdbusCal *object,
+ gint arg_mode);
/* Signal handlers for handling D-Bus method calls: */
gboolean (*handle_get_uri) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_cache_dir) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_open) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- gboolean in_only_if_exists,
- const gchar *in_username,
- const gchar *in_password);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ gboolean in_only_if_exists,
+ const gchar *in_username,
+ const gchar *in_password);
gboolean (*handle_refresh) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_close) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_remove) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_is_read_only) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_cal_address) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_alarm_email_address) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_ldap_attribute) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_scheduling_information) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_set_mode) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- guint in_mode);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ guint in_mode);
gboolean (*handle_get_default_object) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_get_object) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_uid,
- const gchar *in_rid);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_uid,
+ const gchar *in_rid);
gboolean (*handle_get_object_list) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_sexp);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_sexp);
gboolean (*handle_get_changes) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_change_id);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_change_id);
gboolean (*handle_get_free_busy) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar * const *in_user_list,
- guint in_start,
- guint in_end);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar * const *in_user_list,
+ guint in_start,
+ guint in_end);
gboolean (*handle_discard_alarm) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_uid,
- const gchar *in_auid);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_uid,
+ const gchar *in_auid);
gboolean (*handle_create_object) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_calobj);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_calobj);
gboolean (*handle_modify_object) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_calobj,
- guint in_mod);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_calobj,
+ guint in_mod);
gboolean (*handle_remove_object) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_uid,
- const gchar *in_rid,
- guint in_mod);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_uid,
+ const gchar *in_rid,
+ guint in_mod);
gboolean (*handle_receive_objects) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_calobj);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_calobj);
gboolean (*handle_send_objects) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_calobj);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_calobj);
gboolean (*handle_get_attachment_list) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_uid,
- const gchar *in_rid);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_uid,
+ const gchar *in_rid);
gboolean (*handle_get_query) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_sexp);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_sexp);
gboolean (*handle_get_timezone) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_tzid);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_tzid);
gboolean (*handle_add_timezone) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_tz);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_tz);
gboolean (*handle_set_default_timezone) (
- EGdbusCal *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_tz);
+ EGdbusCal *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_tz);
};
/* C Bindings for properties */
*/
signals[__GET_CAL_METHOD] =
g_signal_new ("handle-get-cal",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalFactoryIface, handle_get_cal),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_UINT,
- G_TYPE_BOOLEAN,
- 3,
- G_TYPE_DBUS_METHOD_INVOCATION,
- G_TYPE_STRING,
- G_TYPE_UINT);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalFactoryIface, handle_get_cal),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT_STRING_UINT,
+ G_TYPE_BOOLEAN,
+ 3,
+ G_TYPE_DBUS_METHOD_INVOCATION,
+ G_TYPE_STRING,
+ G_TYPE_UINT);
/* GObject property definitions for D-Bus properties: */
}
{
GVariant *_params;
_params = g_variant_new ("(su)",
- in_source,
- in_type);
+ in_source,
+ in_type);
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"getCal",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
{
g_variant_get (_result,
"(o)",
- out_path);
+ out_path);
}
g_variant_unref (_result);
_ret = TRUE;
GVariant *_params;
GVariant *_result;
_params = g_variant_new ("(su)",
- in_source,
- in_type);
+ in_source,
+ in_type);
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"getCal",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
{
g_variant_get (_result,
"(o)",
- out_path);
+ out_path);
}
g_variant_unref (_result);
_ret = TRUE;
{
GVariant *_params;
_params = g_variant_new ("(o)",
- out_path);
+ out_path);
g_dbus_method_invocation_return_value (invocation, _params);
}
{
case __GET_CAL_METHOD:
{
- EGdbusCalFactory *object = E_GDBUS_CAL_FACTORY (user_data);
- gboolean handled;
- const gchar *arg_source;
- guint arg_type;
- g_variant_get (parameters,
+ EGdbusCalFactory *object = E_GDBUS_CAL_FACTORY (user_data);
+ gboolean handled;
+ const gchar *arg_source;
+ guint arg_type;
+ g_variant_get (parameters,
"(&su)",
- &arg_source,
- &arg_type);
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, arg_source, arg_type, &handled);
- if (!handled)
- goto not_implemented;
+ &arg_source,
+ &arg_type);
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, arg_source, arg_type, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
default:
not_implemented:
g_dbus_method_invocation_return_error (invocation,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"Method `%s' is not implemented",
- method_name);
+ method_name);
break;
}
};
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
break;
}
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
ret = FALSE;
break;
}
GVariant *cached_value;
cached_value = g_hash_table_lookup (pvc, property_name);
if (cached_value == NULL || !g_variant_equal (cached_value, value))
- {
- g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
+ {
+ g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
g_variant_builder_add (builder, "{sv}", property_name, value);
- has_changes = TRUE;
- }
+ has_changes = TRUE;
+ }
}
if (has_changes)
{
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
g_variant_new ("(sa{sv}as)",
"org.gnome.evolution.dataserver.CalendarFactory",
- builder,
- invalidated_builder),
- NULL);
+ builder,
+ invalidated_builder),
+ NULL);
}
else
{
idle_source = g_idle_source_new ();
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
g_source_set_callback (idle_source,
- emit_notifications_in_idle,
- g_object_ref (object),
- (GDestroyNotify) g_object_unref);
+ emit_notifications_in_idle,
+ g_object_ref (object),
+ (GDestroyNotify) g_object_unref);
idle_id = g_source_attach (idle_source, g_main_context_get_thread_default ());
g_source_unref (idle_source);
g_object_set_data (object, "gdbus-codegen-notification-idle-id", GUINT_TO_POINTER (idle_id));
g_object_set_data_full (G_OBJECT (object), "gdbus-codegen-pvc", (gpointer) pvc, (GDestroyNotify) g_hash_table_unref);
g_signal_connect (object, "notify", G_CALLBACK (on_notify), NULL);
return g_dbus_connection_register_object (connection,
- object_path,
- (GDBusInterfaceInfo *) &_e_gdbus_cal_factory_interface_info,
- &e_gdbus_cal_factory_interface_vtable,
- object,
- (GDestroyNotify) on_object_unregistered,
- error);
+ object_path,
+ (GDBusInterfaceInfo *) &_e_gdbus_cal_factory_interface_info,
+ &e_gdbus_cal_factory_interface_vtable,
+ object,
+ (GDestroyNotify) on_object_unregistered,
+ error);
}
/**
e_gdbus_cal_factory_proxy_init (EGdbusCalFactoryProxy *proxy)
{
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy),
- (GDBusInterfaceInfo *) &_e_gdbus_cal_factory_interface_info);
+ (GDBusInterfaceInfo *) &_e_gdbus_cal_factory_interface_info);
}
static void
"org.freedesktop.DBus.Properties.Set",
g_variant_new ("(ssv)",
"org.gnome.evolution.dataserver.CalendarFactory",
- property_name,
- new_value),
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- NULL,
- (GAsyncReadyCallback) property_set_cb,
- (gpointer) property_name);
+ property_name,
+ new_value),
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ NULL,
+ (GAsyncReadyCallback) property_set_cb,
+ (gpointer) property_name);
g_variant_unref (new_value);
}
{
gname = lookup_property_gname_from_property_name (key);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
for (n = 0; invalidated_properties[n] != NULL; n++)
{
gname = lookup_property_gname_from_property_name (invalidated_properties[n]);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
}
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_CAL_FACTORY_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.CalendarFactory",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_CAL_FACTORY (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_CAL_FACTORY_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.CalendarFactory",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_CAL_FACTORY (initable);
else
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_CAL_FACTORY_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.CalendarFactory",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_CAL_FACTORY (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_CAL_FACTORY_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.CalendarFactory",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_CAL_FACTORY (initable);
else
/* Signal handlers for handling D-Bus method calls: */
gboolean (*handle_get_cal) (
- EGdbusCalFactory *object,
- GDBusMethodInvocation *invocation,
- const gchar *in_source,
- guint in_type);
+ EGdbusCalFactory *object,
+ GDBusMethodInvocation *invocation,
+ const gchar *in_source,
+ guint in_type);
};
/* C Bindings for properties */
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.CalendarView",
"ObjectsAdded",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.CalendarView",
"ObjectsModified",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.CalendarView",
"ObjectsRemoved",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.CalendarView",
"Progress",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
g_variant_builder_unref (builder);
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.gnome.evolution.dataserver.CalendarView",
"Done",
- params,
- NULL);
+ params,
+ NULL);
out:
return TRUE;
}
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_view_emit_objects_added() to do this.
*/ signals[__OBJECTS_ADDED_SIGNAL] =
g_signal_new ("objects-added",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalViewIface, objects_added),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRV);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalViewIface, objects_added),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRV);
g_signal_add_emission_hook (signals[__OBJECTS_ADDED_SIGNAL],
- 0,
- signal_emission_hook_cb_objects_added,
+ 0,
+ signal_emission_hook_cb_objects_added,
(gpointer) "ObjectsAdded",
- NULL);
+ NULL);
/**
* EGdbusCalView::objects-modified:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_view_emit_objects_modified() to do this.
*/ signals[__OBJECTS_MODIFIED_SIGNAL] =
g_signal_new ("objects-modified",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalViewIface, objects_modified),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRV);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalViewIface, objects_modified),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRV);
g_signal_add_emission_hook (signals[__OBJECTS_MODIFIED_SIGNAL],
- 0,
- signal_emission_hook_cb_objects_modified,
+ 0,
+ signal_emission_hook_cb_objects_modified,
(gpointer) "ObjectsModified",
- NULL);
+ NULL);
/**
* EGdbusCalView::objects-removed:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_view_emit_objects_removed() to do this.
*/ signals[__OBJECTS_REMOVED_SIGNAL] =
g_signal_new ("objects-removed",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalViewIface, objects_removed),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
- G_TYPE_NONE,
- 1,
- G_TYPE_STRV);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalViewIface, objects_removed),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__BOXED,
+ G_TYPE_NONE,
+ 1,
+ G_TYPE_STRV);
g_signal_add_emission_hook (signals[__OBJECTS_REMOVED_SIGNAL],
- 0,
- signal_emission_hook_cb_objects_removed,
+ 0,
+ signal_emission_hook_cb_objects_removed,
(gpointer) "ObjectsRemoved",
- NULL);
+ NULL);
/**
* EGdbusCalView::progress:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_view_emit_progress() to do this.
*/ signals[__PROGRESS_SIGNAL] =
g_signal_new ("progress",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalViewIface, progress),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__STRING_UINT,
- G_TYPE_NONE,
- 2,
- G_TYPE_STRING,
- G_TYPE_UINT);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalViewIface, progress),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__STRING_UINT,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_STRING,
+ G_TYPE_UINT);
g_signal_add_emission_hook (signals[__PROGRESS_SIGNAL],
- 0,
- signal_emission_hook_cb_progress,
+ 0,
+ signal_emission_hook_cb_progress,
(gpointer) "Progress",
- NULL);
+ NULL);
/**
* EGdbusCalView::done:
* On exported objects, emitting this signal causes the actual D-Bus signal to be emitted. You can use e_gdbus_cal_view_emit_done() to do this.
*/ signals[__DONE_SIGNAL] =
g_signal_new ("done",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalViewIface, done),
- NULL,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_VOID__UINT_STRING,
- G_TYPE_NONE,
- 2,
- G_TYPE_UINT,
- G_TYPE_STRING);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalViewIface, done),
+ NULL,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_VOID__UINT_STRING,
+ G_TYPE_NONE,
+ 2,
+ G_TYPE_UINT,
+ G_TYPE_STRING);
g_signal_add_emission_hook (signals[__DONE_SIGNAL],
- 0,
- signal_emission_hook_cb_done,
+ 0,
+ signal_emission_hook_cb_done,
(gpointer) "Done",
- NULL);
+ NULL);
/* GObject signals definitions for D-Bus methods: */
/**
*/
signals[__START_METHOD] =
g_signal_new ("handle-start",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalViewIface, handle_start),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalViewIface, handle_start),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCalView::handle-stop:
* @object: The exported object emitting the signal.
*/
signals[__STOP_METHOD] =
g_signal_new ("handle-stop",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalViewIface, handle_stop),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalViewIface, handle_stop),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/**
* EGdbusCalView::handle-dispose:
*/
signals[__DISPOSE_METHOD] =
g_signal_new ("handle-dispose",
- G_TYPE_FROM_INTERFACE (iface),
- G_SIGNAL_RUN_LAST,
- G_STRUCT_OFFSET (EGdbusCalViewIface, handle_dispose),
- g_signal_accumulator_true_handled,
- NULL,
- _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
- G_TYPE_BOOLEAN,
- 1,
- G_TYPE_DBUS_METHOD_INVOCATION);
+ G_TYPE_FROM_INTERFACE (iface),
+ G_SIGNAL_RUN_LAST,
+ G_STRUCT_OFFSET (EGdbusCalViewIface, handle_dispose),
+ g_signal_accumulator_true_handled,
+ NULL,
+ _e_gdbus_gdbus_cclosure_marshaller_BOOLEAN__OBJECT,
+ G_TYPE_BOOLEAN,
+ 1,
+ G_TYPE_DBUS_METHOD_INVOCATION);
/* GObject property definitions for D-Bus properties: */
}
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"start",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"start",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"stop",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"stop",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
_params = NULL;
g_dbus_proxy_call (G_DBUS_PROXY (proxy),
"dispose",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- callback,
- user_data);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ callback,
+ user_data);
}
/**
_params = NULL;
_result = g_dbus_proxy_call_sync (G_DBUS_PROXY (proxy),
"dispose",
- _params,
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- cancellable,
- error);
+ _params,
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ cancellable,
+ error);
if (_result == NULL)
goto _out;
g_variant_unref (_result);
{
case __START_METHOD:
{
- EGdbusCalView *object = E_GDBUS_CAL_VIEW (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCalView *object = E_GDBUS_CAL_VIEW (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __STOP_METHOD:
{
- EGdbusCalView *object = E_GDBUS_CAL_VIEW (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCalView *object = E_GDBUS_CAL_VIEW (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
case __DISPOSE_METHOD:
{
- EGdbusCalView *object = E_GDBUS_CAL_VIEW (user_data);
- gboolean handled;
- g_signal_emit (object,
- signals[method_id],
- 0, invocation, &handled);
- if (!handled)
- goto not_implemented;
+ EGdbusCalView *object = E_GDBUS_CAL_VIEW (user_data);
+ gboolean handled;
+ g_signal_emit (object,
+ signals[method_id],
+ 0, invocation, &handled);
+ if (!handled)
+ goto not_implemented;
}
break;
default:
not_implemented:
g_dbus_method_invocation_return_error (invocation,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"Method `%s' is not implemented",
- method_name);
+ method_name);
break;
}
};
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
break;
}
{
default:
g_set_error (error,
- G_DBUS_ERROR,
- G_DBUS_ERROR_NOT_SUPPORTED,
+ G_DBUS_ERROR,
+ G_DBUS_ERROR_NOT_SUPPORTED,
"This implementation does not support property `%s'",
- property_name);
+ property_name);
ret = FALSE;
break;
}
GVariant *cached_value;
cached_value = g_hash_table_lookup (pvc, property_name);
if (cached_value == NULL || !g_variant_equal (cached_value, value))
- {
- g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
+ {
+ g_hash_table_insert (pvc, (gpointer) property_name, (gpointer) g_variant_ref (value));
g_variant_builder_add (builder, "{sv}", property_name, value);
- has_changes = TRUE;
- }
+ has_changes = TRUE;
+ }
}
if (has_changes)
{
g_dbus_connection_emit_signal (connection,
- NULL,
- path,
+ NULL,
+ path,
"org.freedesktop.DBus.Properties",
"PropertiesChanged",
g_variant_new ("(sa{sv}as)",
"org.gnome.evolution.dataserver.CalendarView",
- builder,
- invalidated_builder),
- NULL);
+ builder,
+ invalidated_builder),
+ NULL);
}
else
{
idle_source = g_idle_source_new ();
g_source_set_priority (idle_source, G_PRIORITY_DEFAULT);
g_source_set_callback (idle_source,
- emit_notifications_in_idle,
- g_object_ref (object),
- (GDestroyNotify) g_object_unref);
+ emit_notifications_in_idle,
+ g_object_ref (object),
+ (GDestroyNotify) g_object_unref);
idle_id = g_source_attach (idle_source, g_main_context_get_thread_default ());
g_source_unref (idle_source);
g_object_set_data (object, "gdbus-codegen-notification-idle-id", GUINT_TO_POINTER (idle_id));
g_object_set_data_full (G_OBJECT (object), "gdbus-codegen-pvc", (gpointer) pvc, (GDestroyNotify) g_hash_table_unref);
g_signal_connect (object, "notify", G_CALLBACK (on_notify), NULL);
return g_dbus_connection_register_object (connection,
- object_path,
- (GDBusInterfaceInfo *) &_e_gdbus_cal_view_interface_info,
- &e_gdbus_cal_view_interface_vtable,
- object,
- (GDestroyNotify) on_object_unregistered,
- error);
+ object_path,
+ (GDBusInterfaceInfo *) &_e_gdbus_cal_view_interface_info,
+ &e_gdbus_cal_view_interface_vtable,
+ object,
+ (GDestroyNotify) on_object_unregistered,
+ error);
}
/**
e_gdbus_cal_view_proxy_init (EGdbusCalViewProxy *proxy)
{
g_dbus_proxy_set_interface_info (G_DBUS_PROXY (proxy),
- (GDBusInterfaceInfo *) &_e_gdbus_cal_view_interface_info);
+ (GDBusInterfaceInfo *) &_e_gdbus_cal_view_interface_info);
}
static void
{
case __OBJECTS_ADDED_SIGNAL:
{
- const gchar * const *arg_objects;
- g_variant_get (parameters,
+ const gchar * const *arg_objects;
+ g_variant_get (parameters,
"(^a&s)",
- &arg_objects);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_objects);
- g_free ((gpointer) arg_objects);
+ &arg_objects);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_objects);
+ g_free ((gpointer) arg_objects);
}
break;
case __OBJECTS_MODIFIED_SIGNAL:
{
- const gchar * const *arg_objects;
- g_variant_get (parameters,
+ const gchar * const *arg_objects;
+ g_variant_get (parameters,
"(^a&s)",
- &arg_objects);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_objects);
- g_free ((gpointer) arg_objects);
+ &arg_objects);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_objects);
+ g_free ((gpointer) arg_objects);
}
break;
case __OBJECTS_REMOVED_SIGNAL:
{
- const gchar * const *arg_ids;
- g_variant_get (parameters,
+ const gchar * const *arg_ids;
+ g_variant_get (parameters,
"(^a&s)",
- &arg_ids);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_ids);
- g_free ((gpointer) arg_ids);
+ &arg_ids);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_ids);
+ g_free ((gpointer) arg_ids);
}
break;
case __PROGRESS_SIGNAL:
{
- const gchar *arg_message;
- guint arg_progress;
- g_variant_get (parameters,
+ const gchar *arg_message;
+ guint arg_progress;
+ g_variant_get (parameters,
"(&su)",
- &arg_message,
- &arg_progress);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_message, arg_progress);
+ &arg_message,
+ &arg_progress);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_message, arg_progress);
}
break;
case __DONE_SIGNAL:
{
- guint arg_status;
- const gchar *arg_message;
- g_variant_get (parameters,
+ guint arg_status;
+ const gchar *arg_message;
+ g_variant_get (parameters,
"(u&s)",
- &arg_status,
- &arg_message);
- g_signal_emit (proxy,
- signals[signal_id],
- 0, arg_status, arg_message);
+ &arg_status,
+ &arg_message);
+ g_signal_emit (proxy,
+ signals[signal_id],
+ 0, arg_status, arg_message);
}
break;
"org.freedesktop.DBus.Properties.Set",
g_variant_new ("(ssv)",
"org.gnome.evolution.dataserver.CalendarView",
- property_name,
- new_value),
- G_DBUS_CALL_FLAGS_NONE,
- G_MAXINT,
- NULL,
- (GAsyncReadyCallback) property_set_cb,
- (gpointer) property_name);
+ property_name,
+ new_value),
+ G_DBUS_CALL_FLAGS_NONE,
+ G_MAXINT,
+ NULL,
+ (GAsyncReadyCallback) property_set_cb,
+ (gpointer) property_name);
g_variant_unref (new_value);
}
{
gname = lookup_property_gname_from_property_name (key);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
for (n = 0; invalidated_properties[n] != NULL; n++)
{
gname = lookup_property_gname_from_property_name (invalidated_properties[n]);
if (gname != NULL)
- g_object_notify (G_OBJECT (proxy), gname);
+ g_object_notify (G_OBJECT (proxy), gname);
}
}
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_CAL_VIEW_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.CalendarView",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_CAL_VIEW (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_CAL_VIEW_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-connection", connection,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.CalendarView",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_CAL_VIEW (initable);
else
gpointer user_data)
{
g_async_initable_new_async (E_GDBUS_TYPE_CAL_VIEW_PROXY,
- G_PRIORITY_DEFAULT,
- cancellable,
- callback,
- user_data,
+ G_PRIORITY_DEFAULT,
+ cancellable,
+ callback,
+ user_data,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.CalendarView",
- NULL);
+ NULL);
}
/**
source_object = g_async_result_get_source_object (res);
g_assert (source_object != NULL);
object = g_async_initable_new_finish (G_ASYNC_INITABLE (source_object),
- res,
- error);
+ res,
+ error);
g_object_unref (source_object);
if (object != NULL)
return E_GDBUS_CAL_VIEW (object);
{
GInitable *initable;
initable = g_initable_new (E_GDBUS_TYPE_CAL_VIEW_PROXY,
- cancellable,
- error,
+ cancellable,
+ error,
"g-flags", flags,
"g-name", name,
"g-bus-type", bus_type,
"g-object-path", object_path,
"g-interface-name", "org.gnome.evolution.dataserver.CalendarView",
- NULL);
+ NULL);
if (initable != NULL)
return E_GDBUS_CAL_VIEW (initable);
else
/* Signal handlers for receiving D-Bus signals: */
void (*objects_added) (
- EGdbusCalView *object,
- const gchar * const *arg_objects);
+ EGdbusCalView *object,
+ const gchar * const *arg_objects);
void (*objects_modified) (
- EGdbusCalView *object,
- const gchar * const *arg_objects);
+ EGdbusCalView *object,
+ const gchar * const *arg_objects);
void (*objects_removed) (
- EGdbusCalView *object,
- const gchar * const *arg_ids);
+ EGdbusCalView *object,
+ const gchar * const *arg_ids);
void (*progress) (
- EGdbusCalView *object,
- const gchar *arg_message,
- guint arg_progress);
+ EGdbusCalView *object,
+ const gchar *arg_message,
+ guint arg_progress);
void (*done) (
- EGdbusCalView *object,
- guint arg_status,
- const gchar *arg_message);
+ EGdbusCalView *object,
+ guint arg_status,
+ const gchar *arg_message);
/* Signal handlers for handling D-Bus method calls: */
gboolean (*handle_start) (
- EGdbusCalView *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCalView *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_stop) (
- EGdbusCalView *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCalView *object,
+ GDBusMethodInvocation *invocation);
gboolean (*handle_dispose) (
- EGdbusCalView *object,
- GDBusMethodInvocation *invocation);
+ EGdbusCalView *object,
+ GDBusMethodInvocation *invocation);
};
/* C Bindings for properties */
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING_UINT) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- guint arg_3,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ guint arg_3,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_STRING_UINT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING_UINT) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- g_marshal_value_peek_uint (param_values + 3),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_uint (param_values + 3),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__STRING_UINT) (gpointer data1,
- gpointer arg_1,
- guint arg_2,
- gpointer data2);
+ gpointer arg_1,
+ guint arg_2,
+ gpointer data2);
register GMarshalFunc_VOID__STRING_UINT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__STRING_UINT) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_string (param_values + 1),
- g_marshal_value_peek_uint (param_values + 2),
- data2);
+ g_marshal_value_peek_string (param_values + 1),
+ g_marshal_value_peek_uint (param_values + 2),
+ data2);
}
/* VOID:UINT,STRING (e-gdbus-marshallers.list:4) */
gpointer marshal_data)
{
typedef void (*GMarshalFunc_VOID__UINT_STRING) (gpointer data1,
- guint arg_1,
- gpointer arg_2,
- gpointer data2);
+ guint arg_1,
+ gpointer arg_2,
+ gpointer data2);
register GMarshalFunc_VOID__UINT_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_VOID__UINT_STRING) (marshal_data ? marshal_data : cc->callback);
callback (data1,
- g_marshal_value_peek_uint (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- data2);
+ g_marshal_value_peek_uint (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ data2);
}
/* BOOLEAN:OBJECT (e-gdbus-marshallers.list:5) */
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT) (gpointer data1,
- gpointer arg_1,
- gpointer data2);
+ gpointer arg_1,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_BOOLEAN_STRING_STRING) (gpointer data1,
- gpointer arg_1,
- gboolean arg_2,
- gpointer arg_3,
- gpointer arg_4,
- gpointer data2);
+ gpointer arg_1,
+ gboolean arg_2,
+ gpointer arg_3,
+ gpointer arg_4,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_BOOLEAN_STRING_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_BOOLEAN_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_boolean (param_values + 2),
- g_marshal_value_peek_string (param_values + 3),
- g_marshal_value_peek_string (param_values + 4),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_boolean (param_values + 2),
+ g_marshal_value_peek_string (param_values + 3),
+ g_marshal_value_peek_string (param_values + 4),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_UINT) (gpointer data1,
- gpointer arg_1,
- guint arg_2,
- gpointer data2);
+ gpointer arg_1,
+ guint arg_2,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_UINT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_UINT) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_uint (param_values + 2),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_uint (param_values + 2),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer arg_3,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer arg_3,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- g_marshal_value_peek_string (param_values + 3),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_string (param_values + 3),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_STRING callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_BOXED_UINT_UINT) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- guint arg_3,
- guint arg_4,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ guint arg_3,
+ guint arg_4,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_BOXED_UINT_UINT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_BOXED_UINT_UINT) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_boxed (param_values + 2),
- g_marshal_value_peek_uint (param_values + 3),
- g_marshal_value_peek_uint (param_values + 4),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_boxed (param_values + 2),
+ g_marshal_value_peek_uint (param_values + 3),
+ g_marshal_value_peek_uint (param_values + 4),
+ data2);
g_value_set_boolean (return_value, v_return);
}
gpointer marshal_data)
{
typedef gboolean (*GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING_UINT) (gpointer data1,
- gpointer arg_1,
- gpointer arg_2,
- gpointer arg_3,
- guint arg_4,
- gpointer data2);
+ gpointer arg_1,
+ gpointer arg_2,
+ gpointer arg_3,
+ guint arg_4,
+ gpointer data2);
register GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING_UINT callback;
register GCClosure *cc = (GCClosure*) closure;
register gpointer data1, data2;
callback = (GMarshalFunc_BOOLEAN__OBJECT_STRING_STRING_UINT) (marshal_data ? marshal_data : cc->callback);
v_return = callback (data1,
- g_marshal_value_peek_object (param_values + 1),
- g_marshal_value_peek_string (param_values + 2),
- g_marshal_value_peek_string (param_values + 3),
- g_marshal_value_peek_uint (param_values + 4),
- data2);
+ g_marshal_value_peek_object (param_values + 1),
+ g_marshal_value_peek_string (param_values + 2),
+ g_marshal_value_peek_string (param_values + 3),
+ g_marshal_value_peek_uint (param_values + 4),
+ data2);
g_value_set_boolean (return_value, v_return);
}
ecal_test_utils_cal_new_from_uri (const gchar *uri,
ECalSourceType type)
{
- ECal *cal;
+ ECal *cal;
test_print ("loading calendar '%s'\n", uri);
- cal = e_cal_new_from_uri (uri, type);
- if (!cal)
+ cal = e_cal_new_from_uri (uri, type);
+ if (!cal)
g_error ("failed to create calendar: `%s'", uri);
- return cal;
+ return cal;
}
ECal*
ecal_test_utils_cal_new_temp (gchar **uri,
ECalSourceType type)
{
- ECal *cal;
- gchar *file_template;
- gchar *uri_result;
+ ECal *cal;
+ gchar *file_template;
+ gchar *uri_result;
- file_template = g_build_filename (g_get_tmp_dir (),
+ file_template = g_build_filename (g_get_tmp_dir (),
"ecal-test-XXXXXX/", NULL);
- g_mkstemp (file_template);
+ g_mkstemp (file_template);
uri_result = g_strconcat ("local:", file_template, NULL);
- if (!uri_result) {
+ if (!uri_result) {
g_error ("failed to convert %s to a 'local:' URI", file_template);
- }
- g_free (file_template);
+ }
+ g_free (file_template);
cal = ecal_test_utils_cal_new_from_uri (uri_result, type);
- if (uri)
+ if (uri)
*uri = g_strdup (uri_result);
- g_free (uri_result);
+ g_free (uri_result);
- return cal;
+ return cal;
}
void
ecal_test_utils_cal_open (ECal *cal,
gboolean only_if_exists)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_cal_open (cal, only_if_exists, &error)) {
- const gchar *uri;
+ if (!e_cal_open (cal, only_if_exists, &error)) {
+ const gchar *uri;
- uri = e_cal_get_uri (cal);
+ uri = e_cal_get_uri (cal);
g_warning ("failed to open calendar: `%s': %s", uri,
- error->message);
- exit (1);
- }
+ error->message);
+ exit (1);
+ }
}
static void
} else if (error) {
g_warning ("failed to asynchronously remove the calendar: "
"status %d (%s)", error->code, error->message);
- exit (1);
- }
+ exit (1);
+ }
closure->cal = cal;
test_print ("successfully asynchronously removed the temporary "
"calendar\n");
- if (closure)
- (*closure->cb) (closure);
+ if (closure)
+ (*closure->cb) (closure);
g_signal_handlers_disconnect_by_func (cal, open_ex_cb, closure);
g_free (closure);
GSourceFunc callback,
gpointer user_data)
{
- ECalTestClosure *closure;
+ ECalTestClosure *closure;
- closure = g_new0 (ECalTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
+ closure = g_new0 (ECalTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
g_signal_connect (G_OBJECT (cal), "cal_opened_ex", G_CALLBACK (open_ex_cb), closure);
e_cal_open_async (cal, only_if_exists);
void
ecal_test_utils_cal_remove (ECal *cal)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_cal_remove (cal, &error)) {
+ if (!e_cal_remove (cal, &error)) {
g_warning ("failed to remove calendar; %s\n", error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully removed the temporary calendar\n");
- g_object_unref (cal);
+ g_object_unref (cal);
}
gchar *
ecal_test_utils_cal_get_alarm_email_address (ECal *cal)
{
- GError *error = NULL;
+ GError *error = NULL;
gchar *address = NULL;
- if (!e_cal_get_alarm_email_address (cal, &address, &error)) {
+ if (!e_cal_get_alarm_email_address (cal, &address, &error)) {
g_warning ("failed to get alarm email address; %s\n", error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully got the alarm email address\n");
return address;
gchar *
ecal_test_utils_cal_get_cal_address (ECal *cal)
{
- GError *error = NULL;
+ GError *error = NULL;
gchar *address = NULL;
- if (!e_cal_get_cal_address (cal, &address, &error)) {
+ if (!e_cal_get_cal_address (cal, &address, &error)) {
g_warning ("failed to get calendar address; %s\n", error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully got the calendar address\n");
return address;
gchar *
ecal_test_utils_cal_get_ldap_attribute (ECal *cal)
{
- GError *error = NULL;
+ GError *error = NULL;
gchar *attr = NULL;
- if (!e_cal_get_ldap_attribute (cal, &attr, &error)) {
+ if (!e_cal_get_ldap_attribute (cal, &attr, &error)) {
g_warning ("failed to get ldap attribute; %s\n", error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully got the ldap attribute\n");
return attr;
" No organizer required: %s\n"
" Delegate to many: %s\n"
" Has unaccepted meeting: %s\n"
- ,
+ ,
b2s (e_cal_get_one_alarm_only (cal)),
b2s (e_cal_get_organizer_must_attend (cal)),
b2s (e_cal_get_organizer_must_accept (cal)),
uid_a = icalcomponent_get_uid (a);
uid_b = icalcomponent_get_uid (b);
- if (g_strcmp0 (uid_a, uid_b)) {
+ if (g_strcmp0 (uid_a, uid_b)) {
g_error ("icomponents not equal:\n"
" uid A: '%s'\n"
" uid b: '%s'\n",
uid_a, uid_b);
- }
+ }
}
void
ical_a = e_cal_component_get_icalcomponent (a);
ical_b = e_cal_component_get_icalcomponent (b);
- ecal_test_utils_cal_assert_objects_equal_shallow (ical_a, ical_b);
+ ecal_test_utils_cal_assert_objects_equal_shallow (ical_a, ical_b);
/* Dumping icalcomp into a string is not useful as the retrieved object
* has some generated information like timestamps. We compare
* member values we set during creation*/
- g_assert (e_cal_component_event_dates_match (a, b));
+ g_assert (e_cal_component_event_dates_match (a, b));
e_cal_component_get_transparency (a, &transp_a);
e_cal_component_get_transparency (b, &transp_b);
ecal_test_utils_cal_get_object (ECal *cal,
const gchar *uid)
{
- GError *error = NULL;
+ GError *error = NULL;
icalcomponent *component = NULL;
- if (!e_cal_get_object (cal, uid, NULL, &component, &error)) {
+ if (!e_cal_get_object (cal, uid, NULL, &component, &error)) {
g_warning ("failed to get icalcomponent object '%s'; %s\n", uid, error->message);
- exit (1);
- }
- if (!icalcomponent_is_valid (component)) {
+ exit (1);
+ }
+ if (!icalcomponent_is_valid (component)) {
g_warning ("retrieved icalcomponent is invalid\n");
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully got the icalcomponent object '%s'\n", uid);
return component;
icalcomponent *component,
CalObjModType mod_type)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!icalcomponent_is_valid (component)) {
+ if (!icalcomponent_is_valid (component)) {
g_warning (G_STRLOC ": icalcomponent argument is invalid\n");
- exit (1);
- }
- if (!e_cal_modify_object (cal, component, mod_type, &error)) {
+ exit (1);
+ }
+ if (!e_cal_modify_object (cal, component, mod_type, &error)) {
g_warning ("failed to modify icalcomponent object; %s\n", error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully modified the icalcomponent object\n");
}
ecal_test_utils_cal_remove_object (ECal *cal,
const gchar *uid)
{
- GError *error = NULL;
+ GError *error = NULL;
- if (!e_cal_remove_object (cal, uid, &error)) {
+ if (!e_cal_remove_object (cal, uid, &error)) {
g_warning ("failed to remove icalcomponent object '%s'; %s\n", uid, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully remoed the icalcomponent object '%s'\n", uid);
}
icalcomponent*
ecal_test_utils_cal_get_default_object (ECal *cal)
{
- GError *error = NULL;
+ GError *error = NULL;
icalcomponent *component = NULL;
- if (!e_cal_get_default_object (cal, &component, &error)) {
+ if (!e_cal_get_default_object (cal, &component, &error)) {
g_warning ("failed to get default icalcomponent object; %s\n", error->message);
- exit (1);
- }
- if (!icalcomponent_is_valid (component)) {
+ exit (1);
+ }
+ if (!icalcomponent_is_valid (component)) {
g_warning ("default icalcomponent is invalid\n");
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully got the default icalcomponent object\n");
return component;
ecal_test_utils_cal_get_object_list (ECal *cal,
const gchar *query)
{
- GError *error = NULL;
+ GError *error = NULL;
GList *objects = NULL;
- if (!e_cal_get_object_list (cal, query, &objects, &error)) {
+ if (!e_cal_get_object_list (cal, query, &objects, &error)) {
g_warning ("failed to get list of icalcomponent objects for query '%s'; %s\n", query, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully got list of icalcomponent objects for the query '%s'\n", query);
return objects;
ecal_test_utils_cal_get_objects_for_uid (ECal *cal,
const gchar *uid)
{
- GError *error = NULL;
+ GError *error = NULL;
GList *objects = NULL;
- if (!e_cal_get_objects_for_uid (cal, uid, &objects, &error)) {
+ if (!e_cal_get_objects_for_uid (cal, uid, &objects, &error)) {
g_warning ("failed to get icalcomponent objects for UID '%s'; %s\n", uid, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully got objects for the icalcomponent with UID '%s'\n", uid);
return objects;
ecal_test_utils_cal_create_object (ECal *cal,
icalcomponent *component)
{
- GError *error = NULL;
+ GError *error = NULL;
gchar *uid = NULL;
gchar *ical_string = NULL;
- if (!icalcomponent_is_valid (component)) {
+ if (!icalcomponent_is_valid (component)) {
g_warning ("supplied icalcomponent is invalid\n");
- exit (1);
- }
+ exit (1);
+ }
- if (!e_cal_create_object (cal, component, &uid, &error)) {
+ if (!e_cal_create_object (cal, component, &uid, &error)) {
g_warning ("failed to get create an icalcomponent object; %s\n", error->message);
- exit (1);
- }
+ exit (1);
+ }
ical_string = icalcomponent_as_ical_string (component);
test_print ("successfully created icalcomponent object '%s'\n%s\n", uid,
} else if (status != E_CALENDAR_STATUS_OK) {
g_warning ("failed to asynchronously remove the calendar: "
"status %d", status);
- exit (1);
- }
+ exit (1);
+ }
closure->mode = mode;
test_print ("successfully set the calendar mode to %d\n", mode);
- if (closure)
- (*closure->cb) (closure);
+ if (closure)
+ (*closure->cb) (closure);
g_signal_handlers_disconnect_by_func (cal, cal_set_mode_cb, closure);
g_free (closure);
GSourceFunc callback,
gpointer user_data)
{
- ECalTestClosure *closure;
+ ECalTestClosure *closure;
- closure = g_new0 (ECalTestClosure, 1);
- closure->cb = callback;
- closure->user_data = user_data;
+ closure = g_new0 (ECalTestClosure, 1);
+ closure->cb = callback;
+ closure->user_data = user_data;
g_signal_connect (G_OBJECT (cal), "cal_set_mode", G_CALLBACK (cal_set_mode_cb), closure);
e_cal_set_mode (cal, mode);
ECalComponent **comp_out,
gchar **uid_out)
{
- ECalComponent *comp;
- icalcomponent *icalcomp;
- struct icaltimetype tt;
- ECalComponentText text;
- ECalComponentDateTime dt;
- gchar *uid;
+ ECalComponent *comp;
+ icalcomponent *icalcomp;
+ struct icaltimetype tt;
+ ECalComponentText text;
+ ECalComponentDateTime dt;
+ gchar *uid;
- comp = e_cal_component_new ();
+ comp = e_cal_component_new ();
/* set fields */
- e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
- text.value = summary;
- text.altrep = NULL;
- e_cal_component_set_summary (comp, &text);
- tt = icaltime_from_string (dtstart);
- dt.value = &tt;
- dt.tzid = dtstart_tzid;
- e_cal_component_set_dtstart (comp, &dt);
- tt = icaltime_from_string (dtend);
- dt.value = &tt;
- dt.tzid = dtend_tzid;
- e_cal_component_set_dtend (comp, &dt);
- e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
-
- e_cal_component_commit_sequence (comp);
- icalcomp = e_cal_component_get_icalcomponent (comp);
-
- uid = ecal_test_utils_cal_create_object (cal, icalcomp);
- e_cal_component_commit_sequence (comp);
+ e_cal_component_set_new_vtype (comp, E_CAL_COMPONENT_EVENT);
+ text.value = summary;
+ text.altrep = NULL;
+ e_cal_component_set_summary (comp, &text);
+ tt = icaltime_from_string (dtstart);
+ dt.value = &tt;
+ dt.tzid = dtstart_tzid;
+ e_cal_component_set_dtstart (comp, &dt);
+ tt = icaltime_from_string (dtend);
+ dt.value = &tt;
+ dt.tzid = dtend_tzid;
+ e_cal_component_set_dtend (comp, &dt);
+ e_cal_component_set_transparency (comp, E_CAL_COMPONENT_TRANSP_OPAQUE);
+
+ e_cal_component_commit_sequence (comp);
+ icalcomp = e_cal_component_get_icalcomponent (comp);
+
+ uid = ecal_test_utils_cal_create_object (cal, icalcomp);
+ e_cal_component_commit_sequence (comp);
*comp_out = comp;
*uid_out = uid;
ecal_test_utils_cal_component_set_icalcomponent (ECalComponent *e_component,
icalcomponent *component)
{
- if (!e_cal_component_set_icalcomponent (e_component, component)) {
+ if (!e_cal_component_set_icalcomponent (e_component, component)) {
g_error ("Could not set icalcomponent\n");
- }
+ }
}
icaltimezone*
ecal_test_utils_cal_get_timezone (ECal *cal,
const gchar *tzid)
{
- GError *error = NULL;
+ GError *error = NULL;
icaltimezone *zone = NULL;
- if (!e_cal_get_timezone (cal, tzid, &zone, &error)) {
+ if (!e_cal_get_timezone (cal, tzid, &zone, &error)) {
g_warning ("failed to get icaltimezone* for ID '%s'; %s\n", tzid, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully got icaltimezone* for ID '%s'\n", tzid);
return zone;
ecal_test_utils_cal_add_timezone (ECal *cal,
icaltimezone *zone)
{
- GError *error = NULL;
+ GError *error = NULL;
const gchar *name;
name = icaltimezone_get_display_name (zone);
- if (!e_cal_add_timezone (cal, zone, &error)) {
+ if (!e_cal_add_timezone (cal, zone, &error)) {
g_warning ("failed to add icaltimezone '%s'; %s\n", name, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully added icaltimezone '%s'\n", name);
}
ecal_test_utils_cal_set_default_timezone (ECal *cal,
icaltimezone *zone)
{
- GError *error = NULL;
+ GError *error = NULL;
const gchar *name;
name = icaltimezone_get_display_name (zone);
- if (!e_cal_set_default_timezone (cal, zone, &error)) {
+ if (!e_cal_set_default_timezone (cal, zone, &error)) {
g_warning ("failed to set default icaltimezone '%s'; %s\n", name, error->message);
- exit (1);
- }
+ exit (1);
+ }
test_print ("successfully set default icaltimezone '%s'\n", name);
}
ecal_test_utils_cal_open (cal, FALSE);
ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
"20040109T103000", "UTC", EVENT_SUMMARY, &e_component,
- &uid);
+ &uid);
icalcomponent_final = ecal_test_utils_cal_get_object (cal, uid);
e_component_final = e_cal_component_new ();
{
ECal *cal;
gchar *uri = NULL;
- GList *users = NULL;
- icaltimezone *utc;
- time_t start = time (NULL), end;
+ GList *users = NULL;
+ icaltimezone *utc;
+ time_t start = time (NULL), end;
GList *free_busy;
g_type_init ();
cal = ecal_test_utils_cal_new_temp (&uri, E_CAL_SOURCE_TYPE_EVENT);
ecal_test_utils_cal_open (cal, FALSE);
- utc = icaltimezone_get_utc_timezone ();
+ utc = icaltimezone_get_utc_timezone ();
start = time_from_isodate ("20040212T000000Z");
- end = time_add_day_with_zone (start, 2, utc);
+ end = time_add_day_with_zone (start, 2, utc);
/* XXX: create dummy list, which the file backend will ignore */
users = g_list_prepend (users, NULL);
ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
"20040109T103000", "UTC", EVENT_SUMMARY, &e_component,
&uid);
- component = e_cal_component_get_icalcomponent (e_component);
+ component = e_cal_component_get_icalcomponent (e_component);
component_final = ecal_test_utils_cal_get_object (cal, uid);
ecal_test_utils_cal_assert_objects_equal_shallow (component,
static void
objects_added_cb (GObject *object, GList *objects, gpointer data)
{
- GList *l;
+ GList *l;
- for (l = objects; l; l = l->next)
+ for (l = objects; l; l = l->next)
test_print ("Object added %s\n", icalcomponent_get_uid (l->data));
subtest_passed (SUBTEST_OBJECTS_ADDED);
static void
objects_modified_cb (GObject *object, GList *objects, gpointer data)
{
- GList *l;
+ GList *l;
- for (l = objects; l; l = l->next)
+ for (l = objects; l; l = l->next)
test_print ("Object modified %s\n", icalcomponent_get_uid (l->data));
subtest_passed (SUBTEST_OBJECTS_MODIFIED);
static void
objects_removed_cb (GObject *object, GList *objects, gpointer data)
{
- GList *l;
+ GList *l;
- for (l = objects; l; l = l->next) {
+ for (l = objects; l; l = l->next) {
ECalComponentId *id = l->data;
test_print ("Object removed: uid: %s, rid: %s\n", id->uid,
INITIAL_BEGIN_TIMEZONE, INITIAL_END_TIME,
INITIAL_END_TIMEZONE, EVENT_SUMMARY, &e_component,
&uid);
- component = e_cal_component_get_icalcomponent (e_component);
+ component = e_cal_component_get_icalcomponent (e_component);
component_final = ecal_test_utils_cal_get_object (cal, uid);
ecal_test_utils_cal_assert_objects_equal_shallow (component,
ecal_test_utils_cal_modify_object (cal, component, CALOBJ_MOD_ALL);
/* verify the modification */
- component_final = ecal_test_utils_cal_get_object (cal, uid);
- e_component_final = e_cal_component_new ();
- ecal_test_utils_cal_component_set_icalcomponent (e_component_final,
- component_final);
+ component_final = ecal_test_utils_cal_get_object (cal, uid);
+ e_component_final = e_cal_component_new ();
+ ecal_test_utils_cal_component_set_icalcomponent (e_component_final,
+ component_final);
- ecal_test_utils_cal_assert_e_cal_components_equal (e_component,
- e_component_final);
+ ecal_test_utils_cal_assert_e_cal_components_equal (e_component,
+ e_component_final);
/* remove the object */
ecal_test_utils_cal_remove_object (cal, uid);
e_cal_view_start (view);
- loop = g_main_loop_new (NULL, TRUE);
+ loop = g_main_loop_new (NULL, TRUE);
alter_cal_id = g_idle_add ((GSourceFunc) alter_cal_cb, cal);
- complete_timeout_id = g_timeout_add_seconds (COMPLETE_TIMEOUT,
- (GSourceFunc) complete_timeout_cb, cal);
+ complete_timeout_id = g_timeout_add_seconds (COMPLETE_TIMEOUT,
+ (GSourceFunc) complete_timeout_cb, cal);
- g_main_loop_run (loop);
+ g_main_loop_run (loop);
g_object_unref (view);
INITIAL_BEGIN_TIMEZONE, INITIAL_END_TIME,
INITIAL_END_TIMEZONE, EVENT_SUMMARY, &e_component,
&uid);
- component = e_cal_component_get_icalcomponent (e_component);
+ component = e_cal_component_get_icalcomponent (e_component);
component_final = ecal_test_utils_cal_get_object (cal, uid);
ecal_test_utils_cal_assert_objects_equal_shallow (component,
ecal_test_utils_cal_modify_object (cal, component, CALOBJ_MOD_ALL);
/* verify */
- component_final = ecal_test_utils_cal_get_object (cal, uid);
- e_component_final = e_cal_component_new ();
- ecal_test_utils_cal_component_set_icalcomponent (e_component_final,
- component_final);
+ component_final = ecal_test_utils_cal_get_object (cal, uid);
+ e_component_final = e_cal_component_new ();
+ ecal_test_utils_cal_component_set_icalcomponent (e_component_final,
+ component_final);
- ecal_test_utils_cal_assert_e_cal_components_equal (e_component,
- e_component_final);
+ ecal_test_utils_cal_assert_e_cal_components_equal (e_component,
+ e_component_final);
/* Clean-up */
ecal_test_utils_cal_remove (cal);
{
g_source_remove (open_timeout_id);
- g_main_loop_quit ((GMainLoop*) closure->user_data);
+ g_main_loop_quit ((GMainLoop*) closure->user_data);
}
static void
{
ECal *cal;
gchar *uri = NULL;
- GList *users = NULL;
+ GList *users = NULL;
ECalComponent *e_component = NULL;
icalcomponent *component = NULL;
icalcomponent *modified_component = NULL;
ecal_test_utils_create_component (cal, "20040109T090000Z", "UTC",
"20040109T103000", "UTC", "new event", &e_component,
- &uid);
+ &uid);
component = e_cal_component_get_icalcomponent (e_component);
ecal_test_utils_cal_send_objects (cal, component, &users, &modified_component);
MODE_FINAL);
}
- g_main_loop_quit ((GMainLoop*) closure->user_data);
+ g_main_loop_quit ((GMainLoop*) closure->user_data);
}
static void
loop = g_main_loop_new (NULL, TRUE);
/* open and close many calendars in parallel */
- for (i = 0; i < NUM_CALS; i++) {
- cals[i] = ecal_test_utils_cal_new_temp (&uri,
- E_CAL_SOURCE_TYPE_EVENT);
+ for (i = 0; i < NUM_CALS; i++) {
+ cals[i] = ecal_test_utils_cal_new_temp (&uri,
+ E_CAL_SOURCE_TYPE_EVENT);
ecal_test_utils_cal_async_open (cals[i], FALSE,
(GSourceFunc) open_complete_cb, loop);
g_free (uri);
- }
+ }
g_main_loop_run (loop);
sqlite3_free (cmd);
cmd = sqlite3_mprintf ("ALTER TABLE '%q_version' RENAME TO '%q_version'", old_folder, new_folder);
- ret = camel_db_add_to_transaction (cdb, cmd, error);
- sqlite3_free (cmd);
+ ret = camel_db_add_to_transaction (cdb, cmd, error);
+ sqlite3_free (cmd);
cmd = sqlite3_mprintf ("UPDATE %Q SET modified=strftime(\"%%s\", 'now'), created=strftime(\"%%s\", 'now')", new_folder);
ret = camel_db_add_to_transaction (cdb, cmd, error);
switch (type)
{
case hw_execute:
- rw = DR_RW_EXECUTE;
- break;
+ rw = DR_RW_EXECUTE;
+ break;
case hw_write:
- rw = DR_RW_WRITE;
- break;
+ rw = DR_RW_WRITE;
+ break;
case hw_read: /* x86 doesn't support data-read watchpoints */
case hw_access:
- rw = DR_RW_READ;
- break;
+ rw = DR_RW_READ;
+ break;
#if 0
case hw_io_access: /* not yet supported */
- rw = DR_RW_IORW;
- break;
+ rw = DR_RW_IORW;
+ break;
#endif
default:
- internal_error (__FILE__, __LINE__, "\
+ internal_error (__FILE__, __LINE__, "\
Invalid hw breakpoint type %d in i386_length_and_rw_bits.\n", (gint)type);
}
switch (len)
{
case 1:
- return (DR_LEN_1 | rw);
+ return (DR_LEN_1 | rw);
case 2:
- return (DR_LEN_2 | rw);
+ return (DR_LEN_2 | rw);
case 4:
- return (DR_LEN_4 | rw);
+ return (DR_LEN_4 | rw);
case 8:
- if (TARGET_HAS_DR_LEN_8)
- return (DR_LEN_8 | rw);
+ if (TARGET_HAS_DR_LEN_8)
+ return (DR_LEN_8 | rw);
default:
- internal_error (__FILE__, __LINE__, "\
+ internal_error (__FILE__, __LINE__, "\
Invalid hw breakpoint length %d in i386_length_and_rw_bits.\n", len);
}
}
gint
camel_file_util_decode_uint32 (FILE *in, guint32 *dest)
{
- guint32 value = 0;
+ guint32 value = 0;
gint v;
/* until we get the last byte, keep decoding 7 bits at a time */
- while ( ((v = fgetc (in)) & 0x80) == 0 && v!=EOF) {
- value |= v;
- value <<= 7;
- }
+ while ( ((v = fgetc (in)) & 0x80) == 0 && v!=EOF) {
+ value |= v;
+ value <<= 7;
+ }
if (v == EOF) {
*dest = value >> 7;
return -1;
}
*dest = value | (v & 0x7f);
- return 0;
+ return 0;
}
/**
gint i = sizeof (type) - 1; \
gint v = EOF; \
\
- while (i >= 0 && (v = fgetc (in)) != EOF) { \
+ while (i >= 0 && (v = fgetc (in)) != EOF) { \
save |= ((type)v) << (i * 8); \
i--; \
} \
camel_folder_summary_remove_index_fast (CamelFolderSummary *s, gint index)
{
const gchar *uid = s->uids->pdata[index];
- CamelMessageInfo *oldinfo;
- gchar *olduid;
+ CamelMessageInfo *oldinfo;
+ gchar *olduid;
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_REF_LOCK);
if (passwd_fd == -1) {
/* only use batch mode if we don't intend on using the
- interactive --command-fd option */
+ interactive --command-fd option */
g_ptr_array_add (argv, (guint8 *) "--batch");
g_ptr_array_add (argv, (guint8 *) "--yes");
}
gpg = gpg_ctx_new (context);
gpg_ctx_set_mode (gpg, GPG_CTX_MODE_VERIFY);
if (sigfile)
- gpg_ctx_set_sigfile (gpg, sigfile);
+ gpg_ctx_set_sigfile (gpg, sigfile);
gpg_ctx_set_istream (gpg, canon_stream);
if (!gpg_ctx_op_start (gpg, error))
and g_list's are f@@#$ed up to make this a hassle */
static void camel_dlist_init (CamelDList *v)
{
- v->head = (CamelDListNode *)&v->tail;
- v->tail = NULL;
- v->tailpred = (CamelDListNode *)&v->head;
+ v->head = (CamelDListNode *)&v->tail;
+ v->tail = NULL;
+ v->tailpred = (CamelDListNode *)&v->head;
}
static CamelDListNode *camel_dlist_addhead (CamelDList *l, CamelDListNode *n)
{
- n->next = l->head;
- n->prev = (CamelDListNode *)&l->head;
- l->head->prev = n;
- l->head = n;
- return n;
+ n->next = l->head;
+ n->prev = (CamelDListNode *)&l->head;
+ l->head->prev = n;
+ l->head = n;
+ return n;
}
static CamelDListNode *camel_dlist_addtail (CamelDList *l, CamelDListNode *n)
{
- n->next = (CamelDListNode *)&l->tail;
- n->prev = l->tailpred;
- l->tailpred->next = n;
- l->tailpred = n;
- return n;
+ n->next = (CamelDListNode *)&l->tail;
+ n->prev = l->tailpred;
+ l->tailpred->next = n;
+ l->tailpred = n;
+ return n;
}
static CamelDListNode *camel_dlist_remove (CamelDListNode *n)
{
- n->next->prev = n->prev;
- n->prev->next = n->next;
- return n;
+ n->next->prev = n->prev;
+ n->prev->next = n->next;
+ return n;
}
static const gchar *
void
camel_dlist_init (CamelDList *v)
{
- v->head = (CamelDListNode *)&v->tail;
- v->tail = NULL;
- v->tailpred = (CamelDListNode *)&v->head;
+ v->head = (CamelDListNode *)&v->tail;
+ v->tail = NULL;
+ v->tailpred = (CamelDListNode *)&v->head;
}
/**
CamelDListNode *
camel_dlist_addhead (CamelDList *l, CamelDListNode *n)
{
- n->next = l->head;
- n->prev = (CamelDListNode *)&l->head;
- l->head->prev = n;
- l->head = n;
- return n;
+ n->next = l->head;
+ n->prev = (CamelDListNode *)&l->head;
+ l->head->prev = n;
+ l->head = n;
+ return n;
}
/**
CamelDListNode *
camel_dlist_addtail (CamelDList *l, CamelDListNode *n)
{
- n->next = (CamelDListNode *)&l->tail;
- n->prev = l->tailpred;
- l->tailpred->next = n;
- l->tailpred = n;
- return n;
+ n->next = (CamelDListNode *)&l->tail;
+ n->prev = l->tailpred;
+ l->tailpred->next = n;
+ l->tailpred = n;
+ return n;
}
/**
CamelDListNode *
camel_dlist_remove (CamelDListNode *n)
{
- n->next->prev = n->prev;
- n->prev->next = n->next;
- return n;
+ n->next->prev = n->prev;
+ n->prev->next = n->next;
+ return n;
}
/**
CamelSListNode *
camel_slist_addhead (CamelSList *l, CamelSListNode *n)
{
- n->next = l->head;
+ n->next = l->head;
l->head = n;
return n;
n->next = NULL;
p->next = n;
- return n;
+ return n;
}
CamelSListNode *
if (((gint) inleft) > 0) {
/* We've either got an E2BIG or EINVAL. Save the
- remainder of the buffer as we'll process this next
- time through */
+ remainder of the buffer as we'll process this next
+ time through */
camel_mime_filter_backup (mime_filter, inbuf, inleft);
}
need_input:
/* the reason we ignore @flush here is because if there isn't
- enough input to parse a tag, then there's nothing we can
- do. */
+ enough input to parse a tag, then there's nothing we can
+ do. */
if (inptr < inend)
camel_mime_filter_backup (mime_filter, inptr, (unsigned) (inend - inptr));
iconv (cd, NULL, NULL, &outbuf, &outleft);
/* Note: not all charsets can be nul-terminated with a single
- nul byte. UCS2, for example, needs 2 nul bytes and UCS4
- needs 4. I hope that 4 nul bytes is enough to terminate all
- multibyte charsets? */
+ nul byte. UCS2, for example, needs 2 nul bytes and UCS4
+ needs 4. I hope that 4 nul bytes is enough to terminate all
+ multibyte charsets? */
/* nul-terminate the string */
memset (outbuf, 0, 4);
case WORD_2047:
if (last_word && last_word->type == WORD_2047) {
/* include the whitespace chars between these 2 words in the
- resulting rfc2047 encoded word. */
+ resulting rfc2047 encoded word. */
len = word->end - last_word->end;
start = (const gchar *) last_word->end;
{
struct _date_token *tokens = NULL, *token, *tail = (struct _date_token *) &tokens;
const gchar *start, *end;
- guchar mask;
+ guchar mask;
start = date;
while (*start) {
static gint
get_days_in_month (gint month, gint year)
{
- switch (month) {
+ switch (month) {
case 1:
case 3:
case 5:
static gint
camel_movemail_copy (gint fromfd, gint tofd, goffset start, gsize bytes)
{
- gchar buffer[4096];
- gint written = 0;
+ gchar buffer[4096];
+ gint written = 0;
d(printf("writing %d bytes ... ", bytes));
if (lseek (fromfd, start, SEEK_SET) != start)
return -1;
- while (bytes>0) {
- gint toread, towrite;
+ while (bytes>0) {
+ gint toread, towrite;
- toread = bytes;
- if (bytes>4096)
- toread = 4096;
- else
- toread = bytes;
+ toread = bytes;
+ if (bytes>4096)
+ toread = 4096;
+ else
+ toread = bytes;
do {
towrite = read (fromfd, buffer, toread);
} while (towrite == -1 && errno == EINTR);
return -1;
/* check for 'end of file' */
- if (towrite == 0) {
+ if (towrite == 0) {
d(printf("end of file?\n"));
- break;
+ break;
}
do {
if (toread == -1)
return -1;
- written += toread;
- bytes -= toread;
- }
+ written += toread;
+ bytes -= toread;
+ }
d(printf("written %d bytes\n", written));
- return written;
+ return written;
}
#endif
static gint
camel_movemail_copy_filter (gint fromfd, gint tofd, goffset start, gsize bytes, CamelMimeFilter *filter)
{
- gchar buffer[4096+PRE_SIZE];
- gint written = 0;
+ gchar buffer[4096+PRE_SIZE];
+ gint written = 0;
gchar *filterbuffer;
gint filterlen, filterpre;
if (lseek (fromfd, start, SEEK_SET) != start)
return -1;
- while (bytes>0) {
- gint toread, towrite;
+ while (bytes>0) {
+ gint toread, towrite;
- toread = bytes;
- if (bytes>4096)
- toread = 4096;
- else
- toread = bytes;
+ toread = bytes;
+ if (bytes>4096)
+ toread = 4096;
+ else
+ toread = bytes;
do {
towrite = read (fromfd, buffer+PRE_SIZE, toread);
} while (towrite == -1 && errno == EINTR);
d(printf("read %d unfiltered bytes\n", towrite));
/* check for 'end of file' */
- if (towrite == 0) {
+ if (towrite == 0) {
d(printf("end of file?\n"));
camel_mime_filter_complete (filter, buffer+PRE_SIZE, towrite, PRE_SIZE,
&filterbuffer, &filterlen, &filterpre);
if (toread == -1)
return -1;
- written += toread;
- bytes -= toread;
- }
+ written += toread;
+ bytes -= toread;
+ }
d(printf("written %d bytes\n", written));
- return written;
+ return written;
}
/* write the headers back out again, but not he Content-Length header, because we dont
static gint
solaris_header_write (gint fd, struct _camel_header_raw *header)
{
- struct iovec iv[4];
- gint outlen = 0, len;
+ struct iovec iv[4];
+ gint outlen = 0, len;
iv[1].iov_base = ":";
- iv[1].iov_len = 1;
+ iv[1].iov_len = 1;
iv[3].iov_base = "\n";
- iv[3].iov_len = 1;
+ iv[3].iov_len = 1;
- while (header) {
+ while (header) {
if (g_ascii_strcasecmp(header->name, "Content-Length")) {
iv[0].iov_base = header->name;
iv[0].iov_len = strlen (header->name);
return -1;
outlen += len;
}
- header = header->next;
- }
+ header = header->next;
+ }
do {
len = write(fd, "\n", 1);
d(printf("Wrote %d bytes of headers\n", outlen));
- return outlen;
+ return outlen;
}
/* Well, since Solaris is a tad broken wrt its 'mbox' folder format,
while ((msg->result = camel_gethostbyname_r (msg->name, &h, msg->hostbufmem, msg->hostbuflen, &herr)) == ERANGE) {
if (msg->cancelled)
break;
- msg->hostbuflen *= 2;
- msg->hostbufmem = g_realloc (msg->hostbufmem, msg->hostbuflen);
+ msg->hostbuflen *= 2;
+ msg->hostbufmem = g_realloc (msg->hostbufmem, msg->hostbuflen);
}
/* If we got cancelled, dont reply, just free it */
msg->hostbufmem, msg->hostbuflen, &herr)) == ERANGE) {
if (msg->cancelled)
break;
- msg->hostbuflen *= 2;
- msg->hostbufmem = g_realloc (msg->hostbufmem, msg->hostbuflen);
+ msg->hostbuflen *= 2;
+ msg->hostbufmem = g_realloc (msg->hostbufmem, msg->hostbuflen);
}
if (msg->cancelled)
g_error_free (error);
}
- if (reply) {
+ if (reply) {
GVariant *body = g_dbus_message_get_body (reply);
success = body && g_variant_get_boolean (body);
- g_object_unref (reply);
- }
+ g_object_unref (reply);
+ }
/* Free the message */
g_object_unref (message);
key[i] ^= 0x01;
}
- deskey (ks, key, 0);
+ deskey (ks, key, 0);
}
static void
ntlm_calc_response (const guchar key[21], const guchar plaintext[8],
guchar results[24])
{
- DES_KS ks;
+ DES_KS ks;
memcpy (results, plaintext, 8);
memcpy (results + 8, plaintext, 8);
memcpy (results + 16, plaintext, 8);
- setup_schedule (key, ks);
+ setup_schedule (key, ks);
des (ks, results);
- setup_schedule (key + 7, ks);
+ setup_schedule (key + 7, ks);
des (ks, results + 8);
- setup_schedule (key + 14, ks);
- des (ks, results + 16);
+ setup_schedule (key + 14, ks);
+ des (ks, results + 16);
}
/*
camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_REF_LOCK);
camel_store_summary_lock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
- if (g_hash_table_lookup_extended (summary->folders_path, path, (gpointer)&oldpath, (gpointer)&oldinfo)) {
+ if (g_hash_table_lookup_extended (summary->folders_path, path, (gpointer)&oldpath, (gpointer)&oldinfo)) {
/* make sure it doesn't vanish while we're removing it */
oldinfo->refcount++;
camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK);
camel_store_summary_remove (summary, oldinfo);
camel_store_summary_info_free (summary, oldinfo);
- } else {
+ } else {
camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_SUMMARY_LOCK);
camel_store_summary_unlock (summary, CAMEL_STORE_SUMMARY_REF_LOCK);
}
error, CAMEL_ERROR, CAMEL_ERROR_GENERIC,
_("Cannot create folder '%s': folder exists"),
folder_name);
- camel_object_bag_abort (store->folders, folder_name);
+ camel_object_bag_abort (store->folders, folder_name);
g_object_unref (folder);
return NULL;
}
url_scanner_table['-'] |= IS_DOMAIN;
/* not defined to be special in rfc0822, but when scanning
- backwards to find the beginning of the email address we do
- not want to include this gchar if we come accross it - so
- this is kind of a hack */
+ backwards to find the beginning of the email address we do
+ not want to include this gchar if we come accross it - so
+ this is kind of a hack */
url_scanner_table['/'] |= IS_SPECIAL;
table_init_bits (IS_LWSP, CHARS_LWSP);
gchar *
camel_url_decode_path (const gchar *path)
{
- gchar **comps;
- gchar *new_path = NULL;
- GString *str;
- gint i = 0;
+ gchar **comps;
+ gchar *new_path = NULL;
+ GString *str;
+ gint i = 0;
- if (!path)
+ if (!path)
return g_strdup(""); /* ??? or NULL? */
- str = g_string_new (NULL);
+ str = g_string_new (NULL);
comps = g_strsplit (path, "/", -1);
- while (comps[i]) {
- camel_url_decode (comps[i]);
- g_string_append (str, comps[i]);
- g_string_append_c (str, '/');
- i++;
- }
+ while (comps[i]) {
+ camel_url_decode (comps[i]);
+ g_string_append (str, comps[i]);
+ g_string_append_c (str, '/');
+ i++;
+ }
/* Strip-off the trailing "/" */
- new_path = g_strndup (str->str, str->len-1);
+ new_path = g_strndup (str->str, str->len-1);
- g_strfreev (comps);
- g_string_free (str, TRUE);
+ g_strfreev (comps);
+ g_string_free (str, TRUE);
- return new_path;
+ return new_path;
}
if (e_gw_item_has_attachment (item))
mi->info.flags |= CAMEL_MESSAGE_ATTACHMENTS;
- if (is_proxy)
- mi->info.flags |= CAMEL_MESSAGE_USER_NOT_DELETABLE;
+ if (is_proxy)
+ mi->info.flags |= CAMEL_MESSAGE_USER_NOT_DELETABLE;
mi->server_flags = mi->info.flags;
#endif /* CAMEL_HAVE_SSL */
/* rfc2595, section 4 states that after a successful STLS
- command, the client MUST discard prior CAPA responses */
+ command, the client MUST discard prior CAPA responses */
if (!imap_get_capability (service, cancellable, error)) {
if (store->istream) {
g_object_unref (store->istream);
if (imap_store->renaming) {
/* we don't need to emit a "folder_unsubscribed" signal
- if we are in the process of renaming folders, so we
- are done here... */
+ if we are in the process of renaming folders, so we
+ are done here... */
return TRUE;
}
}
/* make sure this folder isn't currently SELECTed - it's
- actually possible to rename INBOX but if you do another
- INBOX will immediately be created by the server */
+ actually possible to rename INBOX but if you do another
+ INBOX will immediately be created by the server */
response = camel_imap_command (imap_store, NULL, cancellable, error, "SELECT INBOX");
if (!response) {
success = FALSE;
if (imap_store->renaming) {
/* we don't need to emit a "folder_subscribed" signal
- if we are in the process of renaming folders, so we
- are done here... */
+ if we are in the process of renaming folders, so we
+ are done here... */
goto done;
}
}
/* camel-imap-command.c:imap_read_untagged expects the CRLFs
- to be stripped off and be nul-terminated *sigh* */
+ to be stripped off and be nul-terminated *sigh* */
nread = ba->len - 1;
ba->data[nread] = '\0';
if (ba->data[nread - 1] == '\r') {
if (*inptr == ' ') {
/* parse extra flags... for now we
- don't save them, but in the future
- we may want to? */
+ don't save them, but in the future
+ we may want to? */
while (*inptr == ' ')
inptr++;
goto exception;
/* there shouldn't be spaces according to the
- ABNF grammar, but we all know how closely
- people follow specs */
+ ABNF grammar, but we all know how closely
+ people follow specs */
while (*inptr == ' ')
inptr++;
}
imapx_uids_array_cmp (gconstpointer ap, gconstpointer bp)
{
const gchar **a = (const gchar **) ap;
- const gchar **b = (const gchar **) bp;
+ const gchar **b = (const gchar **) bp;
return imapx_refresh_info_uid_cmp (*a, *b);
}
folder, cancellable, error)) {
g_object_unref (folder);
folder = NULL;
- }
+ }
return folder;
}
#endif /* CAMEL_HAVE_SSL */
/* We are supposed to re-EHLO after a successful STARTTLS to
- re-fetch any supported extensions. */
+ re-fetch any supported extensions. */
if (!smtp_helo (transport, cancellable, error)) {
camel_service_disconnect_sync (
(CamelService *) transport, TRUE, NULL);
if (content != 0) {
dw = camel_data_wrapper_new ();
- camel_data_wrapper_set_mime_type (dw, type);
+ camel_data_wrapper_set_mime_type (dw, type);
camel_data_wrapper_construct_from_stream_sync (
dw, (CamelStream *)content, NULL, NULL);
g_free (module->path);
- if (G_OBJECT_CLASS (e_data_server_module_parent_class)->finalize)
+ if (G_OBJECT_CLASS (e_data_server_module_parent_class)->finalize)
(*G_OBJECT_CLASS (e_data_server_module_parent_class)->finalize) (object);
}
{
GConfValue *value;
gboolean offline;
- EOfflineListener *eol;
+ EOfflineListener *eol;
EOfflineListenerPrivate *priv;
eol = E_OFFLINE_LISTENER (data);
*
* Emitted when proxy settings in gconf changes.
**/
- signals[CHANGED] =
+ signals[CHANGED] =
g_signal_new ("changed",
- G_OBJECT_CLASS_TYPE (object_class),
- G_SIGNAL_RUN_FIRST,
- G_STRUCT_OFFSET (EProxyClass, changed),
- NULL, NULL,
- g_cclosure_marshal_VOID__VOID,
- G_TYPE_NONE, 0);
+ G_OBJECT_CLASS_TYPE (object_class),
+ G_SIGNAL_RUN_FIRST,
+ G_STRUCT_OFFSET (EProxyClass, changed),
+ NULL, NULL,
+ g_cclosure_marshal_VOID__VOID,
+ G_TYPE_NONE, 0);
}
addr = g_new0 (struct in6_addr, 1);
mask = g_new0 (struct in6_addr, 1);
- for (i = 0; i < 16; ++i) {
+ for (i = 0; i < 16; ++i) {
addr->s6_addr[i] = addr_in6->s6_addr[i];
- }
- if (netmask) {
+ }
+ if (netmask) {
gchar *endptr;
gint width = strtol (netmask, &endptr, 10);
}
mask->s6_addr[i] = (0xff << (8 - width % 8)) & 0xff;
ipv6_network_addr (addr, mask, addr);
- } else {
+ } else {
for (i = 0; i < 16; ++i) {
mask->s6_addr[i] = 0xff;
}
- }
+ }
host_addr->addr = addr;
host_addr->mask = mask;
if (argv[0]->type != ESEXP_RES_TIME)
return FALSE;
- r->occuring_start = 0;
+ r->occuring_start = 0;
r->occuring_end = argv[0]->value.time;
return TRUE;
if (priv->action)
g_free (priv->action);
if (priv->env_uri)
- xmlFree (priv->env_uri);
+ xmlFree (priv->env_uri);
if (priv->env_prefix)
- xmlFree (priv->env_prefix);
+ xmlFree (priv->env_prefix);
G_OBJECT_CLASS (e_soap_message_parent_class)->finalize (object);
}
fetch_ns (ESoapMessage *msg, const gchar *prefix, const gchar *ns_uri)
{
ESoapMessagePrivate *priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNsPtr ns = NULL;
+ xmlNsPtr ns = NULL;
- if (prefix && ns_uri)
- ns = xmlNewNs (priv->last_node, (const xmlChar *)ns_uri, (const xmlChar *)prefix);
- else if (prefix && !ns_uri) {
- ns = xmlSearchNs (priv->doc, priv->last_node, (const xmlChar *)prefix);
- if (!ns)
+ if (prefix && ns_uri)
+ ns = xmlNewNs (priv->last_node, (const xmlChar *)ns_uri, (const xmlChar *)prefix);
+ else if (prefix && !ns_uri) {
+ ns = xmlSearchNs (priv->doc, priv->last_node, (const xmlChar *)prefix);
+ if (!ns)
ns = xmlNewNs (priv->last_node, (const xmlChar *)"", (const xmlChar *)prefix);
- }
+ }
- return ns;
+ return ns;
}
/**
void
e_soap_message_end_fault (ESoapMessage *msg)
{
- e_soap_message_end_element (msg);
+ e_soap_message_end_element (msg);
}
/**
{
ESoapMessagePrivate *priv;
- g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
+ g_return_if_fail (E_IS_SOAP_MESSAGE (msg));
priv = E_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node,
+ priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
(const xmlChar *)"detail",
NULL);
void
e_soap_message_write_base64 (ESoapMessage *msg, const gchar *string, gint len)
{
- gchar *str = g_base64_encode ((const guchar *)string, len);
- e_soap_message_write_string (msg, str);
- g_free (str);
+ gchar *str = g_base64_encode ((const guchar *)string, len);
+ e_soap_message_write_string (msg, str);
+ g_free (str);
}
/**
void
e_soap_message_write_time (ESoapMessage *msg, const time_t *timeval)
{
- gchar *str = g_strchomp (ctime (timeval));
- e_soap_message_write_string (msg, str);
+ gchar *str = g_strchomp (ctime (timeval));
+ e_soap_message_write_string (msg, str);
}
/**
is_pm = 1;
else
return NULL;
- }
+ }
break;
case 'r':
#ifdef _NL_CURRENT
else
str_uri = g_strdup_printf (
"%s://%s%s%s%s%s%s%s%s%s%s",
- uri->protocol,
+ uri->protocol,
uri->user ? uri->user : "",
uri->authmech ? ";auth=" : "",
uri->authmech ? uri->authmech : "",
const gchar *component_name;
gchar *password = NULL;
const gchar *uri = e_book_get_uri (book);
- gchar *stripped_uri = remove_parameters_from_uri (uri);
+ gchar *stripped_uri = remove_parameters_from_uri (uri);
const gchar *auth_domain = e_source_get_property (source, "auth-domain");
component_name = auth_domain ? auth_domain : "Addressbook";
{
/* When we lose focus and popup is still present hide it. Dont do it, when we click the popup. Look for grab */
if (gtk_widget_get_visible (GTK_WIDGET (list->priv->popup))
- && !gtk_widget_has_grab (GTK_WIDGET (list->priv->popup))) {
+ && !gtk_widget_has_grab (GTK_WIDGET (list->priv->popup))) {
enl_popup_ungrab (list);
gtk_widget_hide ((GtkWidget *)list->priv->popup);
row_activated_cb (GtkTreeView *tree_view, GtkTreePath *path,
GtkTreeViewColumn *column, GtkWidget *dialog)
{
- gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
+ gtk_dialog_response (GTK_DIALOG (dialog), GTK_RESPONSE_OK);
}
static void
g_signal_emit (
widget, signals[DATA_DROPPED], 0, selection_data,
object, gdk_drag_context_get_selected_action (context),
- info, &success);
+ info, &success);
exit:
if (path != NULL)
when multiple e_gw_connection apis see inavlid connection error
at the sma time this prevents this function sending login requests multiple times */
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
+ if (!response) {
+ g_object_unref (msg);
g_mutex_unlock (priv->reauth_mutex);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
- status = e_gw_connection_parse_response_status (response);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+ status = e_gw_connection_parse_response_status (response);
g_object_unref (response);
if (status == E_GW_CONNECTION_STATUS_OK) {
timeout = atoi (g_getenv ("SOUP_SESSION_TIMEOUT"));
/* Initialize proxy settings */
- priv->proxy = e_proxy_new ();
- e_proxy_setup_proxy (priv->proxy);
+ priv->proxy = e_proxy_new ();
+ e_proxy_setup_proxy (priv->proxy);
g_signal_connect (priv->proxy, "changed", G_CALLBACK (proxy_settings_changed), cnc);
/* create the SoupSession for this connection */
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
SoupSoapParameter *param;
/* when user cancels password dialog, then the cnc is NULL */
g_return_val_if_fail (container_list != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getFolderListRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "parent", NULL, top);
e_gw_message_write_string_parameter (msg, "recurse", NULL, "true");
/* send message to server */
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
- g_object_unref (msg);
+ status = e_gw_connection_parse_response_status (response);
+ g_object_unref (msg);
if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- return status;
- }
+ return status;
+ }
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "folders");
- if (param) {
+ if (param) {
SoupSoapParameter *subparam;
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "folder");
subparam != NULL;
g_object_unref (response);
- return status;
+ return status;
}
void
gchar *
e_gw_connection_get_container_id (EGwConnection *cnc, const gchar *name)
{
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
GList *container_list = NULL, *l;
gchar *container_id = NULL;
status = e_gw_connection_get_container_list (cnc, "folders", &container_list);
if (status != E_GW_CONNECTION_STATUS_OK) {
e_gw_connection_free_container_list (container_list);
- return NULL;
- }
+ return NULL;
+ }
/* search the container in the list */
for (l = container_list; l != NULL; l = l->next) {
e_gw_connection_get_items_delta_info (EGwConnection *cnc, const gchar *container, gdouble *first_sequence,
gdouble *last_sequence, gdouble *last_po_rebuild_time )
{
- SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param, *subparam;
+ SoupSoapMessage *msg;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param, *subparam;
gchar *tmp = NULL;
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getDeltaInfoRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "container", NULL, container);
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
-
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
param = soup_soap_response_get_first_parameter_by_name (response, "deltaInfo");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
/* parse these parameters */
} else
*last_po_rebuild_time = -1;
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
return status;
EGwConnectionStatus
e_gw_connection_get_items_delta (EGwConnection *cnc, const gchar *container, const gchar *view, const gchar *count, const gchar * start_sequence, GList **add_list, GList **delete_list)
{
- SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param, *subparam, *subsubparam;
+ SoupSoapMessage *msg;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param, *subparam, *subsubparam;
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getDeltasRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "container", NULL, container);
if (view)
/* send message to server */
e_gw_message_write_footer (msg);
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
-
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "items");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
/* parse these parameters */
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
}
g_free (value);
}
- }
+ }
/* free memory */
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
e_gw_connection_get_items (EGwConnection *cnc, const gchar *container, const gchar *view, EGwFilter *filter, GList **list)
{
- SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param, *subparam;
+ SoupSoapMessage *msg;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param, *subparam;
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getItemsRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "container", NULL, container);
if (view)
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
-
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "items");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
/* parse these parameters into ecalcomponents*/
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, container, subparam);
if (item)
*list = g_list_append (*list, item);
- }
+ }
/* free memory */
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
e_gw_connection_get_items_from_ids (EGwConnection *cnc, const gchar *container, const gchar *view, GPtrArray *item_ids, GList **list)
{
- SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param, *subparam;
+ SoupSoapMessage *msg;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param, *subparam;
gint i;
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getItemsRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "container", NULL, container);
if (view)
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
-
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "items");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
/* parse these parameters into ecalcomponents*/
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, container, subparam);
if (item)
*list = g_list_append (*list, item);
- }
+ }
/* free memory */
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
e_gw_connection_get_deltas ( EGwConnection *cnc, GSList **adds, GSList **deletes, GSList **updates)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param, *subparam;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param, *subparam;
gchar *tmp;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getDeltaRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
/* g_object_unref (cnc); */
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
/*FIXME make this generic */
soup_soap_message_start_element (msg, "CalendarItem", NULL, NULL);
- soup_soap_message_end_element (msg);
- e_gw_message_write_footer (msg);
+ soup_soap_message_end_element (msg);
+ e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
/* g_object_unref (cnc); */
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
g_object_unref (response);
g_object_unref (msg);
/* g_object_unref (cnc); */
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "changed");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
/* g_object_unref (cnc); */
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
tmp = soup_soap_parameter_get_string_value (param);
if (!g_ascii_strcasecmp (tmp, "0")) {
g_free (tmp);
g_message ("No deltas");
/* g_object_unref (cnc); */
- return E_GW_CONNECTION_STATUS_OK;
- }
+ return E_GW_CONNECTION_STATUS_OK;
+ }
g_free (tmp);
param = soup_soap_response_get_first_parameter_by_name (response, "deltas");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
/* g_object_unref (cnc); */
/* return E_GW_CONNECTION_STATUS_INVALID_RESPONSE; */
/* getting around the server behavior that deltas can be null
* though changes is true */
return E_GW_CONNECTION_STATUS_OK;
- }
+ }
/* process all deletes first*/
param = soup_soap_parameter_get_first_child_by_name (param, "delete");
- if (param) {
+ if (param) {
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
- subparam != NULL;
+ subparam != NULL;
subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
/*process each item */
- gchar *uid;
- SoupSoapParameter *param_id;
+ gchar *uid;
+ SoupSoapParameter *param_id;
param_id = soup_soap_parameter_get_first_child_by_name (subparam, "id");
- if (!param_id) {
- g_object_unref (response);
- g_object_unref (msg);
+ if (!param_id) {
+ g_object_unref (response);
+ g_object_unref (msg);
/* g_object_unref (cnc); */
- }
- uid = (gchar *)soup_soap_parameter_get_string_value (param_id);
+ }
+ uid = (gchar *)soup_soap_parameter_get_string_value (param_id);
/*if (!e_cal_backend_cache_remove_component (cache, uid, NULL))
g_message ("Could not remove %s", uid); */
*deletes = g_slist_append (*deletes, uid);
- }
- }
+ }
+ }
/* process adds*/
param = soup_soap_parameter_get_first_child_by_name (param, "add");
- if (param) {
+ if (param) {
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
- subparam != NULL;
+ subparam != NULL;
subparam = soup_soap_parameter_get_next_child_by_name (subparam, "item")) {
/*process each item */
EGwItem *item;
/*FIXME pass the container id */
item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "Calendar", subparam);
- if (!item) {
- g_object_unref (response);
- g_object_unref (msg);
+ if (!item) {
+ g_object_unref (response);
+ g_object_unref (msg);
/* g_object_unref (cnc); */
return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ }
/*if (!e_cal_backend_cache_put_component (cache, comp))
g_message ("Could not add the component"); */
*adds = g_slist_append (*adds, item);
- }
- }
+ }
+ }
/* process updates*/
param = soup_soap_parameter_get_first_child_by_name (param, "update");
- if (param) {
+ if (param) {
for (subparam = soup_soap_parameter_get_first_child_by_name(param, "item");
subparam != NULL;
subparam = soup_soap_parameter_get_next_child (subparam)) {
item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "Calendar", subparam);
if (item)
*updates = g_slist_append (*updates, item);
- }
- }
+ }
+ }
/* free memory */
g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
e_gw_connection_modify_item (EGwConnection *cnc, const gchar *id , EGwItem *item)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "modifyItemRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "id", NULL, id);
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param;
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getItemRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "id", NULL, id);
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
-
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "item");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
*item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, container, param);
/* free memory */
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
if (!*item)
return E_GW_CONNECTION_STATUS_INVALID_OBJECT;
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
+ status = e_gw_connection_parse_response_status (response);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
+ status = e_gw_connection_parse_response_status (response);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
+ status = e_gw_connection_parse_response_status (response);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
+ status = e_gw_connection_parse_response_status (response);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
+ status = e_gw_connection_parse_response_status (response);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
gchar *
e_gw_connection_format_date_string (const gchar *dtstring)
{
- gchar *str2;
- gint i, j, len = strlen (dtstring);
+ gchar *str2;
+ gint i, j, len = strlen (dtstring);
- str2 = g_malloc0 (len);
+ str2 = g_malloc0 (len);
if (len <= 0)
return str2;
- for (i = 0,j = 0; i < len; i++) {
- if ((dtstring[i] != '-') && (dtstring[i] != ':')) {
+ for (i = 0,j = 0; i < len; i++) {
+ if ((dtstring[i] != '-') && (dtstring[i] != ':')) {
str2[j] = dtstring[i];
j++;
- }
- }
+ }
+ }
str2[j] = '\0';
- return str2;
+ return str2;
}
time_t
} else
g_warning ("Could not parse the string \n");
- return t;
+ return t;
}
EGwConnectionStatus
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
value = NULL;
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
EGwConnectionPrivate *priv;
SoupSoapParameter *param;
SoupSoapParameter *type_param;
}
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getAddressBookListRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_footer (msg);
/* send message to server */
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
+ if (!response) {
+ g_object_unref (msg);
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
- g_object_unref (msg);
+ status = e_gw_connection_parse_response_status (response);
+ g_object_unref (msg);
if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
- g_object_unref (response);
+ g_object_unref (response);
g_static_mutex_unlock (&connecting);
- return status;
- }
+ return status;
+ }
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "books");
- if (!param) {
- g_object_unref (response);
+ if (!param) {
+ g_object_unref (response);
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- } else {
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ } else {
SoupSoapParameter *subparam;
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "book");
subparam != NULL;
value = NULL;
type_param = soup_soap_parameter_get_first_child_by_name (subparam, "isFrequentContacts");
if (type_param)
- value = soup_soap_parameter_get_string_value (type_param);
+ value = soup_soap_parameter_get_string_value (type_param);
if (value && g_str_equal(value , "1"))
- e_gw_container_set_is_frequent_contacts (container, TRUE);
+ e_gw_container_set_is_frequent_contacts (container, TRUE);
g_free (value);
*container_list = priv->book_list;
g_static_mutex_unlock (&connecting);
- return status;
+ return status;
}
EGwConnectionStatus
g_return_val_if_fail (book_name != NULL, E_GW_CONNECTION_STATUS_INVALID_OBJECT);
status = e_gw_connection_get_address_book_list (cnc, &container_list);
- if (status != E_GW_CONNECTION_STATUS_OK) {
- return status;
- }
+ if (status != E_GW_CONNECTION_STATUS_OK) {
+ return status;
+ }
/* search the container in the list */
for (l = container_list; l != NULL; l = l->next) {
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "modifySettingsRequest");
if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
if (!e_gw_sendoptions_form_message_to_modify (msg, opts, priv->opts)) {
g_warning (G_STRLOC ": Could not append changes to SOAP message");
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
} else {
g_object_unref (priv->opts);
}
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
g_static_mutex_unlock (&connecting);
return status;
}
param = soup_soap_response_get_first_parameter_by_name (response, "settings");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- } else
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ } else
priv->opts = e_gw_sendoptions_new_from_soap_parameter (param);
g_object_ref (priv->opts);
*opts = priv->opts;
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
g_static_mutex_unlock (&connecting);
return E_GW_CONNECTION_STATUS_OK;
e_gw_connection_get_categories (EGwConnection *cnc, GHashTable **categories_by_id, GHashTable **categories_by_name)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
EGwConnectionPrivate *priv;
- SoupSoapParameter *param, *subparam, *second_level_child;
+ SoupSoapParameter *param, *subparam, *second_level_child;
gchar *id, *name;
static GStaticMutex connecting = G_STATIC_MUTEX_INIT;
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
priv = cnc->priv;
g_static_mutex_lock (&connecting);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getCategoryListRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
g_static_mutex_unlock (&connecting);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "categories");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
priv->categories_by_id = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
priv->categories_by_name = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free);
}
g_free (id);
g_free (name);
- }
+ }
/* free memory */
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
*categories_by_id = priv->categories_by_id;
*categories_by_name = priv->categories_by_name;
g_static_mutex_unlock (&connecting);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
g_return_val_if_fail (member_ids != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
g_return_val_if_fail (group_id != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "addMembersRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "container", NULL, group_id);
soup_soap_message_start_element (msg, "members", NULL, NULL);
soup_soap_message_end_element (msg);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
+ status = e_gw_connection_parse_response_status (response);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
g_return_val_if_fail (member_ids != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
g_return_val_if_fail (group_id != NULL, E_GW_CONNECTION_STATUS_UNKNOWN);
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "removeMembersRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "container", NULL, group_id);
soup_soap_message_start_element (msg, "members", NULL, NULL);
soup_soap_message_end_element (msg);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
- status = e_gw_connection_parse_response_status (response);
+ status = e_gw_connection_parse_response_status (response);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
SoupSoapParameter *param;
gchar *value;
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
param = soup_soap_response_get_first_parameter_by_name (response, "cursor");
if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
value = soup_soap_parameter_get_string_value (param);
if (!value) {
g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
*cursor =(gint) g_ascii_strtod (value, NULL);
g_free (value);
g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
g_return_val_if_fail ((container != NULL), E_GW_CONNECTION_STATUS_UNKNOWN);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
g_return_val_if_fail ((container != NULL), E_GW_CONNECTION_STATUS_UNKNOWN);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
SoupSoapParameter *param, *subparam;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "items");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
for (subparam = soup_soap_parameter_get_first_child_by_name (param, "item");
subparam != NULL;
item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, container, subparam);
if (item)
*item_list = g_list_append (*item_list, item);
- }
+ }
/* free memory */
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus e_gw_connection_get_quick_messages (EGwConnection *cnc, const gchar *container, const gchar *view, gchar **start_date, const gchar *message_list, const gchar *item_types, const gchar *item_sources, gint count, GSList **item_list)
{
SoupSoapMessage *msg;
SoupSoapResponse *response;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
SoupSoapParameter *param, *subparam;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_UNKNOWN);
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
*item_list = NULL;
param = soup_soap_response_get_first_parameter_by_name (response, "items");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
if (start_date && *start_date && (((!strcmp (message_list, "New")) || (!strcmp (message_list, "Modified"))))) {
subparam = soup_soap_response_get_first_parameter_by_name (response, "startDate");
if (subparam) {
item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, container, subparam);
if (item)
*item_list = g_slist_append (*item_list, item);
- }
+ }
/* free memory */
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
} else {
param = soup_soap_response_get_first_parameter_by_name (response, "id");
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
SoupSoapParameter *param;
gchar *buffer = NULL, *buf_length = NULL;
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getAttachmentRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "id", NULL, id);
e_gw_message_write_int_parameter (msg, "offset", NULL, offset);
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
-
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* free memory */
g_free (buffer);
g_free (buf_length);
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
/*
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
SoupSoapParameter *param;
gchar *buffer = NULL, *buf_length = NULL, *o_return = NULL;
- g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
+ g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getAttachmentRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "id", NULL, id);
e_gw_message_write_int_parameter (msg, "offset", NULL, offset);
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
-
- status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
+
+ status = e_gw_connection_parse_response_status (response);
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
g_free (buffer);
g_free (buf_length);
g_free (o_return);
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
e_gw_connection_rename_folder (EGwConnection *cnc, const gchar *id ,const gchar *new_name)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "modifyItemRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "id", NULL, id);
e_gw_connection_reply_item (EGwConnection *cnc, const gchar *id, const gchar *view, EGwItem **item)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "replyRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "id", NULL, id);
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "item");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
*item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "", param);
/* free memory */
- g_object_unref (response);
+ g_object_unref (response);
g_object_unref (msg);
if (!*item)
return E_GW_CONNECTION_STATUS_INVALID_OBJECT;
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
EGwConnectionStatus
e_gw_connection_forward_item (EGwConnection *cnc, const gchar *id, const gchar *view, gboolean embed, EGwItem **item)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "forwardRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_string_parameter (msg, "id", NULL, id);
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "item");
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
*item = e_gw_item_new_from_soap_parameter (cnc->priv->user_email, "", param);
e_gw_connection_create_junk_entry (EGwConnection *cnc, const gchar *value, const gchar *match_type, const gchar *list_type)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
g_return_val_if_fail (value != NULL, E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "createJunkEntryRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
soup_soap_message_start_element (msg, "entry", NULL, NULL);
e_gw_message_write_string_parameter (msg, "match", NULL, value);
e_gw_message_write_string_parameter (msg, "matchType", NULL, match_type);
e_gw_connection_get_junk_settings (EGwConnection *cnc, gint *use_junk, gint *use_block, gint *use_pab, gint *persistence)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
+ SoupSoapResponse *response;
SoupSoapParameter *param;
- EGwConnectionStatus status;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
e_gw_connection_get_junk_entries (EGwConnection *cnc, GList **entries)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_footer (msg);
response = e_gw_connection_send_message (cnc, msg);
e_gw_connection_get_proxy_list (EGwConnection *cnc, GList **proxy_info)
{
SoupSoapMessage *msg;
- SoupSoapResponse *response;
- EGwConnectionStatus status;
- SoupSoapParameter *param;
+ SoupSoapResponse *response;
+ EGwConnectionStatus status;
+ SoupSoapParameter *param;
g_return_val_if_fail (E_IS_GW_CONNECTION (cnc), E_GW_CONNECTION_STATUS_INVALID_OBJECT);
/* build the SOAP message */
msg = e_gw_message_new_with_header (cnc->priv->uri, cnc->priv->session_id, "getProxyListRequest");
- if (!msg) {
+ if (!msg) {
g_warning (G_STRLOC ": Could not build SOAP message");
- return E_GW_CONNECTION_STATUS_UNKNOWN;
- }
+ return E_GW_CONNECTION_STATUS_UNKNOWN;
+ }
e_gw_message_write_footer (msg);
/* send message to server */
- response = e_gw_connection_send_message (cnc, msg);
- if (!response) {
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_NO_RESPONSE;
- }
+ response = e_gw_connection_send_message (cnc, msg);
+ if (!response) {
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_NO_RESPONSE;
+ }
status = e_gw_connection_parse_response_status (response);
- if (status != E_GW_CONNECTION_STATUS_OK) {
+ if (status != E_GW_CONNECTION_STATUS_OK) {
if (status == E_GW_CONNECTION_STATUS_INVALID_CONNECTION)
reauthenticate (cnc);
g_object_unref (response);
- g_object_unref (msg);
+ g_object_unref (msg);
return status;
}
/* if status is OK - parse result. return the list */
param = soup_soap_response_get_first_parameter_by_name (response, "proxies");
- e_gw_proxy_construct_proxy_list (param, proxy_info);
- if (!param) {
- g_object_unref (response);
- g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
- }
-
- g_object_unref (response);
+ e_gw_proxy_construct_proxy_list (param, proxy_info);
+ if (!param) {
+ g_object_unref (response);
+ g_object_unref (msg);
+ return E_GW_CONNECTION_STATUS_INVALID_RESPONSE;
+ }
+
+ g_object_unref (response);
g_object_unref (msg);
- return E_GW_CONNECTION_STATUS_OK;
+ return E_GW_CONNECTION_STATUS_OK;
}
static SoupSoapMessage*
{
g_return_val_if_fail (E_IS_GW_CONTAINER (container), FALSE);
- return container->priv->is_frequent_contacts;
+ return container->priv->is_frequent_contacts;
}
void
e_gw_container_set_is_frequent_contacts (EGwContainer *container, gboolean is_frequent_contacts)
{
- g_return_if_fail (E_IS_GW_CONTAINER (container));
+ g_return_if_fail (E_IS_GW_CONTAINER (container));
- container->priv->is_frequent_contacts = is_frequent_contacts;
+ container->priv->is_frequent_contacts = is_frequent_contacts;
}
gboolean
if (priv->action)
g_free (priv->action);
if (priv->env_uri)
- xmlFree (priv->env_uri);
+ xmlFree (priv->env_uri);
if (priv->env_prefix)
- xmlFree (priv->env_prefix);
+ xmlFree (priv->env_prefix);
G_OBJECT_CLASS (soup_soap_message_parent_class)->finalize (object);
}
fetch_ns (SoupSoapMessage *msg, const gchar *prefix, const gchar *ns_uri)
{
SoupSoapMessagePrivate *priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- xmlNsPtr ns = NULL;
+ xmlNsPtr ns = NULL;
- if (prefix && ns_uri)
- ns = xmlNewNs (priv->last_node, (const xmlChar *)ns_uri, (const xmlChar *)prefix);
- else if (prefix && !ns_uri) {
- ns = xmlSearchNs (priv->doc, priv->last_node, (const xmlChar *)prefix);
- if (!ns)
+ if (prefix && ns_uri)
+ ns = xmlNewNs (priv->last_node, (const xmlChar *)ns_uri, (const xmlChar *)prefix);
+ else if (prefix && !ns_uri) {
+ ns = xmlSearchNs (priv->doc, priv->last_node, (const xmlChar *)prefix);
+ if (!ns)
ns = xmlNewNs (priv->last_node, (const xmlChar *)"", (const xmlChar *)prefix);
- }
+ }
- return ns;
+ return ns;
}
/**
void
soup_soap_message_end_fault (SoupSoapMessage *msg)
{
- soup_soap_message_end_element (msg);
+ soup_soap_message_end_element (msg);
}
/**
{
SoupSoapMessagePrivate *priv;
- g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
+ g_return_if_fail (SOUP_IS_SOAP_MESSAGE (msg));
priv = SOUP_SOAP_MESSAGE_GET_PRIVATE (msg);
- priv->last_node = xmlNewChild (priv->last_node,
+ priv->last_node = xmlNewChild (priv->last_node,
priv->soap_ns,
(const xmlChar *)"detail",
NULL);
void
soup_soap_message_write_base64 (SoupSoapMessage *msg, const gchar *string, gint len)
{
- gchar *str = g_base64_encode ((const guchar *)string, len);
- soup_soap_message_write_string (msg, str);
- g_free (str);
+ gchar *str = g_base64_encode ((const guchar *)string, len);
+ soup_soap_message_write_string (msg, str);
+ g_free (str);
}
/**
void
soup_soap_message_write_time (SoupSoapMessage *msg, const time_t *timeval)
{
- gchar *str = g_strchomp (ctime (timeval));
- soup_soap_message_write_string (msg, str);
+ gchar *str = g_strchomp (ctime (timeval));
+ soup_soap_message_write_string (msg, str);
}
/**