}
/* returns whether group changed from the one stored in the cache;
- returns FALSE, if the group was not in the cache yet;
- also adds the group into the cache;
- use group_name = NULL to remove it from the cache.
+ * returns FALSE, if the group was not in the cache yet;
+ * also adds the group into the cache;
+ * use group_name = NULL to remove it from the cache.
*/
static gboolean
cache_update_group (EBookBackend *backend,
- const gchar *group_id,
- const gchar *group_name)
+ const gchar *group_id,
+ const gchar *group_name)
{
EBookBackendGooglePrivate *priv;
EFileCache *file_cache;
static void
book_backend_google_refresh (EBookBackend *backend,
- EDataBook *book,
- guint32 opid,
- GCancellable *cancellable)
+ EDataBook *book,
+ guint32 opid,
+ GCancellable *cancellable)
{
g_return_if_fail (E_IS_BOOK_BACKEND_GOOGLE (backend));
static const gchar *
get_dn_attribute_name (gchar *rootdn,
- EContact *contact)
+ EContact *contact)
{
/* Use 'uid' is already used in root DN,
* then use the 'description' field. */
* e_book_query_or:
* @nqs: the number of queries to OR
* @qs: pointer to an array of #EBookQuery items
- * @unref: if #TRUE, the new query takes ownership of the existing queries
+ * @unref: if %TRUE, the new query takes ownership of the existing queries
*
* Creates a new #EBookQuery which is the logical OR of the queries in #qs.
*
/**
* e_book_query_not:
* @q: an #EBookQuery
- * @unref: if #TRUE, the new query takes ownership of the existing queries
+ * @unref: if %TRUE, the new query takes ownership of the existing queries
*
* Creates a new #EBookQuery which is the opposite of #q.
*
break;
} else if (param) {
/* reading param value, which is SAFE-CHAR, aka
- any character except CTLs, DQUOTE, ";", ":", "," */
+ * any character except CTLs, DQUOTE, ";", ":", "," */
g_string_append_unichar (str, g_utf8_get_char (lp));
lp = g_utf8_next_char (lp);
} else {
static gchar *
e_vcard_qp_encode (const gchar *txt,
- gboolean can_wrap)
+ gboolean can_wrap)
{
const gchar *p = txt;
GString *escaped = g_string_new ("");
EVCardAttributeParam *param = list->data;
/* quoted-printable encoding was eliminated in 3.0,
- thus decode the value before saving and remove the param later */
+ * thus decode the value before saving and remove the param later */
if (!quoted_printable_param &&
param->values && param->values->data && !param->values->next &&
g_ascii_strcasecmp (param->name, "ENCODING") == 0 &&
gchar *escaped_value = NULL;
/* values are in quoted-printable encoding, but this cannot be used in vCard 3.0,
- thus it needs to be converted first */
+ * thus it needs to be converted first */
if (quoted_printable_param) {
gchar *qp_decoded;
/* Direct Read Access connect helper */
static void
-connect_direct (EBookClient *client,
- GCancellable *cancellable,
- ESourceRegistry *registry)
+connect_direct (EBookClient *client,
+ GCancellable *cancellable,
+ ESourceRegistry *registry)
{
EBookClientPrivate *priv;
EDBusDirectBook *direct_config;
/* Helper for e_book_client_connect_direct() */
static void
book_client_connect_direct_init_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
+ GAsyncResult *result,
+ gpointer user_data)
{
GSimpleAsyncResult *simple;
EBookClientPrivate *priv;
**/
void
e_book_client_connect_direct (ESource *source,
- GCancellable *cancellable,
- GAsyncReadyCallback callback,
- gpointer user_data)
+ GCancellable *cancellable,
+ GAsyncReadyCallback callback,
+ gpointer user_data)
{
GSimpleAsyncResult *simple;
ConnectClosure *closure;
**/
EClient *
e_book_client_connect_direct_finish (GAsyncResult *result,
- GError **error)
+ GError **error)
{
GSimpleAsyncResult *simple;
ConnectClosure *closure;
*
* Check if @dest is to be ignored.
*
- * Returns: #TRUE if this destination should be ignored, else #FALSE.
+ * Returns: %TRUE if this destination should be ignored, else %FALSE.
*/
gboolean
e_destination_is_ignored (const EDestination *dest)
/**
* e_destination_set_ignored:
* @dest: an #EDestination
- * @ignored: #TRUE if this #EDestination should be ignored.
+ * @ignored: %TRUE if this #EDestination should be ignored.
*
* Set the ignore flag on a #EDestination.
*/
* Tries to create an #EDataBookDirect for @backend if
* backend supports direct read access.
*
- * Returns: (transfer full): A new #EDataBookDirect object, or %NULL if @backend does not support direct access
+ * Returns: (transfer full): A new #EDataBookDirect object, or %NULL if
+ * @backend does not support direct access
*
* Since: 3.8
*/
EDataBookDirect *
e_book_backend_get_direct_book (EBookBackend *backend)
{
+ EBookBackendClass *class;
+ EDataBookDirect *direct_book = NULL;
+
g_return_val_if_fail (E_IS_BOOK_BACKEND (backend), NULL);
- if (E_BOOK_BACKEND_GET_CLASS (backend)->get_direct_book)
- return E_BOOK_BACKEND_GET_CLASS (backend)->get_direct_book (backend);
+ class = E_BOOK_BACKEND_GET_CLASS (backend);
+
+ if (class->get_direct_book != NULL)
+ direct_book = class->get_direct_book (backend);
- return NULL;
+ return direct_book;
}
/**
static gchar *
get_header_decoded (const gchar *header_value,
- const gchar *default_charset)
+ const gchar *default_charset)
{
gchar *unfold, *decoded;
static gchar *
get_full_header (CamelMimeMessage *message,
- const gchar *default_charset)
+ const gchar *default_charset)
{
CamelMimePart *mp = CAMEL_MIME_PART (message);
GString *str = g_string_new ("");
static gboolean
do_search_in_memory (CamelFolder *search_in_folder,
const gchar *expr,
- gchar **psql_query)
+ gchar **psql_query)
{
/* if the expression contains any of these tokens, then perform a memory search, instead of the SQL one */
const gchar *in_memory_tokens[] = {
*psql_query = camel_sexp_to_sql_sexp (expr);
/* unknown column can cause NULL sql_query, then an in-memory
- search is required */
+ * search is required */
return !*psql_query;
}
gint id);
#define camel_message_info_uid(mi) \
- ((const gchar *)((const CamelMessageInfo *)mi)->uid)
+ ((const gchar *)((const CamelMessageInfo *) mi)->uid)
#define camel_message_info_subject(mi) \
- ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_SUBJECT))
+ ((const gchar *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_SUBJECT))
/**
* camel_message_info_preview:
* Since: 2.28
**/
#define camel_message_info_preview(mi) \
- ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_PREVIEW))
+ ((const gchar *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_PREVIEW))
#define camel_message_info_from(mi) \
- ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_FROM))
+ ((const gchar *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_FROM))
#define camel_message_info_to(mi) \
- ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_TO))
+ ((const gchar *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_TO))
#define camel_message_info_cc(mi) \
- ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_CC))
+ ((const gchar *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_CC))
#define camel_message_info_mlist(mi) \
- ((const gchar *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_MLIST))
+ ((const gchar *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_MLIST))
#define camel_message_info_flags(mi) \
- camel_message_info_uint32((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_FLAGS)
+ camel_message_info_uint32 ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_FLAGS)
#define camel_message_info_size(mi) \
- camel_message_info_uint32((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_SIZE)
+ camel_message_info_uint32 ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_SIZE)
#define camel_message_info_date_sent(mi) \
- camel_message_info_time((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_DATE_SENT)
+ camel_message_info_time ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_DATE_SENT)
#define camel_message_info_date_received(mi) \
- camel_message_info_time((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_DATE_RECEIVED)
+ camel_message_info_time ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_DATE_RECEIVED)
#define camel_message_info_message_id(mi) \
- ((const CamelSummaryMessageID *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_MESSAGE_ID))
+ ((const CamelSummaryMessageID *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_MESSAGE_ID))
#define camel_message_info_references(mi) \
- ((const CamelSummaryReferences *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_REFERENCES))
+ ((const CamelSummaryReferences *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_REFERENCES))
#define camel_message_info_user_flags(mi) \
- ((const CamelFlag *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_USER_FLAGS))
+ ((const CamelFlag *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_USER_FLAGS))
#define camel_message_info_user_tags(mi) \
- ((const CamelTag *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_USER_TAGS))
+ ((const CamelTag *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_USER_TAGS))
/**
* camel_message_info_headers:
* Since: 2.24
**/
#define camel_message_info_headers(mi) \
- ((const struct _camel_header_param *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_HEADERS))
+ ((const struct _camel_header_param *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_HEADERS))
/**
* camel_message_info_content:
* Since: 2.30
**/
#define camel_message_info_content(mi) \
- ((const CamelMessageContentInfo *)camel_message_info_ptr((const CamelMessageInfo *)mi, CAMEL_MESSAGE_INFO_CONTENT))
+ ((const CamelMessageContentInfo *) camel_message_info_ptr ((const CamelMessageInfo *) mi, CAMEL_MESSAGE_INFO_CONTENT))
gboolean camel_message_info_user_flag (const CamelMessageInfo *info,
const gchar *id);
folder_path = camel_imapx_mailbox_to_folder_path (
mailbox_name, ns->sep);
- c (is->tagprefix,
+ c (
+ is->tagprefix,
"Got folder path '%s' for mailbox '%s'\n",
folder_path, mailbox_name);
if (folder_path != NULL) {
camel_imapx_folder_invalidate_local_cache (
imapx_folder, uidvalidity);
} else {
- c (is->tagprefix,
+ c (
+ is->tagprefix,
"Received STATUS for unknown folder '%s'\n",
mailbox_name);
}
camel_imapx_store_summary,
CAMEL_TYPE_STORE_SUMMARY)
-
static CamelIMAPXNamespaceList *
namespace_load (CamelStoreSummary *s,
FILE *in)
**/
void
camel_sasl_gssapi_override_host_and_user (CamelSaslGssapi *sasl,
- const gchar *override_host,
- const gchar *override_user)
+ const gchar *override_host,
+ const gchar *override_user)
{
g_return_if_fail (CAMEL_IS_SASL_GSSAPI (sasl));
static GPtrArray *
pop3_get_uncached_uids (CamelFolder *folder,
- GPtrArray *uids,
- GError **error)
+ GPtrArray *uids,
+ GError **error)
{
CamelPOP3Folder *pop3_folder;
CamelPOP3Store *pop3_store;
{
GObjectClass *object_class;
- g_type_class_add_private (class, sizeof (EAuthenticationMediatorPrivate));
+ g_type_class_add_private (
+ class, sizeof (EAuthenticationMediatorPrivate));
object_class = G_OBJECT_CLASS (class);
object_class->set_property = authentication_mediator_set_property;
static void
e_authentication_mediator_interface_init (ESourceAuthenticatorInterface *interface)
{
- interface->get_without_password = authentication_mediator_get_without_password;
- interface->try_password_sync = authentication_mediator_try_password_sync;
- interface->try_password = authentication_mediator_try_password;
- interface->try_password_finish = authentication_mediator_try_password_finish;
+ interface->get_without_password =
+ authentication_mediator_get_without_password;
+ interface->try_password_sync =
+ authentication_mediator_try_password_sync;
+ interface->try_password =
+ authentication_mediator_try_password;
+ interface->try_password_finish =
+ authentication_mediator_try_password_finish;
}
static void
const gchar *const *parameters,
EUserPrompterServer *server)
{
+ gboolean found_dialog;
gint id;
g_rec_mutex_lock (&server->priv->lock);
- if (!dialog_name || !g_hash_table_lookup (server->priv->extensions, dialog_name)) {
+ found_dialog =
+ (dialog_name != NULL) &&
+ g_hash_table_contains (server->priv->extensions, dialog_name);
+
+ if (!found_dialog) {
g_rec_mutex_unlock (&server->priv->lock);
g_dbus_method_invocation_return_error (
* Returns whether the used authentication method can be used without
* a password prompt. If so, then user is not asked for the password,
* only if the authentication fails. The default implementation returns
- * #FALSE, which means always asks for the password (or read it from
+ * %FALSE, which means always asks for the password (or read it from
* a keyring).
*
- * Returns: Whether may try to authenticate without asking for the password.
+ * Returns: whether to try to authenticate without asking for the password
*
* Since: 3.10
**/
AuthContext *auth_context;
GMainContext *main_context;
EDBusAuthenticator *dbus_auth;
+ gboolean without_password;
gchar *encryption_key;
gchar *object_path = NULL;
GError *local_error = NULL;
if (local_error != NULL)
goto exit;
- e_dbus_authenticator_set_without_password (dbus_auth, e_source_authenticator_get_without_password (auth));
+ without_password = e_source_authenticator_get_without_password (auth);
+ e_dbus_authenticator_set_without_password (dbus_auth, without_password);
auth_context = g_slice_new0 (AuthContext);
auth_context->auth = g_object_ref (auth);
*
* Creates a string representation of the time value @date_tm and
* stores it in @buffer. @buffer_size should be at least 64 to be
- * safe. If @show_midnight is #FALSE, and the time is midnight, then
+ * safe. If @show_midnight is %FALSE, and the time is midnight, then
* only the date is stored in @buffer. If @show_zero_seconds is
- * #FALSE, then if the time has zero seconds only the hour and minute
+ * %FALSE, then if the time has zero seconds only the hour and minute
* of the time are stored in @buffer.
**/
void
static void
source_added (ESourceRegistry *registry,
- ESource *source,
- gpointer data)
+ ESource *source,
+ gpointer data)
{
- SourceAddedData *added_data = (SourceAddedData *)data;
+ SourceAddedData *added_data = (SourceAddedData *) data;
GError *error = NULL;
if (g_strcmp0 (e_source_get_uid (source), added_data->book_id) != 0)
/* Open the address book */
#if EDS_CHECK_VERSION(3,8,0)
- added_data->book = (EBookClient *)e_book_client_connect_sync (source, NULL, &error);
+ added_data->book = (EBookClient *) e_book_client_connect_sync (source, NULL, &error);
#else
/* With 3.6 it's a bit more tricky */
added_data->book = e_book_client_new (source, &error);
/* Listen to the registry for our added source */
data.book_id = book_id;
- g_signal_connect (registry, "source-added",
- G_CALLBACK (source_added), &data);
+ g_signal_connect (
+ registry, "source-added",
+ G_CALLBACK (source_added), &data);
/* Now create a scratch source for our addressbook */
scratch = e_source_new_with_uid (book_id, NULL, &error);
if (!book)
g_error ("Error creating book: %s", error->message);
- if (!e_book_open (book, FALSE, &error))
+ if (!e_book_open (book, FALSE, &error))
g_error ("Error opening book: %s", error->message);
return book;
#endif
-
/********************************************************
* Adding the Contacts *
********************************************************/
#if EDS_CHECK_VERSION(3,6,0)
static void
-add_contacts (Book *book,
- GSList *contacts)
+add_contacts (Book *book,
+ GSList *contacts)
{
GError *error = NULL;
#else
static void
-add_contacts (Book *book,
- GSList *contacts)
+add_contacts (Book *book,
+ GSList *contacts)
{
GError *error = NULL;
GSList *l;
static void
setup_migration_setup (ETestServerFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
fixture->source_name = g_strdup_printf ("%d.%d", EDS_MAJOR_VERSION, EDS_MINOR_VERSION);
e_test_server_utils_setup (fixture, user_data);
static void
setup_migration_run (ETestServerFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
EBookClient *book_client;
GSList *contacts;
* main() *
********************************************************/
gint
-main (gint argc, gchar *argv[])
+main (gint argc,
+ gchar *argv[])
{
GOptionContext *option_context;
GOptionGroup *option_group;
Book *book;
option_context = g_option_context_new (NULL);
- g_option_context_set_summary (option_context,
- "Populate a database for migration tests.");
-
- option_group = g_option_group_new ("setup migration test",
- "Setup Migration options",
- "Setup Migration options", NULL, NULL);
+ g_option_context_set_summary (
+ option_context,
+ "Populate a database for migration tests.");
+
+ option_group = g_option_group_new (
+ "setup migration test",
+ "Setup Migration options",
+ "Setup Migration options", NULL, NULL);
g_option_group_add_entries (option_group, option_entries);
g_option_context_set_main_group (option_context, option_group);
g_error ("Failed to parse program arguments: %s", error->message);
if (!book_id || !contacts_directory)
- g_error ("Must provide the book identifier and contacts directory\n%s",
- g_option_context_get_help (option_context, TRUE, NULL));
-
+ g_error (
+ "Must provide the book identifier and contacts directory\n%s",
+ g_option_context_get_help (option_context, TRUE, NULL));
if (test_sandbox) {
#if EDS_CHECK_VERSION(3,10,0)
g_test_init (&argc, &argv, NULL);
- g_test_add ("/SettingUpMigrationTest",
- ETestServerFixture,
- &book_closure,
- setup_migration_setup,
- setup_migration_run,
- e_test_server_utils_teardown);
+ g_test_add (
+ "/SettingUpMigrationTest",
+ ETestServerFixture,
+ &book_closure,
+ setup_migration_setup,
+ setup_migration_run,
+ e_test_server_utils_teardown);
return e_test_server_utils_run ();
#else
- g_error ("Requested sandboxed setup but that is not available until EDS 3.10, current version is %d.%d",
- EDS_MAJOR_VERSION, EDS_MINOR_VERSION);
+ g_error (
+ "Requested sandboxed setup but that is not available until EDS 3.10, current version is %d.%d",
+ EDS_MAJOR_VERSION, EDS_MINOR_VERSION);
#endif
} else {
typedef void ( *MigrationTestFunc) (MigrationFixture *fixture,
gconstpointer user_data);
-static const gchar *arbitrary_vcard =
+static const gchar *arbitrary_vcard =
"BEGIN:VCARD\n"
"UID:arbitrary-vcard\n"
"FN:Bobby Brown\n"
G_FILE_COPY_OVERWRITE |
G_FILE_COPY_TARGET_DEFAULT_PERMS,
NULL, NULL, NULL, &error))
- g_error ("Failed to setup sandbox for %s migration test: %s",
- version, error->message);
+ g_error (
+ "Failed to setup sandbox for %s migration test: %s",
+ version, error->message);
g_object_unref (src_file);
g_object_unref (dest_file);
G_FILE_COPY_OVERWRITE |
G_FILE_COPY_TARGET_DEFAULT_PERMS,
NULL, NULL, NULL, &error))
- g_error ("Failed to setup sandbox for %s migration test: %s",
- version, error->message);
+ g_error (
+ "Failed to setup sandbox for %s migration test: %s",
+ version, error->message);
g_object_unref (src_file);
g_object_unref (dest_file);
static void
migration_fixture_setup (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
- ETestServerFixture *parent = (ETestServerFixture *)fixture;
- MigrationClosure *closure = (MigrationClosure *)user_data;
+ ETestServerFixture *parent = (ETestServerFixture *) fixture;
+ MigrationClosure *closure = (MigrationClosure *) user_data;
parent->source_name = g_strdup (closure->version);
setup_migration_sandbox (closure->version);
- e_test_server_utils_setup ((ETestServerFixture *)parent, user_data);
+ e_test_server_utils_setup ((ETestServerFixture *) parent, user_data);
}
static void
migration_fixture_teardown (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
- e_test_server_utils_teardown ((ETestServerFixture *)fixture, user_data);
+ e_test_server_utils_teardown ((ETestServerFixture *) fixture, user_data);
}
-
/***********************************************************
* Tests *
***********************************************************/
static void
test_open (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
-
+
}
static void
test_fetch_contacts (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
EBookClient *book_client;
GSList *contacts = NULL;
static void
test_add_remove_contact (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
EBookClient *book_client;
EContact *contact = NULL;
static GSList *
test_query (EBookClient *book_client,
- gint expected_results,
- EBookQuery *query)
+ gint expected_results,
+ EBookQuery *query)
{
GSList *contacts = NULL;
GError *error = NULL;
static void
test_query_email (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
EBookClient *book_client;
GSList *contacts = NULL;
book_client = E_TEST_SERVER_UTILS_SERVICE (fixture, EBookClient);
- contacts = test_query (book_client, 13,
- e_book_query_field_test (
- E_CONTACT_EMAIL,
- E_BOOK_QUERY_ENDS_WITH,
- ".com"));
+ contacts = test_query (
+ book_client, 13,
+ e_book_query_field_test (
+ E_CONTACT_EMAIL,
+ E_BOOK_QUERY_ENDS_WITH,
+ ".com"));
g_slist_free_full (contacts, g_object_unref);
}
static void
test_query_name (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
EBookClient *book_client;
GSList *contacts = NULL;
book_client = E_TEST_SERVER_UTILS_SERVICE (fixture, EBookClient);
- contacts = test_query (book_client, 4,
- e_book_query_field_test (
- E_CONTACT_FULL_NAME,
- E_BOOK_QUERY_CONTAINS,
- "cote"));
+ contacts = test_query (
+ book_client, 4,
+ e_book_query_field_test (
+ E_CONTACT_FULL_NAME,
+ E_BOOK_QUERY_CONTAINS,
+ "cote"));
g_slist_free_full (contacts, g_object_unref);
}
static void
test_query_phone (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
EBookClient *book_client;
GSList *contacts = NULL;
book_client = E_TEST_SERVER_UTILS_SERVICE (fixture, EBookClient);
- contacts = test_query (book_client, 4,
- e_book_query_field_test (
- E_CONTACT_TEL,
- E_BOOK_QUERY_CONTAINS,
- "221"));
+ contacts = test_query (
+ book_client, 4,
+ e_book_query_field_test (
+ E_CONTACT_TEL,
+ E_BOOK_QUERY_CONTAINS,
+ "221"));
g_slist_free_full (contacts, g_object_unref);
}
dir = g_dir_open (EDS_TEST_SQLITE_BOOKS, 0, &error);
if (!dir)
- g_error ("Failed to open migration sandbox directory '%s': %s",
- EDS_TEST_SQLITE_BOOKS, error->message);
+ g_error (
+ "Failed to open migration sandbox directory '%s': %s",
+ EDS_TEST_SQLITE_BOOKS, error->message);
while ((filename = g_dir_read_name (dir)) != NULL) {
static void
add_test (const gchar *version,
- const gchar *test_name,
- MigrationTestFunc test_func)
+ const gchar *test_name,
+ MigrationTestFunc test_func)
{
MigrationClosure *closure;
gchar *path;
closure = g_slice_new0 (MigrationClosure);
closure->parent.type = E_TEST_SERVER_ADDRESS_BOOK;
- closure->parent.destroy_closure_func = (GDestroyNotify)migration_closure_free;
+ closure->parent.destroy_closure_func = (GDestroyNotify) migration_closure_free;
closure->parent.keep_work_directory = TRUE;
closure->version = g_strdup (version);
- path = g_strdup_printf ("/Migration/From-%s/%s",
- version, test_name);
+ path = g_strdup_printf (
+ "/Migration/From-%s/%s",
+ version, test_name);
- g_test_add (path, MigrationFixture, closure,
- migration_fixture_setup,
- test_func,
- migration_fixture_teardown);
+ g_test_add (
+ path, MigrationFixture, closure,
+ migration_fixture_setup,
+ test_func,
+ migration_fixture_teardown);
g_free (path);
}
static gboolean
test_vcard_qp_2_1_parsing (const gchar *vcard_str,
- const gchar *expected_text)
+ const gchar *expected_text)
{
EVCard *vcard;
EVCardAttribute *attr;
}
gint
-main (gint argc, gchar **argv)
+main (gint argc,
+ gchar **argv)
{
/* e_sexp_add_variable(f, 0, "test", NULL); */
static void
e_test_server_utils_client_ready (GObject *source_object,
- GAsyncResult *res,
- gpointer user_data)
+ GAsyncResult *res,
+ gpointer user_data)
{
- FixturePair *pair = (FixturePair *)user_data;
+ FixturePair *pair = (FixturePair *) user_data;
GError *error = NULL;
switch (pair->closure->type) {
if (!pair->fixture->service.book_client)
g_error ("Unable to create the test book: %s", error->message);
- g_object_weak_ref (G_OBJECT (pair->fixture->service.book_client),
- client_weak_notify, pair->fixture);
+ g_object_weak_ref (
+ G_OBJECT (pair->fixture->service.book_client),
+ client_weak_notify, pair->fixture);
break;
case E_TEST_SERVER_DIRECT_ADDRESS_BOOK:
pair->fixture->service.book_client = (EBookClient *)
if (!pair->fixture->service.book_client)
g_error ("Unable to create the test book: %s", error->message);
- g_object_weak_ref (G_OBJECT (pair->fixture->service.book_client),
- client_weak_notify, pair->fixture);
+ g_object_weak_ref (
+ G_OBJECT (pair->fixture->service.book_client),
+ client_weak_notify, pair->fixture);
break;
case E_TEST_SERVER_CALENDAR:
pair->fixture->service.calendar_client = (ECalClient *)
if (!pair->fixture->service.calendar_client)
g_error ("Unable to create the test calendar: %s", error->message);
- g_object_weak_ref (G_OBJECT (pair->fixture->service.calendar_client),
- client_weak_notify, pair->fixture);
+ g_object_weak_ref (
+ G_OBJECT (pair->fixture->service.calendar_client),
+ client_weak_notify, pair->fixture);
break;
case E_TEST_SERVER_DEPRECATED_ADDRESS_BOOK:
case E_TEST_SERVER_DEPRECATED_CALENDAR:
e_book_client_connect_direct (source, NULL, e_test_server_utils_client_ready, pair);
else
pair->fixture->service.book_client = (EBookClient *)
- e_book_client_connect_direct_sync (pair->fixture->registry,
- source, NULL, &error);
+ e_book_client_connect_direct_sync (
+ pair->fixture->registry,
+ source, NULL, &error);
} else {
if (pair->closure->use_async_connect)
if (!pair->fixture->service.book_client)
g_error ("Unable to create the test book: %s", error->message);
- g_object_weak_ref (G_OBJECT (pair->fixture->service.book_client),
- client_weak_notify, pair->fixture);
+ g_object_weak_ref (
+ G_OBJECT (pair->fixture->service.book_client),
+ client_weak_notify, pair->fixture);
}
break;
case E_TEST_SERVER_CALENDAR:
if (pair->closure->use_async_connect) {
- e_cal_client_connect (source, pair->closure->calendar_source_type,
- NULL, e_test_server_utils_client_ready, pair);
+ e_cal_client_connect (
+ source, pair->closure->calendar_source_type,
+ NULL, e_test_server_utils_client_ready, pair);
} else {
pair->fixture->service.calendar_client = (ECalClient *)
e_cal_client_connect_sync (
- source,
+ source,
pair->closure->calendar_source_type, NULL, &error);
if (!pair->fixture->service.calendar_client)
g_error ("Unable to create the test calendar: %s", error->message);
- g_object_weak_ref (G_OBJECT (pair->fixture->service.calendar_client),
- client_weak_notify, pair->fixture);
+ g_object_weak_ref (
+ G_OBJECT (pair->fixture->service.calendar_client),
+ client_weak_notify, pair->fixture);
}
break;