[evolution-data-server/gnome-3-10] Miscellaneous cleanups.



commit 04949851083ecc568e1a0b96d6094358a2f7c90c
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Oct 20 09:20:36 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-destination.c               |    4 ++--
 addressbook/libedata-book/e-book-backend.c         |   14 ++++++++++----
 camel/camel-folder-search.c                        |    8 ++++----
 camel/camel-imapx-server.c                         |    6 ++++--
 camel/camel-imapx-store-summary.c                  |    1 -
 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/libebook-contacts/test-vcard-parsing.c       |    2 +-
 16 files changed, 61 insertions(+), 42 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-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 da446dd..cd2ffb2 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-imapx-server.c b/camel/camel-imapx-server.c
index cc719e9..5cf5dec 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 e02811b..318ed45 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/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 70c99bb..fa8a37d 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/libebook-contacts/test-vcard-parsing.c b/tests/libebook-contacts/test-vcard-parsing.c
index c32ee04..ca61dee 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;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]