if (!g_file_test (filename, G_FILE_TEST_EXISTS | G_FILE_TEST_IS_DIR)) {
g_free (filename);
filename = NULL;
- }
+ }
}
if (!filename) {
else {
g_warning ("unhandled search result type %d returned", msg_type);
e_data_book_respond_get_contact_list_uids (op->book, op->opid,
- e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR,
+ e_data_book_create_error_fmt (E_DATA_BOOK_STATUS_OTHER_ERROR,
"%s: Unhandled search result type %d returned", G_STRFUNC, msg_type),
NULL);
ldap_op_finished (op);
object_class = G_OBJECT_CLASS (klass);
object_class->dispose = book_client_view_dispose;
- signals [OBJECTS_ADDED] =
+ signals[OBJECTS_ADDED] =
g_signal_new ("objects-added",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signals [OBJECTS_MODIFIED] =
+ signals[OBJECTS_MODIFIED] =
g_signal_new ("objects-modified",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signals [OBJECTS_REMOVED] =
+ signals[OBJECTS_REMOVED] =
g_signal_new ("objects-removed",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
g_cclosure_marshal_VOID__POINTER,
G_TYPE_NONE, 1, G_TYPE_POINTER);
- signals [PROGRESS] =
+ signals[PROGRESS] =
g_signal_new ("progress",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
e_gdbus_marshallers_VOID__UINT_STRING,
G_TYPE_NONE, 2, G_TYPE_UINT, G_TYPE_STRING);
- signals [COMPLETE] =
+ signals[COMPLETE] =
g_signal_new ("complete",
G_OBJECT_CLASS_TYPE (object_class),
G_SIGNAL_RUN_LAST,
GType e_book_client_view_get_type (void);
struct _EBookClient * e_book_client_view_get_client (EBookClientView *view);
gboolean e_book_client_view_is_running (EBookClientView *view);
-void e_book_client_view_set_fields_of_interest(EBookClientView *view, const GSList *fields_of_interest, GError **error);
+void e_book_client_view_set_fields_of_interest (EBookClientView *view, const GSList *fields_of_interest, GError **error);
void e_book_client_view_start (EBookClientView *view, GError **error);
void e_book_client_view_stop (EBookClientView *view, GError **error);
safe_uid = e_util_utf8_make_valid (uid);
g_return_if_fail (safe_uid != NULL);
-
+
e_client_proxy_call_string (E_CLIENT (client), safe_uid, cancellable, callback, user_data, e_book_client_get_contact,
e_gdbus_book_call_get_contact,
NULL, NULL, e_gdbus_book_call_get_contact_finish, NULL, NULL);
relative_uri = e_source_peek_relative_uri (source);
if (g_strcmp0 (relative_uri, "system") == 0) {
- personal = source;
- break;
+ personal = source;
+ break;
}
}
e_source_set_property (source, "completion", "true");
source_uri = e_source_get_uri (source);
- g_object_unref(source);
+ g_object_unref (source);
} else {
/* Force the source name to the current locale. */
e_source_set_name (personal, name);
return type_id__volatile;
}
-
/**
* e_vcard_remove_attributes:
* @evc: vcard object
attr->encoding = EVC_ENCODING_RAW;
}
-
GType
e_vcard_attribute_param_get_type (void)
{
if (photo) {
/* Compare the photo uri with the string */
- if ((photo->type == E_CONTACT_PHOTO_TYPE_URI)
- && compare(photo->data.uri, str)) {
- ret_val = TRUE;
+ if ((photo->type == E_CONTACT_PHOTO_TYPE_URI)
+ && compare (photo->data.uri, str)) {
+ ret_val = TRUE;
}
e_contact_photo_free (photo);
}
gboolean ret_val = FALSE;
if (date_str) {
- if (compare(date_str, str)) {
+ if (compare (date_str, str)) {
ret_val = TRUE;
}
g_free (date_str);
else if (info->prop_type == PROP_TYPE_DATE) {
/* the special searches that match dates */
EContactDate *date;
-
+
date = e_contact_get (ctx->contact, info->field_id);
if (date) {
truth = compare_date (date, argv[1]->value.string, compare);
- e_contact_date_free (date);
+ e_contact_date_free (date);
}
}
GList *a, *attrs = e_vcard_get_attributes (E_VCARD (ctx->contact));
for (a = attrs; a && !truth; a = a->next) {
EVCardAttribute *attr = (EVCardAttribute *) a->data;
- if (g_ascii_strcasecmp (e_vcard_attribute_get_name (attr), propname) == 0) {
+ if (g_ascii_strcasecmp (e_vcard_attribute_get_name (attr), propname) == 0) {
GList *l, *values = e_vcard_attribute_get_values (attr);
for (l = values; l && !truth; l = l->next) {
static void
quit_tests (void)
{
-
+
if (error != NULL) {
g_print ("Tests failed: %s - %s \n", op, error->message);
g_clear_error (&error);
}
-
+
g_main_loop_quit (main_loop);
}
g_print ("Adding contact \n");
op = "add contact";
-
+
con = e_contact_new_from_vcard (vcard_str);
contacts = g_slist_append (contacts, con);
e_book_backend_sqlitedb_add_contacts (ebsdb, folderid, contacts, FALSE, &error);
-
+
g_object_unref (con);
}
{
GSList *vcards;
EbSdbSearchData *s_data;
-
+
g_print ("%s - query: %s \n", type, sexp);
op = type;
vcards = e_book_backend_sqlitedb_search (ebsdb, folderid, sexp, NULL, &error);
g_print ("Creating the sqlitedb \n");
op = "create sqlitedb";
- ebsdb = e_book_backend_sqlitedb_new
+ ebsdb = e_book_backend_sqlitedb_new
(cache_path, email, folderid, folder_name,
store_vcard, &error);
if (error)
e_book_backend_sqlitedb_set_is_populated (ebsdb, folderid, TRUE, &error);
if (error)
goto exit;
-
+
g_print ("Setting is_populated \n");
op = "set is_populated";
populated = e_book_backend_sqlitedb_get_is_populated (ebsdb, folderid, &error);
if (error)
goto exit;
g_print ("Populated: %d \n", populated);
-
+
g_print ("Setting key value \n");
op = "set key/value";
e_book_backend_sqlitedb_set_key_value (ebsdb, folderid, "customkey", "stored", &error);
if (error)
goto exit;
-
+
g_print ("Get Vcard string \n");
op = "get vcard string";
vcard_str = e_book_backend_sqlitedb_get_vcard_string (ebsdb, folderid, uid, &error);
if (error)
goto exit;
}
-
+
g_print ("Delete contact \n");
op = "delete contact";
uids = g_slist_append (uids, (gchar *) uid);
g_print ("Delete addressbook \n");
op = "delete addressbook";
e_book_backend_sqlitedb_delete_addressbook (ebsdb, folderid, &error);
-
+
exit:
g_object_unref (ebsdb);
quit_tests ();
- return FALSE;
+ return FALSE;
}
gint
static GHashTable *db_connections = NULL;
static GStaticMutex dbcon_lock = G_STATIC_MUTEX_INIT;
-static int
+static gint
store_data_to_vcard (gpointer ref, gint ncol, gchar **cols, gchar **name);
static GQuark
static void
e_book_backend_sqlitedb_init (EBookBackendSqliteDB *ebsdb)
{
- ebsdb->priv = g_new0 (EBookBackendSqliteDBPrivate, 1) ;
+ ebsdb->priv = g_new0 (EBookBackendSqliteDBPrivate, 1);
ebsdb->priv->store_vcard = TRUE;
g_static_rw_lock_init (&ebsdb->priv->rwlock);
}
-
static void
e_book_sqlitedb_match_func (sqlite3_context *ctx, gint nArgs, sqlite3_value **values)
{
static gint
book_backend_sql_exec (sqlite3 *db,
const gchar *stmt,
- gint (*callback)(void*,gint,gchar**,gchar**),
+ gint (*callback)(gpointer ,gint,gchar **,gchar **),
gpointer data,
GError **error)
{
if (!err)
book_backend_sql_exec (ebsdb->priv->db, stmt, NULL, NULL , &err);
-
/* Create a child table to store key/value pairs for a folder */
if (!err) {
stmt = "CREATE TABLE IF NOT EXISTS keys"
return;
}
-
static gint
folder_found_cb (gpointer ref, gint col, gchar **cols, gchar **name)
{
if (!err) {
stmt = sqlite3_mprintf ("INSERT OR REPLACE INTO folders VALUES ( %Q, %Q, %Q, %d, %d, %d ) ",
- folderid, folder_name, NULL, 0, 0, FOLDER_VERSION);
+ folderid, folder_name, NULL, 0, 0, FOLDER_VERSION);
book_backend_sql_exec (ebsdb->priv->db, stmt, NULL, NULL, &err);
return;
}
-
/* The column names match the fields used in book-backend-sexp */
static gint
create_contacts_table (EBookBackendSqliteDB *ebsdb,
ret = book_backend_sql_exec (ebsdb->priv->db, stmt, NULL, NULL , &err);
sqlite3_free (stmt);
-
/* Create indexes on full_name and email_1 as autocompletion queries would mainly
rely on this. Assuming that the frequency of matching on these would be higher than
on the other fields like email_2, surname etc. email_1 should be the primary email */
EContact *contact = (EContact *) l->data;
stmt = insert_stmt_from_contact (contact, partial_content, folderid,
- priv->store_vcard);
+ priv->store_vcard);
book_backend_sql_exec (priv->db, stmt, NULL, NULL, &err);
sqlite3_free (stmt);
GError **error)
{
GSList l;
- l.data = (char*)uid; /* Won't modify it, I promise :) */
+ l.data = (gchar *) uid; /* Won't modify it, I promise :) */
l.next = NULL;
return e_book_backend_sqlitedb_remove_contacts (ebsdb, folderid, &l,
error);
struct _contact_info *cinfo = ref;
cinfo->exists = TRUE;
- cinfo->partial_content = cols [0] ? strtoul (cols [0], NULL, 10) : 0;
+ cinfo->partial_content = cols[0] ? strtoul (cols[0], NULL, 10) : 0;
return 0;
}
{
gchar **vcard_str = ref;
- if (cols [0])
+ if (cols[0])
*vcard_str = g_strdup (cols [0]);
return 0;
e_book_backend_sqlitedb_get_contact (EBookBackendSqliteDB *ebsdb,
const gchar *folderid,
const gchar *uid,
- GError **error)
+ GError **error)
{
GError *err = NULL;
EContact *contact = NULL;
gchar *vcard = e_book_backend_sqlitedb_get_vcard_string (ebsdb, folderid, uid, &err);
if (!err) {
- contact = e_contact_new_from_vcard(vcard);
+ contact = e_contact_new_from_vcard (vcard);
g_free (vcard);
} else
g_propagate_error (error, err);
if (!ebsdb->priv->store_vcard) {
GSList *vcards = NULL;
-
+
stmt = sqlite3_mprintf ("SELECT uid, nickname, full_name, given_name, family_name, file_as, email_1, email_2, "
"email_3, is_list, list_show_addresses, wants_html FROM %Q WHERE uid = %Q", folderid, uid);
book_backend_sql_exec (ebsdb->priv->db, stmt, store_data_to_vcard, &vcards, error);
EbSdbSearchData *s_data = (EbSdbSearchData *) vcards->data;
vcard_str = s_data->vcard;
-
+
g_free (s_data->uid);
g_free (s_data->bdata);
g_free (s_data);
for (i = 0; i < G_N_ELEMENTS (check_symbols); i++) {
if (check_symbols[i].type == 1) {
e_sexp_add_ifunction (sexp, 0, check_symbols[i].name,
- (ESExpIFunc *)check_symbols[i].func, NULL);
+ (ESExpIFunc *) check_symbols[i].func, NULL);
} else {
e_sexp_add_function (sexp, 0, check_symbols[i].name,
check_symbols[i].func, NULL);
return r;
}
-
typedef enum {
MATCH_CONTAINS,
MATCH_IS,
/* only a subset of headers are supported .. */
field = argv[0]->value.string;
- if (argv[1]->type == ESEXP_RES_STRING && argv[1]->value.string [0] != 0) {
+ if (argv[1]->type == ESEXP_RES_STRING && argv[1]->value.string[0] != 0) {
gchar *value=NULL;
if (match == MATCH_CONTAINS) {
{ "endswith", func_endswith, 0 },
};
-static char *
+static gchar *
sexp_to_sql_query (const gchar *query)
{
ESExp *sexp;
GSList **vcard_data = ref;
EbSdbSearchData *s_data = g_new0 (EbSdbSearchData, 1);
- if (cols [0])
- s_data->uid = g_strdup (cols [0]);
+ if (cols[0])
+ s_data->uid = g_strdup (cols[0]);
- if (cols [1])
- s_data->vcard = g_strdup (cols [1]);
-
- if (cols [2])
- s_data->bdata = g_strdup (cols [1]);
+ if (cols[1])
+ s_data->vcard = g_strdup (cols[1]);
+
+ if (cols[2])
+ s_data->bdata = g_strdup (cols[1]);
*vcard_data = g_slist_prepend (*vcard_data, s_data);
{
GSList **uids = ref;
- if (cols [0])
+ if (cols[0])
*uids = g_slist_prepend (*uids, g_strdup (cols [0]));
return 0;
}
-static int
+static gint
store_data_to_vcard (gpointer ref, gint ncol, gchar **cols, gchar **name)
{
GSList **vcard_data = ref;
continue;
if (!strcmp (name [i], "uid")) {
- e_contact_set (contact, E_CONTACT_UID, cols [i]);
-
- search_data->uid = g_strdup (cols [i]);
+ e_contact_set (contact, E_CONTACT_UID, cols[i]);
+
+ search_data->uid = g_strdup (cols[i]);
} else if (!strcmp (name [i], "nickname"))
- e_contact_set (contact, E_CONTACT_NICKNAME, cols [i]);
+ e_contact_set (contact, E_CONTACT_NICKNAME, cols[i]);
else if (!strcmp (name [i], "full_name"))
- e_contact_set (contact, E_CONTACT_FULL_NAME, cols [i]);
+ e_contact_set (contact, E_CONTACT_FULL_NAME, cols[i]);
else if (!strcmp (name [i], "given_name"))
- e_contact_set (contact, E_CONTACT_GIVEN_NAME, cols [i]);
+ e_contact_set (contact, E_CONTACT_GIVEN_NAME, cols[i]);
else if (!strcmp (name [i], "family_name"))
- e_contact_set (contact, E_CONTACT_FAMILY_NAME, cols [i]);
+ e_contact_set (contact, E_CONTACT_FAMILY_NAME, cols[i]);
else if (!strcmp (name [i], "file_as"))
- e_contact_set (contact, E_CONTACT_FILE_AS, cols [i]);
+ e_contact_set (contact, E_CONTACT_FILE_AS, cols[i]);
else if (!strcmp (name [i], "email_1"))
- e_contact_set (contact, E_CONTACT_EMAIL_1, cols [i]);
+ e_contact_set (contact, E_CONTACT_EMAIL_1, cols[i]);
else if (!strcmp (name [i], "email_2"))
- e_contact_set (contact, E_CONTACT_EMAIL_2, cols [i]);
+ e_contact_set (contact, E_CONTACT_EMAIL_2, cols[i]);
else if (!strcmp (name [i], "email_3"))
- e_contact_set (contact, E_CONTACT_EMAIL_3, cols [i]);
+ e_contact_set (contact, E_CONTACT_EMAIL_3, cols[i]);
else if (!strcmp (name [i], "is_list")) {
gint val = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
e_contact_set (contact, E_CONTACT_IS_LIST, GINT_TO_POINTER (val));
gint val = cols[i] ? strtoul (cols[i], NULL, 10) : 0;
e_contact_set (contact, E_CONTACT_WANTS_HTML, GINT_TO_POINTER (val));
} else if (!strcmp (name [i], "bdata")) {
- search_data->bdata = g_strdup (cols [i]);
+ search_data->bdata = g_strdup (cols[i]);
}
-
+
}
vcard = e_vcard_to_string (E_VCARD (contact), EVC_FORMAT_VCARD_30);
}
static GSList *
-book_backend_sqlitedb_search_query (EBookBackendSqliteDB *ebsdb,
- const gchar *sql,
- const gchar *folderid,
- GSList *fields_of_interest,
+book_backend_sqlitedb_search_query (EBookBackendSqliteDB *ebsdb,
+ const gchar *sql,
+ const gchar *folderid,
+ GSList *fields_of_interest,
GError **error)
{
GError *err = NULL;
for (l = all; l != NULL; l = g_slist_next (l)) {
EbSdbSearchData *s_data = (EbSdbSearchData *) l->data;
-
+
if (e_book_backend_sexp_match_vcard (bsexp, s_data->vcard)) {
if (!return_uids)
r_list = g_slist_prepend (r_list, s_data);
return search_contacts;
}
-GSList *
+GSList *
e_book_backend_sqlitedb_search_uids (EBookBackendSqliteDB *ebsdb,
const gchar *folderid,
const gchar *sexp,
GError **error)
{
GSList *uids = NULL;
-
+
if (book_backend_sqlitedb_is_summary_query (sexp)) {
gchar *stmt;
gchar *sql_query = sexp_to_sql_query (sexp);
READER_LOCK (ebsdb);
-
+
stmt = sqlite3_mprintf ("SELECT uid FROM %Q WHERE %s", folderid, sql_query);
book_backend_sql_exec (ebsdb->priv->db, stmt, addto_slist_cb, &uids, error);
sqlite3_free (stmt);
}
-
gboolean
e_book_backend_sqlitedb_set_is_populated (EBookBackendSqliteDB *ebsdb,
const gchar *folderid,
return !err;
}
-static int
+static gint
get_string_cb (gpointer ref, gint col, gchar **cols, gchar **name)
{
gchar **ret = ref;
return 0;
}
-
-gchar *
+gchar *
e_book_backend_sqlitedb_get_contact_bdata (EBookBackendSqliteDB *ebsdb,
const gchar *folderid,
const gchar *uid,
return ret;
}
-gboolean
+gboolean
e_book_backend_sqlitedb_set_contact_bdata (EBookBackendSqliteDB *ebsdb,
const gchar *folderid,
const gchar *uid,
return !err;
}
-void
+void
e_book_backend_sqlitedb_search_data_free (EbSdbSearchData *s_data)
{
if (s_data) {
}
}
-gboolean
+gboolean
e_book_backend_sqlitedb_remove (EBookBackendSqliteDB *ebsdb,
GError **error)
{
priv = ebsdb->priv;
WRITER_LOCK (ebsdb);
-
+
sqlite3_close (priv->db);
filename = g_build_filename (priv->path, DB_FILENAME, NULL);
ret = g_unlink (filename);
const gchar *sexp,
GSList *fields_of_interest,
GError **error);
-GSList * e_book_backend_sqlitedb_search_uids
+GSList * e_book_backend_sqlitedb_search_uids
(EBookBackendSqliteDB *ebsdb,
const gchar *folderid,
const gchar *sexp,
GError **error);
gboolean e_book_backend_sqlitedb_remove (EBookBackendSqliteDB *ebsdb,
GError **error);
-void e_book_backend_sqlitedb_search_data_free
+void e_book_backend_sqlitedb_search_data_free
(EbSdbSearchData *s_data);
G_END_DECLS
void e_book_backend_sync_open (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, gboolean only_if_exists, GError **error);
void e_book_backend_sync_remove (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, GError **error);
void e_book_backend_sync_refresh (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, GError **error);
-gboolean e_book_backend_sync_get_backend_property(EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *prop_name, gchar **prop_value, GError **error);
-gboolean e_book_backend_sync_set_backend_property(EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *prop_name, const gchar *prop_value, GError **error);
+gboolean e_book_backend_sync_get_backend_property (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *prop_name, gchar **prop_value, GError **error);
+gboolean e_book_backend_sync_set_backend_property (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *prop_name, const gchar *prop_value, GError **error);
void e_book_backend_sync_create_contact (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *vcard, EContact **contact, GError **error);
void e_book_backend_sync_remove_contacts (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const GSList *id_list, GSList **removed_ids, GError **error);
void e_book_backend_sync_modify_contact (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *vcard, EContact **contact, GError **error);
void e_book_backend_sync_get_contact (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *id, gchar **vcard, GError **error);
void e_book_backend_sync_get_contact_list (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *query, GSList **contacts, GError **error);
-void e_book_backend_sync_get_contact_list_uids(EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *query, GSList **contacts_uids, GError **error);
+void e_book_backend_sync_get_contact_list_uids (EBookBackendSync *backend, EDataBook *book, GCancellable *cancellable, const gchar *query, GSList **contacts_uids, GError **error);
void e_book_backend_sync_authenticate_user (EBookBackendSync *backend, GCancellable *cancellable, ECredentials *credentials, GError **error);
e_book_backend_remove_contacts (EBookBackend *backend,
EDataBook *book,
guint32 opid,
- GCancellable *cancellable,
+ GCancellable *cancellable,
const GSList *id_list)
{
g_return_if_fail (E_IS_BOOK_BACKEND (backend));
gboolean e_book_backend_is_readonly (EBookBackend *backend);
gboolean e_book_backend_is_removed (EBookBackend *backend);
void e_book_backend_set_online (EBookBackend *backend, gboolean is_online);
-void e_book_backend_authenticate_user(EBookBackend *backend, GCancellable *cancellable, ECredentials *credentials);
+void e_book_backend_authenticate_user (EBookBackend *backend, GCancellable *cancellable, ECredentials *credentials);
void e_book_backend_get_backend_property (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *prop_name);
void e_book_backend_set_backend_property (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *prop_name, const gchar *prop_value);
void e_book_backend_modify_contact (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *vcard);
void e_book_backend_get_contact (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *id);
void e_book_backend_get_contact_list (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *query);
-void e_book_backend_get_contact_list_uids(EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *query);
+void e_book_backend_get_contact_list_uids (EBookBackend *backend, EDataBook *book, guint32 opid, GCancellable *cancellable, const gchar *query);
void e_book_backend_start_book_view (EBookBackend *backend, EDataBookView *view);
void e_book_backend_stop_book_view (EBookBackend *backend, EDataBookView *view);
}
path = construct_bookview_path ();
-
+
book_view = e_data_book_view_new (op->book, op->d.query, card_sexp);
e_data_book_view_register_gdbus_object (book_view, e_gdbus_book_stub_get_connection (op->book->priv->gdbus_object), path, &error);
}
/* takes a list of strings and converts it to a comma-separated string of values;
- free returned pointer with g_free() */
+ free returned pointer with g_free () */
gchar *
e_data_book_string_slist_to_comma_string (const GSList *strings)
{
_signal_name_to_id = g_hash_table_new (g_str_hash, g_str_equal);
_signal_name_to_type = g_hash_table_new (g_str_hash, g_str_equal);
-
/* GObject signals definitions for D-Bus signals: */
E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookViewIface, "objects_added", objects_added, __OBJECTS_ADDED_SIGNAL)
E_INIT_GDBUS_SIGNAL_STRV (EGdbusBookViewIface, "objects_modified", objects_modified, __OBJECTS_MODIFIED_SIGNAL)
void (*objects_added) (EGdbusBookView *object, const gchar * const *arg_objects);
void (*objects_modified) (EGdbusBookView *object, const gchar * const *arg_objects);
void (*objects_removed) (EGdbusBookView *object, const gchar * const *arg_uids);
-
+
void (*progress) (EGdbusBookView *object, guint arg_percent, const gchar *arg_message);
void (*complete) (EGdbusBookView *object, const gchar * const *arg_error);
#define e_gdbus_book_view_complete_dispose e_gdbus_complete_sync_method_void
#define e_gdbus_book_view_complete_set_fields_of_interest e_gdbus_complete_sync_method_void
-
/* D-Bus Signal Emission Helpers */
void e_gdbus_book_view_emit_objects_added (EGdbusBookView *object, const gchar * const *arg_objects);
void e_gdbus_book_view_emit_objects_modified (EGdbusBookView *object, const gchar * const *arg_objects);
g_object_set_data_full (G_OBJECT (object), "gdbus-codegen-path", (gpointer) g_strdup (object_path), g_free);
g_object_set_data (G_OBJECT (object), "gdbus-codegen-connection", (gpointer) connection);
g_object_set_data_full (G_OBJECT (object), "gdbus-codegen-pvc", (gpointer) pvc, (GDestroyNotify) g_hash_table_unref);
-
+
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);
}
#include <libedata-cal/e-cal-backend-sexp.h>
#include <libebook/e-book.h>
-
#define EDC_ERROR(_code) e_data_cal_create_error (_code, NULL)
G_DEFINE_TYPE (ECalBackendContacts, e_cal_backend_contacts, E_TYPE_CAL_BACKEND_SYNC)
}
static void
-e_cal_backend_contacts_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable,
+e_cal_backend_contacts_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable,
const GSList *users, time_t start, time_t end,
GSList **freebusy, GError **perror)
{
if (rid) {
/* remove recurrence */
if (g_hash_table_lookup_extended (obj_data->recurrences, rid,
- (gpointer *)&hash_rid, (gpointer *)&comp)) {
+ (gpointer *)&hash_rid, (gpointer *)&comp)) {
/* Removing without parent or not modifying parent?
Report removal to caller. */
if (old_object &&
instead rely on the view detecting
whether it contains the id */
ECalComponentId id;
- id.uid = (gchar *)uid;
- id.rid = (gchar *)rid;
+ id.uid = (gchar *) uid;
+ id.rid = (gchar *) rid;
e_cal_backend_notify_object_removed (E_CAL_BACKEND (cbfile), &id, NULL, NULL);
}
for (i = 0; seq[i]; i++) {
icalcomponent *comp;
- comp = icalcomponent_new_from_string ((gchar *)seq[i]);
+ comp = icalcomponent_new_from_string ((gchar *) seq[i]);
if (!comp)
continue;
GType e_cal_client_view_get_type (void);
struct _ECalClient * e_cal_client_view_get_client (ECalClientView *view);
gboolean e_cal_client_view_is_running (ECalClientView *view);
-void e_cal_client_view_set_fields_of_interest(ECalClientView *view, const GSList *fields_of_interest, GError **error);
+void e_cal_client_view_set_fields_of_interest (ECalClientView *view, const GSList *fields_of_interest, GError **error);
void e_cal_client_view_start (ECalClientView *view, GError **error);
void e_cal_client_view_stop (ECalClientView *view, GError **error);
g_return_if_fail (E_IS_CAL_CLIENT (client));
g_return_if_fail (free_busy_strv != NULL);
-
for (ii = 0; free_busy_strv[ii]; ii++) {
ECalComponent *comp;
icalcomponent *icalcomp;
/* Check predefined capabilities */
gboolean e_cal_client_check_one_alarm_only (ECalClient *client);
gboolean e_cal_client_check_save_schedules (ECalClient *client);
-gboolean e_cal_client_check_organizer_must_attend(ECalClient *client);
-gboolean e_cal_client_check_organizer_must_accept(ECalClient *client);
-gboolean e_cal_client_check_recurrences_no_master(ECalClient *client);
+gboolean e_cal_client_check_organizer_must_attend (ECalClient *client);
+gboolean e_cal_client_check_organizer_must_accept (ECalClient *client);
+gboolean e_cal_client_check_recurrences_no_master (ECalClient *client);
/* Utility functions */
void e_cal_client_free_icalcomp_slist (GSList *icalcomps);
void e_cal_backend_sync_open (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, gboolean only_if_exists, GError **error);
void e_cal_backend_sync_remove (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, GError **error);
void e_cal_backend_sync_refresh (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, GError **error);
-gboolean e_cal_backend_sync_get_backend_property(ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *prop_name, gchar **prop_value, GError **error);
-gboolean e_cal_backend_sync_set_backend_property(ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *prop_name, const gchar *prop_value, GError **error);
+gboolean e_cal_backend_sync_get_backend_property (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *prop_name, gchar **prop_value, GError **error);
+gboolean e_cal_backend_sync_set_backend_property (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *prop_name, const gchar *prop_value, GError **error);
void e_cal_backend_sync_get_object (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *uid, const gchar *rid, gchar **calobj, GError **error);
void e_cal_backend_sync_get_object_list (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const gchar *sexp, GSList **calobjs, GError **error);
void e_cal_backend_sync_get_free_busy (ECalBackendSync *backend, EDataCal *cal, GCancellable *cancellable, const GSList *users, time_t start, time_t end, GSList **freebusyobjs, GError **error);
EDataCalViewPrivate *priv = view->priv;
gchar *ids;
gchar *uid, *rid;
- size_t uid_len, rid_len;
+ gsize uid_len, rid_len;
send_pending_adds (view);
send_pending_changes (view);
g_error_free (error);
}
-
EDataCal *
e_data_cal_new (ECalBackend *backend, ESource *source)
{
}
/* encodes source and source type into a strv usable for a wire transfer;
- Free returned pointer with g_strfreev() */
+ Free returned pointer with g_strfreev () */
gchar **
e_gdbus_cal_factory_encode_get_cal (const gchar *in_source, guint in_type)
{
}
/* decodes source and source type from a strv recevied from a wire transfer;
- free out_source with g_free(); returns TRUE is successful. */
+ free out_source with g_free (); returns TRUE is successful. */
gboolean
e_gdbus_cal_factory_decode_get_cal (const gchar * const * in_strv, gchar **out_source, guint *out_type)
{
_signal_name_to_id = g_hash_table_new (g_str_hash, g_str_equal);
_signal_name_to_type = g_hash_table_new (g_str_hash, g_str_equal);
-
/* GObject signals definitions for D-Bus signals: */
E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalViewIface, "objects_added", objects_added, __OBJECTS_ADDED_SIGNAL)
E_INIT_GDBUS_SIGNAL_STRV (EGdbusCalViewIface, "objects_modified",objects_modified, __OBJECTS_MODIFIED_SIGNAL)
{
e_gdbus_proxy_method_call_void ("close", proxy, cancellable, callback, user_data);
}
-
+
gboolean
e_gdbus_cal_call_close_finish (GDBusProxy *proxy, GAsyncResult *result, GError **error)
{
if (g_stat (dpath, &st) == 0
&& S_ISREG (st.st_mode)
&& (expire_all
- || (cdc->priv->expire_age != -1 && st.st_mtime + cdc->priv->expire_age < now)
+ || (cdc->priv->expire_age != -1 && st.st_mtime + cdc->priv->expire_age < now)
|| (cdc->priv->expire_access != -1 && st.st_atime + cdc->priv->expire_access < now))) {
g_unlink (dpath);
stream = camel_object_bag_get (cdc->priv->busy_bag, dpath);
#define WRITER_LOCK(cdb) g_static_rw_lock_writer_lock (&cdb->priv->rwlock)
#define WRITER_UNLOCK(cdb) g_static_rw_lock_writer_unlock (&cdb->priv->rwlock)
-
static sqlite3_vfs *old_vfs = NULL;
static GThreadPool *sync_pool = NULL;
static gint
cdb_sql_exec (sqlite3 *db,
const gchar *stmt,
- gint (*callback)(void*,gint,gchar**,gchar**),
+ gint (*callback)(gpointer ,gint,gchar **,gchar **),
gpointer data,
GError **error)
{
if (!cdb)
return TRUE;
-
+
WRITER_LOCK (cdb);
START (stmt);
ret = cdb_sql_exec (cdb->db, stmt, NULL, NULL, error);
END;
-
- WRITER_UNLOCK (cdb);
+ WRITER_UNLOCK (cdb);
return ret;
}
ret = cdb_sql_exec (cdb->db, "COMMIT", NULL, NULL, error);
cdb->priv->transaction_is_on = FALSE;
-
+
ENDTS;
WRITER_UNLOCK (cdb);
CAMEL_DB_RELEASE_SQLITE_MEMORY;
{
gint ret = -1;
-
READER_LOCK (cdb);
-
+
START (query);
ret = cdb_sql_exec (cdb->db, query, count_cb, count, error);
END;
{
gint *version = (gint *) ref;
- if (cols [0])
+ if (cols[0])
*version = strtoul (cols [0], NULL, 10);
return 0;
current_version = camel_db_get_folder_version (cdb, folder_name, &err);
camel_db_begin_transaction (cdb, &err);
-
+
/* Migration stage one: storing the old data if necessary */
ret = camel_db_migrate_folder_prepare (cdb, folder_name, current_version, &err);
if (err)
ret = camel_db_write_folder_version (cdb, folder_name, current_version, &err);
if (err)
goto exit;
-
+
camel_db_end_transaction (cdb, &err);
exit:
if (err && cdb->priv->transaction_is_on)
camel_db_abort_transaction (cdb, NULL);
-
+
if (err)
g_propagate_error (error, err);
GError *local_error = NULL;
if (st.st_size > 0)
- pc = (gint)(100.0 * ((double)camel_mime_parser_tell (mp) / (double)st.st_size));
+ pc = (gint)(100.0 * ((double) camel_mime_parser_tell (mp) / (double) st.st_size));
report_status (driver, CAMEL_FILTER_STATUS_START, pc, _("Getting message %d (%d%%)"), i, pc);
/* Try and see if it has X-Evolution headers */
xev = camel_header_raw_find(&mime_part->headers, "X-Evolution", NULL);
if (xev)
- decode_flags_from_xev (xev, (CamelMessageInfoBase *)info);
+ decode_flags_from_xev (xev, (CamelMessageInfoBase *) info);
- ((CamelMessageInfoBase *)info)->size = camel_mime_parser_tell (mp) - last;
+ ((CamelMessageInfoBase *) info)->size = camel_mime_parser_tell (mp) - last;
last = camel_mime_parser_tell (mp);
status = camel_filter_driver_filter_message (
return -1;
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
-
+
/* Push MessageInfo-es */
camel_db_begin_transaction (cdb, NULL);
g_hash_table_foreach (s->loaded_infos, save_to_db_cb, &args);
camel_db_end_transaction (cdb, NULL);
-
+
camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
/* FIXME[disk-summary] make sure we free the message infos that are loaded
* are freed if not used anymore or should we leave that to the timer? */
d(printf ("\ncamel_folder_summary_save_to_db called \n"));
if (s->priv->need_preview && g_hash_table_size (s->priv->preview_updates)) {
camel_folder_summary_lock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
-
+
camel_db_begin_transaction (parent_store->cdb_w, NULL);
g_hash_table_foreach (s->priv->preview_updates, (GHFunc) msg_save_preview, s->folder);
g_hash_table_remove_all (s->priv->preview_updates);
camel_db_end_transaction (parent_store->cdb_w, NULL);
-
+
camel_folder_summary_unlock (s, CAMEL_FOLDER_SUMMARY_SUMMARY_LOCK);
}
full_name = camel_folder_get_full_name (s->folder);
g_warning ("Fixing up a broken summary migration on %s\n", full_name);
-
+
/* Begin everything again. */
camel_db_begin_transaction (cdb, NULL);
camel_db_reset_folder_version (cdb, full_name, 0, NULL);
CamelVeeFolder *folder_unmatched;
GHashTable *unmatched_uids;
gboolean rebuilt, correlating;
-
+
/* used for uids that needs to be updated in db later by unmatched_check_uid and
folder_added_uid */
GQueue *message_uids;
/* Hold all these with summary lock and unmatched summary lock held */
static void
-folder_changed_add_uid (CamelFolder *sub,
- const gchar *uid,
- const gchar hash[8],
- CamelVeeFolder *vf,
+folder_changed_add_uid (CamelFolder *sub,
+ const gchar *uid,
+ const gchar hash[8],
+ CamelVeeFolder *vf,
gboolean use_db,
GSList **m_added_l,
GSList **unm_added_l)
vuid = camel_pstring_strdup (camel_message_info_uid (vinfo));
camel_message_info_free ((CamelMessageInfo *) vinfo);
-
+
if (use_db)
*m_added_l = g_slist_prepend (*m_added_l, (gpointer) camel_pstring_strdup (vuid));
camel_folder_summary_update_counts_by_flags (CAMEL_FOLDER (folder_unmatched)->summary, vinfo->old_flags, TRUE);
camel_folder_change_info_remove_uid (
folder_unmatched->changes, vuid);
-
+
*unm_added_l = g_slist_prepend (*unm_added_l, (gpointer) camel_pstring_strdup (vuid));
-
+
camel_folder_summary_remove_uid_fast (
CAMEL_FOLDER (folder_unmatched)->summary, vuid);
camel_folder_free_message_info (
}
static void
-folder_changed_remove_uid (CamelFolder *sub,
- const gchar *uid,
- const gchar hash[8],
- gint keep,
- CamelVeeFolder *vf,
+folder_changed_remove_uid (CamelFolder *sub,
+ const gchar *uid,
+ const gchar hash[8],
+ gint keep,
+ CamelVeeFolder *vf,
gboolean use_db,
GSList **m_removed_l,
GSList **unm_removed_l)
{
- CamelFolder *folder = (CamelFolder *)vf;
+ CamelFolder *folder = (CamelFolder *) vf;
gchar *vuid, *oldkey;
gpointer oldval;
gint n;
camel_folder_summary_update_counts_by_flags (CAMEL_FOLDER (folder_unmatched)->summary, vinfo->old_flags, TRUE);
camel_folder_change_info_remove_uid (
folder_unmatched->changes, vuid);
-
+
*unm_removed_l = g_slist_prepend (*unm_removed_l, (gpointer) camel_pstring_strdup (vuid));
-
+
camel_folder_summary_remove_uid_fast (
CAMEL_FOLDER (folder_unmatched)->summary, vuid);
camel_folder_free_message_info (
}
static void
-folder_changed_change_uid (CamelFolder *sub,
- const gchar *uid,
- const gchar hash[8],
- CamelVeeFolder *vf,
- gboolean use_db,
+folder_changed_change_uid (CamelFolder *sub,
+ const gchar *uid,
+ const gchar hash[8],
+ CamelVeeFolder *vf,
+ gboolean use_db,
GSList **m_removed_l,
GSList **unm_removed_l)
{
} else {
if (vinfo) {
folder_changed_remove_uid (sub, uid, hash, FALSE, vf, use_db, m_removed_l, unm_removed_l);
- camel_message_info_free ((CamelMessageInfo *)vinfo);
+ camel_message_info_free ((CamelMessageInfo *) vinfo);
}
if (uinfo)
camel_message_info_free ((CamelMessageInfo *) uinfo);
}
}
-
static void
vfolder_add_remove_transaction (CamelStore *parent_store, const gchar *full_name, GSList **uids, gboolean add, GError **error)
{
GSList *l;
for (l = *uids; l != NULL; l = g_slist_next (l)) {
- if (add)
+ if (add)
camel_db_add_to_vfolder_transaction (parent_store->cdb_w, full_name,
- (const gchar *) l->data, error);
+ (const gchar *) l->data, error);
else
- camel_db_delete_uid_from_vfolder_transaction
- (parent_store->cdb_w, full_name,
+ camel_db_delete_uid_from_vfolder_transaction
+ (parent_store->cdb_w, full_name,
(const gchar *) l->data, error);
}
-
+
g_slist_foreach (*uids, (GFunc) camel_pstring_free, NULL);
g_slist_free (*uids);
*uids = NULL;
parent_store = camel_folder_get_parent_store (folder);
full_name = camel_folder_get_full_name (folder);
-
+
if (folder_unmatched)
unm_full_name = camel_folder_get_full_name (CAMEL_FOLDER (folder_unmatched));
-
+
camel_db_begin_transaction (parent_store->cdb_w, NULL);
-
- if (m_added_l)
+
+ if (m_added_l)
vfolder_add_remove_transaction (parent_store, full_name, &m_added_l, TRUE, NULL);
if (m_removed_l)
vfolder_add_remove_transaction (parent_store, full_name, &m_removed_l, FALSE, NULL);
- if (unm_added_l)
+ if (unm_added_l)
vfolder_add_remove_transaction (parent_store, unm_full_name, &unm_added_l, TRUE, NULL);
if (unm_removed_l)
vfolder_add_remove_transaction (parent_store, unm_full_name, &unm_removed_l, FALSE, NULL);
-
+
camel_db_end_transaction (parent_store->cdb_w, NULL);
}
CamelVeeMessageInfo *mi = (CamelVeeMessageInfo *) camel_folder_summary_uid (((CamelFolder *) u->folder_unmatched)->summary, uid);
if (mi) {
camel_folder_summary_update_counts_by_flags (CAMEL_FOLDER (u->folder_unmatched)->summary, mi->old_flags, TRUE);
-
+
if (u->message_uids != NULL)
g_queue_push_tail (u->message_uids, g_strdup (uid));
folder = CAMEL_FOLDER (vf);
parent_store = camel_folder_get_parent_store (folder);
record = summary_header_to_db (folder->summary, NULL);
-
+
camel_db_begin_transaction (parent_store->cdb_w, NULL);
camel_db_write_folder_info_record (parent_store->cdb_w, record, NULL);
camel_db_end_transaction (parent_store->cdb_w, NULL);
CamelStore *parent_store;
const gchar *full_name;
gchar *uid;
-
+
full_name = camel_folder_get_full_name (CAMEL_FOLDER (u.folder_unmatched));
parent_store = camel_folder_get_parent_store (CAMEL_FOLDER (u.folder_unmatched));
-
+
camel_db_begin_transaction (parent_store->cdb_w, NULL);
while ((uid = g_queue_pop_head (u.message_uids)) != NULL) {
G_DEFINE_TYPE (CamelIMAPXServer, camel_imapx_server, CAMEL_TYPE_OBJECT)
-
static guint
get_batch_fetch_count (CamelIMAPXServer *is)
{
static guint count = 0;
const gchar *fetch_count;
-
+
if (count)
return count;
fetch_count = camel_url_get_param (is->url, "batch-fetch-count");
if (fetch_count)
count = strtoul (fetch_count, NULL, 10);
-
+
if (count <= 0)
count = BATCH_FETCH_COUNT;
static void
imapx_command_fetch_new_uids_done (CamelIMAPXServer *is,
- CamelIMAPXCommand *ic)
+ CamelIMAPXCommand *ic)
{
CamelIMAPXJob *job = ic->job;
GArray *infos = job->u.refresh_info.infos;
imapx_uidset_init (&job->u.refresh_info.uidset, get_batch_fetch_count (is), 0);
job->u.refresh_info.infos = g_array_new (0, 0, sizeof (struct _refresh_info));
ic->pri = job->pri;
-
+
if (is->descending)
ic->complete = imapx_command_fetch_new_uids_done;
- else
+ else
ic->complete = imapx_command_step_fetch_done;
} else {
ic = camel_imapx_command_new (
g_return_val_if_fail (old_vfs != NULL, -1);
g_return_val_if_fail (pFile != NULL, -1);
- cFile = (ESqlite3File *)pFile;
+ cFile = (ESqlite3File *) pFile;
cFile->old_vfs_file = g_malloc0 (old_vfs->szOsFile);
res = old_vfs->xOpen (old_vfs, zPath, cFile->old_vfs_file, flags, pOutFlags);
ESource * e_client_util_get_system_source (ESourceList *source_list);
gboolean e_client_util_set_default (ESourceList *source_list, ESource *source);
-ESource * e_client_util_get_source_for_uri(ESourceList *source_list, const gchar *uri);
+ESource * e_client_util_get_source_for_uri (ESourceList *source_list, const gchar *uri);
/* protected functions simplifying sync/async calls */
GDBusProxy * e_client_get_dbus_proxy (EClient *client);
G_TYPE_NONE, 1,
G_TYPE_ERROR);
-
signals[BACKEND_ERROR] = g_signal_new (
"backend-error",
G_OBJECT_CLASS_TYPE (klass),
/* Processes authentication request in a new thread. Usual steps are:
a) backend sends an auth-required signal
b) EClient implementation calls this function
- c) a new thread is run which emits authenticate signal by e_client_emit_authenticate()
+ c) a new thread is run which emits authenticate signal by e_client_emit_authenticate ()
d) if anyone responds (returns true), the EClient::handle_authentication
is called from the same extra thread with new credentials
e) EClient implementation passes results to backend in the EClient::handle_authentication
}
/* Expects @keys as NULL terminate list of strings "key:encoded_value".
- The same can be returned from e_credentials_to_strv().
+ The same can be returned from e_credentials_to_strv ().
*/
ECredentials *
e_credentials_new_strv (const gchar * const *keys)
}
/* Returns NULL-terminated array of strings with keys and encoded values;
- To read them back pass this pointer to e_credentials_new(). As it returns
- newly allocated string then this should be freed with g_strfreev()
+ To read them back pass this pointer to e_credentials_new (). As it returns
+ newly allocated string then this should be freed with g_strfreev ()
when no longer needed.
*/
gchar **
/* peeks value for a key, in a clear form. The value is valid until free
of the @credentials structure or until the key value is rewritten
- by e_credentials_set()
+ by e_credentials_set ()
*/
const gchar *
e_credentials_peek (ECredentials *credentials, const gchar *key)
va_end (va);
return equal;
-}
+}
/**
* Returns whether @credentials contains @key.
/* Returns newly allocated list of key names stored in the credentials strucutre;
strings are internal credentials values, only the list is newly allocated.
- Free the list with g_slist_free() when no longer needed.
+ Free the list with g_slist_free () when no longer needed.
*/
GSList *
e_credentials_list_keys (const ECredentials *credentials)
};
/* Returned pointer can be passed to e_credentials_util_string_to prompt_flags()
- to decode it back to flags. Free returned pointer with g_free().
+ to decode it back to flags. Free returned pointer with g_free ().
*/
gchar *
e_credentials_util_prompt_flags_to_string (guint prompt_flags)
gchar * e_credentials_get (const ECredentials *credentials, const gchar *key);
const gchar * e_credentials_peek ( ECredentials *credentials, const gchar *key);
gboolean e_credentials_equal (const ECredentials *credentials1, const ECredentials *credentials2);
-gboolean e_credentials_equal_keys(const ECredentials *credentials1, const ECredentials *credentials2, const gchar *key1, ...) G_GNUC_NULL_TERMINATED;
+gboolean e_credentials_equal_keys (const ECredentials *credentials1, const ECredentials *credentials2, const gchar *key1, ...) G_GNUC_NULL_TERMINATED;
gboolean e_credentials_has_key (const ECredentials *credentials, const gchar *key);
guint e_credentials_keys_size (const ECredentials *credentials);
GSList * e_credentials_list_keys (const ECredentials *credentials);
void e_credentials_clear ( ECredentials *credentials);
-void e_credentials_clear_peek( ECredentials *credentials);
+void e_credentials_clear_peek ( ECredentials *credentials);
void e_credentials_util_safe_free_string (gchar *str);
gchar * e_credentials_util_prompt_flags_to_string (guint prompt_flags); /* bit-or of ECredentialsPromptFlags */
}
/* Created hash table of pending async operations. This can be freed
- with g_hash_table_destroy() in dispose. Interface asks for this
- ponter by call of e_gdbus_async_op_keeper_create_pending_ops().
+ with g_hash_table_destroy () in dispose. Interface asks for this
+ ponter by call of e_gdbus_async_op_keeper_create_pending_ops ().
*/
GHashTable *
e_gdbus_async_op_keeper_create_pending_ops (EGdbusAsyncOpKeeper *object)
}
/* Returns hash table of pending async operations previously created
- by e_gdbus_async_op_keeper_create_pending_ops().
+ by e_gdbus_async_op_keeper_create_pending_ops ().
*/
GHashTable *
e_gdbus_async_op_keeper_get_pending_ops (EGdbusAsyncOpKeeper *object)
} result;
} AsyncOpData;
-
static void
async_op_data_free (AsyncOpData *op_data)
{
case E_GDBUS_TYPE_VOID:
break;
case E_GDBUS_TYPE_BOOLEAN:
- op_data->result.out_boolean = * ((const gboolean *)out_value);
+ op_data->result.out_boolean = * ((const gboolean *) out_value);
break;
case E_GDBUS_TYPE_STRING:
op_data->result.out_string = g_strdup ((const gchar *) out_value);
g_variant_builder_unref (builder);
}
- g_dbus_proxy_call (G_DBUS_PROXY (proxy), method_name, params, G_DBUS_CALL_FLAGS_NONE, e_data_server_util_get_dbus_call_timeout (), cancellable, callback, user_data);
+ g_dbus_proxy_call (G_DBUS_PROXY (proxy), method_name, params, G_DBUS_CALL_FLAGS_NONE, e_data_server_util_get_dbus_call_timeout (), cancellable, callback, user_data);
}
void
g_hash_table_insert (_method_name_to_type, (gpointer) _dbus_sig_name_str, GUINT_TO_POINTER (E_GDBUS_TYPE_ ## _gtype | E_GDBUS_TYPE_IS_ASYNC));
#define E_INIT_GDBUS_METHOD_VOID(_iface_struct, _dbus_sig_name_str, _sig_name_var, _method_sig_id) \
- E_INIT_GDBUS_METHOD_CALL_TMPL_VOID(_iface_struct, _dbus_sig_name_str, _sig_name_var, _method_sig_id) \
+ E_INIT_GDBUS_METHOD_CALL_TMPL_VOID (_iface_struct, _dbus_sig_name_str, _sig_name_var, _method_sig_id) \
g_hash_table_insert (_method_name_to_type, (gpointer) _dbus_sig_name_str, GUINT_TO_POINTER (E_GDBUS_TYPE_VOID));
#define E_INIT_GDBUS_METHOD_BOOLEAN(_iface_struct, _dbus_sig_name_str, _sig_name_var, _method_sig_id) \
g_hash_table_insert (_method_name_to_type, (gpointer) _dbus_sig_name_str, GUINT_TO_POINTER (E_GDBUS_TYPE_UINT));
#define E_INIT_GDBUS_METHOD_CALL_VOID(_iface_struct, _dbus_sig_name_str, _sig_name_var, _method_sig_id) \
- E_INIT_GDBUS_METHOD_CALL_TMPL_VOID(_iface_struct, _dbus_sig_name_str, _sig_name_var, _method_sig_id) \
+ E_INIT_GDBUS_METHOD_CALL_TMPL_VOID (_iface_struct, _dbus_sig_name_str, _sig_name_var, _method_sig_id) \
g_hash_table_insert (_method_name_to_type, (gpointer) _dbus_sig_name_str, GUINT_TO_POINTER (E_GDBUS_TYPE_VOID | E_GDBUS_TYPE_IS_ASYNC));
#define E_INIT_GDBUS_METHOD_CALL_BOOLEAN(_iface_struct, _dbus_sig_name_str, _sig_name_var, _method_sig_id) \
}
/* Reserves new operation ID, which is returned. This operation ID may
- be released by e_operation_pool_release_opid() when the operation
+ be released by e_operation_pool_release_opid () when the operation
is finished.
*/
guint32
}
/* Pushes operation to be processed. 'opdata' is passed to the function
- provided in e_operation_pool_new().
+ provided in e_operation_pool_new ().
*/
void
e_operation_pool_push (EOperationPool *pool, gpointer opdata)
return list->priv->groups;
}
-
/**
* e_source_list_peek_group_by_uid:
*
if (!async_data->open_finished) {
/* there can happen that the "opened" signal is received
- before the e_client_open() is finished, thus keep detailed
+ before the e_client_open () is finished, thus keep detailed
error for later use, if any */
if (error)
async_data->opened_cb_error = g_error_copy (error);
if (auth_handler)
g_signal_connect (client, "authenticate", G_CALLBACK (client_utils_open_new_auth_cb), async_data);
-
/* wait till backend notifies about its opened state */
g_signal_connect (client, "opened", G_CALLBACK (client_utils_opened_cb), async_data);
username_markup = g_markup_printf_escaped ("<b>%s</b>", e_credentials_peek (credentials, E_CREDENTIALS_KEY_USERNAME));
source_name_markup = g_markup_printf_escaped ("<b>%s</b>", e_source_peek_name (source));
-
if (reason && *reason)
prompt = g_strdup_printf (_("Enter password for %s (user %s)\nReason: %s"), source_name_markup, username_markup, reason);
else
for (e = emails; e; e = e->next) {
g_print ("\t%s\n", (gchar *)e->data);
}
- g_list_foreach (emails, (GFunc)g_free, NULL);
+ g_list_foreach (emails, (GFunc) g_free, NULL);
g_list_free (emails);
g_print ("\n");
}
/* Starts new main-loop, but just before that calls 'func'.
- Main-loop is kept running, and this function blocks,
- until call of stop_main_loop().
+ Main-loop is kept running, and this function blocks,
+ until call of stop_main_loop ().
*/
void
start_main_loop (GThreadFunc func, gpointer data)
}
/* Starts new main-loop and then invokes func in a new thread.
- Main-loop is kept running, and this function blocks,
- until call of stop_main_loop().
+ Main-loop is kept running, and this function blocks,
+ until call of stop_main_loop ().
*/
void
start_in_thread_with_main_loop (GThreadFunc func, gpointer data)
}
/* Starts new main-loop and then invokes func in an idle callback.
- Main-loop is kept running, and this function blocks,
- until call of stop_main_loop().
+ Main-loop is kept running, and this function blocks,
+ until call of stop_main_loop ().
*/
void
start_in_idle_with_main_loop (GThreadFunc func, gpointer data)
g_str_equal (prop_name, BOOK_BACKEND_PROPERTY_SUPPORTED_AUTH_METHODS)) {
GSList *values = e_client_util_parse_comma_strings (prop_value), *v;
-
for (v = values; v; v = v->next) {
if (v != values)
g_print (", ");
g_object_unref (book_client);
g_free (uri);
return 1;
- } else if (!e_client_remove_sync (E_CLIENT (book_client), NULL, &error)) {
+ } else if (!e_client_remove_sync (E_CLIENT (book_client), NULL, &error)) {
report_error ("client remove sync", &error);
g_object_unref (book_client);
g_free (uri);
}
/* Starts new main-loop, but just before that calls 'func'.
- Main-loop is kept running, and this function blocks,
- until call of stop_main_loop().
+ Main-loop is kept running, and this function blocks,
+ until call of stop_main_loop ().
*/
void
start_main_loop (GThreadFunc func, gpointer data)
}
/* Starts new main-loop and then invokes func in a new thread.
- Main-loop is kept running, and this function blocks,
- until call of stop_main_loop().
+ Main-loop is kept running, and this function blocks,
+ until call of stop_main_loop ().
*/
void
start_in_thread_with_main_loop (GThreadFunc func, gpointer data)
}
/* Starts new main-loop and then invokes func in an idle callback.
- Main-loop is kept running, and this function blocks,
- until call of stop_main_loop().
+ Main-loop is kept running, and this function blocks,
+ until call of stop_main_loop ().
*/
void
start_in_idle_with_main_loop (GThreadFunc func, gpointer data)
if (res) {
GSList *ecalcomps = NULL;
-
+
if (!e_cal_client_get_objects_for_uid_sync (cal_client, uid, &ecalcomps, NULL, &error)) {
report_error ("get objects for uid sync", &error);
res = FALSE;
if (g_str_equal (prop_name, CLIENT_BACKEND_PROPERTY_CAPABILITIES)) {
GSList *values = e_client_util_parse_comma_strings (prop_value), *v;
-
for (v = values; v; v = v->next) {
if (v != values)
g_print (", ");
evals->async_data = async_data;
evals->todo_prop_names = get_known_prop_names ();
evals->retrieved_props = g_hash_table_new_full (g_str_hash, g_str_equal, NULL, g_free);
-
+
e_cal_client_get_default_object (cal_client, NULL, client_got_default_object_async, evals);
}
g_object_unref (cal_client);
g_free (uri);
return 1;
- } else if (!e_client_remove_sync (E_CLIENT (cal_client), NULL, &error)) {
+ } else if (!e_client_remove_sync (E_CLIENT (cal_client), NULL, &error)) {
report_error ("client remove sync", &error);
g_object_unref (cal_client);
g_free (uri);
if (g_str_equal (prop_name, CLIENT_BACKEND_PROPERTY_CAPABILITIES)) {
GSList *values = e_client_util_parse_comma_strings (prop_value), *v;
-
for (v = values; v; v = v->next) {
if (v != values)
g_print (", ");