[evolution-data-server] Miscellaneous cleanups.
- From: Matthew Barnes <mbarnes src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [evolution-data-server] Miscellaneous cleanups.
- Date: Sun, 20 Oct 2013 16:42:19 +0000 (UTC)
commit bfbedfb4c64501fceaf68961bac29b92a9d7f8b2
Author: Matthew Barnes <mbarnes redhat com>
Date: Sun Oct 20 09:17:42 2013 -0400
Miscellaneous cleanups.
.../backends/google/e-book-backend-google.c | 16 ++--
addressbook/backends/ldap/e-book-backend-ldap.c | 2 +-
addressbook/libebook-contacts/e-book-query.c | 4 +-
addressbook/libebook-contacts/e-vcard.c | 8 +-
addressbook/libebook/e-book-client.c | 18 ++--
addressbook/libebook/e-destination.c | 4 +-
addressbook/libedata-book/e-book-backend.c | 14 ++-
camel/camel-folder-search.c | 8 +-
camel/camel-folder-summary.h | 34 ++++----
camel/camel-imapx-server.c | 6 +-
camel/camel-imapx-store-summary.c | 1 -
camel/camel-sasl-gssapi.c | 4 +-
camel/providers/pop3/camel-pop3-folder.c | 4 +-
libebackend/e-authentication-mediator.c | 15 ++-
libebackend/e-user-prompter-server.c | 7 +-
libedataserver/e-source-authenticator.c | 4 +-
libedataserver/e-source-registry.c | 4 +-
libedataserver/e-time-utils.c | 4 +-
tests/book-migration/setup-migration-test.c | 69 +++++++------
tests/book-migration/test-migration.c | 101 +++++++++++---------
tests/libebook-contacts/test-vcard-parsing.c | 2 +-
tests/libedata-cal/test-cal-backend-sexp.c | 3 +-
tests/test-server-utils/e-test-server-utils.c | 43 +++++----
23 files changed, 207 insertions(+), 168 deletions(-)
---
diff --git a/addressbook/backends/google/e-book-backend-google.c
b/addressbook/backends/google/e-book-backend-google.c
index b0c1008..f5fb85a 100644
--- a/addressbook/backends/google/e-book-backend-google.c
+++ b/addressbook/backends/google/e-book-backend-google.c
@@ -402,14 +402,14 @@ cache_set_last_update (EBookBackend *backend,
}
/* 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;
@@ -2189,9 +2189,9 @@ book_backend_google_stop_view (EBookBackend *backend,
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));
diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c
index 62b5b3e..0cff453 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -1242,7 +1242,7 @@ ldap_error_to_response (gint ldap_error)
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. */
diff --git a/addressbook/libebook-contacts/e-book-query.c b/addressbook/libebook-contacts/e-book-query.c
index 8a79655..688eeb0 100644
--- a/addressbook/libebook-contacts/e-book-query.c
+++ b/addressbook/libebook-contacts/e-book-query.c
@@ -118,7 +118,7 @@ e_book_query_and (gint nqs,
* 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.
*
@@ -201,7 +201,7 @@ e_book_query_orv (EBookQuery *q, ...)
/**
* 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.
*
diff --git a/addressbook/libebook-contacts/e-vcard.c b/addressbook/libebook-contacts/e-vcard.c
index f6d5218..1b3979d 100644
--- a/addressbook/libebook-contacts/e-vcard.c
+++ b/addressbook/libebook-contacts/e-vcard.c
@@ -494,7 +494,7 @@ read_attribute_params (EVCardAttribute *attr,
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 {
@@ -923,7 +923,7 @@ e_vcard_new_from_string (const gchar *str)
static gchar *
e_vcard_qp_encode (const gchar *txt,
- gboolean can_wrap)
+ gboolean can_wrap)
{
const gchar *p = txt;
GString *escaped = g_string_new ("");
@@ -1194,7 +1194,7 @@ e_vcard_to_string_vcard_30 (EVCard *evc)
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 &&
@@ -1254,7 +1254,7 @@ e_vcard_to_string_vcard_30 (EVCard *evc)
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;
diff --git a/addressbook/libebook/e-book-client.c b/addressbook/libebook/e-book-client.c
index dae0435..0f2ceb2 100644
--- a/addressbook/libebook/e-book-client.c
+++ b/addressbook/libebook/e-book-client.c
@@ -1310,9 +1310,9 @@ e_book_client_new (ESource *source,
/* 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;
@@ -1400,8 +1400,8 @@ e_book_client_connect_direct_sync (ESourceRegistry *registry,
/* 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;
@@ -1459,9 +1459,9 @@ exit:
**/
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;
@@ -1522,7 +1522,7 @@ e_book_client_connect_direct (ESource *source,
**/
EClient *
e_book_client_connect_direct_finish (GAsyncResult *result,
- GError **error)
+ GError **error)
{
GSimpleAsyncResult *simple;
ConnectClosure *closure;
diff --git a/addressbook/libebook/e-destination.c b/addressbook/libebook/e-destination.c
index 3c0dc73..9001482 100644
--- a/addressbook/libebook/e-destination.c
+++ b/addressbook/libebook/e-destination.c
@@ -908,7 +908,7 @@ e_destination_get_name (const EDestination *dest)
*
* 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)
@@ -919,7 +919,7 @@ 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.
*/
diff --git a/addressbook/libedata-book/e-book-backend.c b/addressbook/libedata-book/e-book-backend.c
index 217a542..3db105a 100644
--- a/addressbook/libedata-book/e-book-backend.c
+++ b/addressbook/libedata-book/e-book-backend.c
@@ -3047,19 +3047,25 @@ e_book_backend_is_readonly (EBookBackend *backend)
* 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;
}
/**
diff --git a/camel/camel-folder-search.c b/camel/camel-folder-search.c
index 032084b..8e44872 100644
--- a/camel/camel-folder-search.c
+++ b/camel/camel-folder-search.c
@@ -628,7 +628,7 @@ get_default_charset (CamelMimeMessage *msg)
static gchar *
get_header_decoded (const gchar *header_value,
- const gchar *default_charset)
+ const gchar *default_charset)
{
gchar *unfold, *decoded;
@@ -644,7 +644,7 @@ get_header_decoded (const gchar *header_value,
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 ("");
@@ -1829,7 +1829,7 @@ camel_folder_search_set_body_index (CamelFolderSearch *search,
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[] = {
@@ -1861,7 +1861,7 @@ do_search_in_memory (CamelFolder *search_in_folder,
*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;
}
diff --git a/camel/camel-folder-summary.h b/camel/camel-folder-summary.h
index 3aec1c9..3d12c70 100644
--- a/camel/camel-folder-summary.h
+++ b/camel/camel-folder-summary.h
@@ -545,10 +545,10 @@ time_t camel_message_info_time (const CamelMessageInfo *info,
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:
@@ -559,35 +559,35 @@ time_t camel_message_info_time (const CamelMessageInfo *info,
* 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:
@@ -598,7 +598,7 @@ time_t camel_message_info_time (const CamelMessageInfo *info,
* 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:
@@ -609,7 +609,7 @@ time_t camel_message_info_time (const CamelMessageInfo *info,
* 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);
diff --git a/camel/camel-imapx-server.c b/camel/camel-imapx-server.c
index b046f56..f107468 100644
--- a/camel/camel-imapx-server.c
+++ b/camel/camel-imapx-server.c
@@ -2251,7 +2251,8 @@ imapx_untagged_status (CamelIMAPXServer *is,
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) {
@@ -2278,7 +2279,8 @@ imapx_untagged_status (CamelIMAPXServer *is,
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);
}
diff --git a/camel/camel-imapx-store-summary.c b/camel/camel-imapx-store-summary.c
index 81cdd17..72d36b3 100644
--- a/camel/camel-imapx-store-summary.c
+++ b/camel/camel-imapx-store-summary.c
@@ -48,7 +48,6 @@ G_DEFINE_TYPE (
camel_imapx_store_summary,
CAMEL_TYPE_STORE_SUMMARY)
-
static CamelIMAPXNamespaceList *
namespace_load (CamelStoreSummary *s,
FILE *in)
diff --git a/camel/camel-sasl-gssapi.c b/camel/camel-sasl-gssapi.c
index 4407402..79fb22d 100644
--- a/camel/camel-sasl-gssapi.c
+++ b/camel/camel-sasl-gssapi.c
@@ -539,8 +539,8 @@ camel_sasl_gssapi_is_available (void)
**/
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));
diff --git a/camel/providers/pop3/camel-pop3-folder.c b/camel/providers/pop3/camel-pop3-folder.c
index 8807cf2..93988aa 100644
--- a/camel/providers/pop3/camel-pop3-folder.c
+++ b/camel/providers/pop3/camel-pop3-folder.c
@@ -445,8 +445,8 @@ pop3_folder_get_uids (CamelFolder *folder)
static GPtrArray *
pop3_get_uncached_uids (CamelFolder *folder,
- GPtrArray *uids,
- GError **error)
+ GPtrArray *uids,
+ GError **error)
{
CamelPOP3Folder *pop3_folder;
CamelPOP3Store *pop3_store;
diff --git a/libebackend/e-authentication-mediator.c b/libebackend/e-authentication-mediator.c
index 2a571bb..92b53eb 100644
--- a/libebackend/e-authentication-mediator.c
+++ b/libebackend/e-authentication-mediator.c
@@ -911,7 +911,8 @@ e_authentication_mediator_class_init (EAuthenticationMediatorClass *class)
{
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;
@@ -969,10 +970,14 @@ e_authentication_mediator_initable_init (GInitableIface *interface)
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
diff --git a/libebackend/e-user-prompter-server.c b/libebackend/e-user-prompter-server.c
index 9b3b2e2..13b5c84 100644
--- a/libebackend/e-user-prompter-server.c
+++ b/libebackend/e-user-prompter-server.c
@@ -289,11 +289,16 @@ user_prompter_server_extension_prompt_cb (EDBusUserPrompter *dbus_prompter,
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 (
diff --git a/libedataserver/e-source-authenticator.c b/libedataserver/e-source-authenticator.c
index 02bb8c1..f7530a2 100644
--- a/libedataserver/e-source-authenticator.c
+++ b/libedataserver/e-source-authenticator.c
@@ -391,10 +391,10 @@ e_source_authenticator_get_prompt_strings (ESourceAuthenticator *auth,
* 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
**/
diff --git a/libedataserver/e-source-registry.c b/libedataserver/e-source-registry.c
index 812371e..ed10804 100644
--- a/libedataserver/e-source-registry.c
+++ b/libedataserver/e-source-registry.c
@@ -1995,6 +1995,7 @@ e_source_registry_authenticate_sync (ESourceRegistry *registry,
AuthContext *auth_context;
GMainContext *main_context;
EDBusAuthenticator *dbus_auth;
+ gboolean without_password;
gchar *encryption_key;
gchar *object_path = NULL;
GError *local_error = NULL;
@@ -2037,7 +2038,8 @@ e_source_registry_authenticate_sync (ESourceRegistry *registry,
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);
diff --git a/libedataserver/e-time-utils.c b/libedataserver/e-time-utils.c
index 4a8b41c..c56e22a 100644
--- a/libedataserver/e-time-utils.c
+++ b/libedataserver/e-time-utils.c
@@ -1923,9 +1923,9 @@ e_time_parse_time (const gchar *value,
*
* 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
diff --git a/tests/book-migration/setup-migration-test.c b/tests/book-migration/setup-migration-test.c
index 46dd142..1388853 100644
--- a/tests/book-migration/setup-migration-test.c
+++ b/tests/book-migration/setup-migration-test.c
@@ -121,10 +121,10 @@ typedef struct {
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)
@@ -132,7 +132,7 @@ source_added (ESourceRegistry *registry,
/* 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);
@@ -175,8 +175,9 @@ create_book (const gchar *book_id)
/* 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);
@@ -220,7 +221,7 @@ create_book (const gchar *book_id)
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;
@@ -228,15 +229,14 @@ create_book (const gchar *book_id)
#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;
@@ -247,8 +247,8 @@ add_contacts (Book *book,
#else
static void
-add_contacts (Book *book,
- GSList *contacts)
+add_contacts (Book *book,
+ GSList *contacts)
{
GError *error = NULL;
GSList *l;
@@ -276,7 +276,7 @@ static ETestServerClosure book_closure = {
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);
@@ -284,7 +284,7 @@ setup_migration_setup (ETestServerFixture *fixture,
static void
setup_migration_run (ETestServerFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
EBookClient *book_client;
GSList *contacts;
@@ -302,7 +302,8 @@ setup_migration_run (ETestServerFixture *fixture,
* main() *
********************************************************/
gint
-main (gint argc, gchar *argv[])
+main (gint argc,
+ gchar *argv[])
{
GOptionContext *option_context;
GOptionGroup *option_group;
@@ -311,12 +312,14 @@ main (gint argc, gchar *argv[])
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);
@@ -324,25 +327,27 @@ main (gint argc, gchar *argv[])
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 {
diff --git a/tests/book-migration/test-migration.c b/tests/book-migration/test-migration.c
index 0c84eca..47892fe 100644
--- a/tests/book-migration/test-migration.c
+++ b/tests/book-migration/test-migration.c
@@ -39,7 +39,7 @@ typedef struct {
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"
@@ -78,8 +78,9 @@ setup_migration_sandbox (const gchar *version)
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);
@@ -94,8 +95,9 @@ setup_migration_sandbox (const gchar *version)
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);
@@ -111,39 +113,38 @@ setup_migration_sandbox (const gchar *version)
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;
@@ -165,7 +166,7 @@ test_fetch_contacts (MigrationFixture *fixture,
static void
test_add_remove_contact (MigrationFixture *fixture,
- gconstpointer user_data)
+ gconstpointer user_data)
{
EBookClient *book_client;
EContact *contact = NULL;
@@ -186,8 +187,8 @@ test_add_remove_contact (MigrationFixture *fixture,
static GSList *
test_query (EBookClient *book_client,
- gint expected_results,
- EBookQuery *query)
+ gint expected_results,
+ EBookQuery *query)
{
GSList *contacts = NULL;
GError *error = NULL;
@@ -209,54 +210,57 @@ test_query (EBookClient *book_client,
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);
}
@@ -274,8 +278,9 @@ list_migration_sandboxes (void)
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) {
@@ -316,8 +321,8 @@ migration_closure_free (MigrationClosure *closure)
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;
@@ -325,17 +330,19 @@ add_test (const gchar *version,
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);
}
diff --git a/tests/libebook-contacts/test-vcard-parsing.c b/tests/libebook-contacts/test-vcard-parsing.c
index 15c9b8a..7a997ab 100644
--- a/tests/libebook-contacts/test-vcard-parsing.c
+++ b/tests/libebook-contacts/test-vcard-parsing.c
@@ -222,7 +222,7 @@ test_econtact (const gchar *vcard_str)
static gboolean
test_vcard_qp_2_1_parsing (const gchar *vcard_str,
- const gchar *expected_text)
+ const gchar *expected_text)
{
EVCard *vcard;
EVCardAttribute *attr;
diff --git a/tests/libedata-cal/test-cal-backend-sexp.c b/tests/libedata-cal/test-cal-backend-sexp.c
index 52951f0..8d91e58 100644
--- a/tests/libedata-cal/test-cal-backend-sexp.c
+++ b/tests/libedata-cal/test-cal-backend-sexp.c
@@ -16,7 +16,8 @@ test_query (const gchar *query)
}
gint
-main (gint argc, gchar **argv)
+main (gint argc,
+ gchar **argv)
{
/* e_sexp_add_variable(f, 0, "test", NULL); */
diff --git a/tests/test-server-utils/e-test-server-utils.c b/tests/test-server-utils/e-test-server-utils.c
index 9c0f852..a7c4cc8 100644
--- a/tests/test-server-utils/e-test-server-utils.c
+++ b/tests/test-server-utils/e-test-server-utils.c
@@ -138,10 +138,10 @@ client_weak_notify (gpointer data,
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) {
@@ -152,8 +152,9 @@ e_test_server_utils_client_ready (GObject *source_object,
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 *)
@@ -162,8 +163,9 @@ e_test_server_utils_client_ready (GObject *source_object,
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 *)
@@ -172,8 +174,9 @@ e_test_server_utils_client_ready (GObject *source_object,
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:
@@ -203,8 +206,9 @@ e_test_server_utils_source_added (ESourceRegistry *registry,
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)
@@ -218,8 +222,9 @@ e_test_server_utils_source_added (ESourceRegistry *registry,
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;
@@ -243,20 +248,22 @@ e_test_server_utils_source_added (ESourceRegistry *registry,
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]