[evolution-data-server] Miscellaneous cleanups.



commit 7c2bd7fb6de0618df0186cdada4079d0386ddd83
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sun Jul 28 09:54:47 2013 -0400

    Miscellaneous cleanups.

 addressbook/backends/ldap/e-book-backend-ldap.c    |    8 ++--
 .../backends/webdav/e-book-backend-webdav.c        |    7 ++-
 addressbook/libebook-contacts/e-book-query.c       |   12 +++---
 addressbook/libedata-book/e-book-backend-sexp.c    |   31 +++++++-------
 .../libedata-book/e-book-backend-sqlitedb.c        |   43 ++++++++++----------
 calendar/libedata-cal/e-cal-backend-store.c        |    2 +-
 camel/camel-folder.c                               |    4 +-
 camel/camel-gpg-context.c                          |    4 +-
 camel/camel-object-bag.c                           |   29 +++++++------
 camel/camel-sasl-ntlm.c                            |    1 -
 camel/camel-service.c                              |    6 +-
 tests/libebook/client/test-client-custom-summary.c |   14 +++----
 12 files changed, 82 insertions(+), 79 deletions(-)
---
diff --git a/addressbook/backends/ldap/e-book-backend-ldap.c b/addressbook/backends/ldap/e-book-backend-ldap.c
index 6fc9937..21f053e 100644
--- a/addressbook/backends/ldap/e-book-backend-ldap.c
+++ b/addressbook/backends/ldap/e-book-backend-ldap.c
@@ -463,7 +463,7 @@ can_browse (EBookBackend *backend)
 }
 
 /* because the priv->marked_for_offline is populated only after open,
-   thus get the actual value directy from the source */
+ * thus get the actual value directy from the source */
 static gboolean
 get_marked_for_offline (EBookBackend *backend)
 {
@@ -4688,9 +4688,9 @@ generate_cache (EBookBackendLDAP *book_backend_ldap)
 
 static void
 book_backend_ldap_refresh (EBookBackend *backend,
-                          EDataBook *book,
-                          guint32 opid,
-                          GCancellable *cancellable)
+                           EDataBook *book,
+                           guint32 opid,
+                           GCancellable *cancellable)
 {
        EBookBackendLDAP *ldap_backend = E_BOOK_BACKEND_LDAP (backend);
 
diff --git a/addressbook/backends/webdav/e-book-backend-webdav.c 
b/addressbook/backends/webdav/e-book-backend-webdav.c
index 5f51d4e..30fd534 100644
--- a/addressbook/backends/webdav/e-book-backend-webdav.c
+++ b/addressbook/backends/webdav/e-book-backend-webdav.c
@@ -111,7 +111,7 @@ webdav_debug_setup (SoupSession *session)
 
 static void
 webdav_contact_set_etag (EContact *contact,
-                        const gchar *etag)
+                         const gchar *etag)
 {
        EVCardAttribute *attr;
 
@@ -717,7 +717,7 @@ check_addressbook_changed (EBookBackendWebdav *webdav,
                                stored_version = e_file_cache_get_object (E_FILE_CACHE (priv->cache), 
WEBDAV_CACHE_VERSION_KEY);
 
                                /* The ETag was moved from REV to its own attribute, thus
-                                  if the cache version is too low, update it. */
+                                * if the cache version is too low, update it. */
                                old_version = !stored_version || atoi (stored_version) < atoi 
(WEBDAV_CACHE_VERSION);
                                g_mutex_unlock (&priv->cache_lock);
 
@@ -752,7 +752,8 @@ check_addressbook_changed (EBookBackendWebdav *webdav,
                                        if (!e_file_cache_replace_object (E_FILE_CACHE (priv->cache),
                                                WEBDAV_CACHE_VERSION_KEY,
                                                WEBDAV_CACHE_VERSION))
-                                               e_file_cache_add_object (E_FILE_CACHE (priv->cache),
+                                               e_file_cache_add_object (
+                                                       E_FILE_CACHE (priv->cache),
                                                        WEBDAV_CACHE_VERSION_KEY,
                                                        WEBDAV_CACHE_VERSION);
 
diff --git a/addressbook/libebook-contacts/e-book-query.c b/addressbook/libebook-contacts/e-book-query.c
index 39e59a8..fb59765 100644
--- a/addressbook/libebook-contacts/e-book-query.c
+++ b/addressbook/libebook-contacts/e-book-query.c
@@ -621,18 +621,18 @@ func_eqphone_short (struct _ESExp *f,
 
 static ESExpResult *
 func_regex_normal (struct _ESExp *f,
-                  gint argc,
-                  struct _ESExpResult **argv,
-                  gpointer data)
+                   gint argc,
+                   struct _ESExpResult **argv,
+                   gpointer data)
 {
        return func_field_test (E_BOOK_QUERY_REGEX_NORMAL, f, argc, argv, data);
 }
 
 static ESExpResult *
 func_regex_raw (struct _ESExp *f,
-               gint argc,
-               struct _ESExpResult **argv,
-               gpointer data)
+                gint argc,
+                struct _ESExpResult **argv,
+                gpointer data)
 {
        return func_field_test (E_BOOK_QUERY_REGEX_RAW, f, argc, argv, data);
 }
diff --git a/addressbook/libedata-book/e-book-backend-sexp.c b/addressbook/libedata-book/e-book-backend-sexp.c
index 0b8a8fc..d046f89 100644
--- a/addressbook/libedata-book/e-book-backend-sexp.c
+++ b/addressbook/libedata-book/e-book-backend-sexp.c
@@ -852,9 +852,9 @@ func_eqphone_short (struct _ESExp *f,
 
 static gboolean
 regex_helper (const gchar *ps1,
-             const gchar *ps2,
-             const gchar *region,
-             gboolean     normalize)
+              const gchar *ps2,
+              const gchar *region,
+              gboolean normalize)
 {
        const gchar *field_data = ps1;
        const gchar *expression = ps2;
@@ -864,8 +864,9 @@ regex_helper (const gchar *ps1,
 
        regex = g_regex_new (expression, 0, 0, &error);
        if (!regex) {
-               g_warning ("Failed to parse regular expression '%s': %s",
-                          expression, error ? error->message : _("Unknown error"));
+               g_warning (
+                       "Failed to parse regular expression '%s': %s",
+                       expression, error ? error->message : _("Unknown error"));
                g_clear_error (&error);
                return FALSE;
        }
@@ -886,25 +887,25 @@ regex_helper (const gchar *ps1,
 
 static gboolean
 regex_normal_helper (const gchar *ps1,
-                    const gchar *ps2,
-                    const gchar *region)
+                     const gchar *ps2,
+                     const gchar *region)
 {
        return regex_helper (ps1, ps2, region, TRUE);
 }
 
 static gboolean
 regex_raw_helper (const gchar *ps1,
-                 const gchar *ps2,
-                 const gchar *region)
+                  const gchar *ps2,
+                  const gchar *region)
 {
        return regex_helper (ps1, ps2, region, FALSE);
 }
 
 static ESExpResult *
 func_regex_normal (struct _ESExp *f,
-                  gint argc,
-                  struct _ESExpResult **argv,
-                  gpointer data)
+                   gint argc,
+                   struct _ESExpResult **argv,
+                   gpointer data)
 {
        SearchContext *ctx = data;
 
@@ -913,9 +914,9 @@ func_regex_normal (struct _ESExp *f,
 
 static ESExpResult *
 func_regex_raw (struct _ESExp *f,
-               gint argc,
-               struct _ESExpResult **argv,
-               gpointer data)
+                gint argc,
+                struct _ESExpResult **argv,
+                gpointer data)
 {
        SearchContext *ctx = data;
 
diff --git a/addressbook/libedata-book/e-book-backend-sqlitedb.c 
b/addressbook/libedata-book/e-book-backend-sqlitedb.c
index 64e2c0a..73a67a1 100644
--- a/addressbook/libedata-book/e-book-backend-sqlitedb.c
+++ b/addressbook/libedata-book/e-book-backend-sqlitedb.c
@@ -1267,9 +1267,9 @@ create_collation (gpointer data,
 }
 
 static void
-ebsdb_regexp (sqlite3_context *context, 
-             int argc, 
-             sqlite3_value **argv)
+ebsdb_regexp (sqlite3_context *context,
+              gint argc,
+              sqlite3_value **argv)
 {
        GRegex *regex;
        const gchar *expression;
@@ -1280,26 +1280,27 @@ ebsdb_regexp (sqlite3_context *context,
        if (!regex) {
                GError *error = NULL;
 
-               expression = (const gchar *)sqlite3_value_text (argv[0]);
+               expression = (const gchar *) sqlite3_value_text (argv[0]);
 
                regex = g_regex_new (expression, 0, 0, &error);
 
                if (!regex) {
-                       sqlite3_result_error (context,
-                                             error ?
-                                             error->message :
-                                             _("Error parsing regular expression"),
-                                             -1);
+                       sqlite3_result_error (
+                               context,
+                               error ?
+                               error->message :
+                               _("Error parsing regular expression"),
+                               -1);
                        g_clear_error (&error);
                        return;
                }
 
                /* SQLite will take care of freeing the GRegex when we're done with the query */
-               sqlite3_set_auxdata (context, 0, regex, (void(*)(void*))g_regex_unref);
+               sqlite3_set_auxdata (context, 0, regex, (void (*)(gpointer)) g_regex_unref);
        }
 
        /* Now perform the comparison */
-       text = (const gchar *)sqlite3_value_text (argv[1]);
+       text = (const gchar *) sqlite3_value_text (argv[1]);
        if (text != NULL) {
                gboolean match;
 
@@ -1324,8 +1325,9 @@ book_backend_sqlitedb_load (EBookBackendSqliteDB *ebsdb,
                ret = sqlite3_collation_needed (ebsdb->priv->db, ebsdb, create_collation);
 
        if (ret == SQLITE_OK)
-               ret = sqlite3_create_function (ebsdb->priv->db, "regexp", 2, SQLITE_UTF8, ebsdb,
-                                              ebsdb_regexp, NULL, NULL);
+               ret = sqlite3_create_function (
+                       ebsdb->priv->db, "regexp", 2, SQLITE_UTF8, ebsdb,
+                       ebsdb_regexp, NULL, NULL);
 
        if (ret != SQLITE_OK) {
                if (!ebsdb->priv->db) {
@@ -2861,10 +2863,10 @@ func_check_phone (struct _ESExp *f,
 }
 
 static ESExpResult *
-func_check_regex_raw (struct _ESExp         *f,
-                     gint                  argc,
-                     struct _ESExpResult **argv,
-                     gpointer              data)
+func_check_regex_raw (struct _ESExp *f,
+                      gint argc,
+                      struct _ESExpResult **argv,
+                      gpointer data)
 {
        /* Raw REGEX queries are not in the summary, we only keep
         * normalized data in the summary
@@ -3567,14 +3569,13 @@ func_eqphone_short (struct _ESExp *f,
 
 static ESExpResult *
 func_regex (struct _ESExp *f,
-           gint argc,
-           struct _ESExpResult **argv,
-           gpointer data)
+            gint argc,
+            struct _ESExpResult **argv,
+            gpointer data)
 {
        return convert_match_exp (f, argc, argv, data, MATCH_REGEX);
 }
 
-
 /* 'builtin' functions */
 static struct {
        const gchar *name;
diff --git a/calendar/libedata-cal/e-cal-backend-store.c b/calendar/libedata-cal/e-cal-backend-store.c
index c343ab7..a9f0459 100644
--- a/calendar/libedata-cal/e-cal-backend-store.c
+++ b/calendar/libedata-cal/e-cal-backend-store.c
@@ -1325,7 +1325,7 @@ e_cal_backend_store_get_components_by_uid (ECalBackendStore *store,
  **/
 gchar *
 e_cal_backend_store_get_components_by_uid_as_ical_string (ECalBackendStore *store,
-                                                         const gchar *uid)
+                                                          const gchar *uid)
 {
        GSList *comps;
        gchar *ical_string = NULL;
diff --git a/camel/camel-folder.c b/camel/camel-folder.c
index b9fea5a..38d96f0 100644
--- a/camel/camel-folder.c
+++ b/camel/camel-folder.c
@@ -273,8 +273,8 @@ prepare_folder_filter_data_free (FolderFilterData *data)
        GThread *thread;
 
        /* Do the actual free in a dedicated thread, because the driver or
-          folder unref can do network/blocking I/O operations, but this
-          function is called in the main (UI) thread.
+        * folder unref can do network/blocking I/O operations, but this
+        * function is called in the main (UI) thread.
        */
        thread = g_thread_new (NULL, folder_filter_data_free_thread, data);
        g_thread_unref (thread);
diff --git a/camel/camel-gpg-context.c b/camel/camel-gpg-context.c
index d1b6ef7..33453e1 100644
--- a/camel/camel-gpg-context.c
+++ b/camel/camel-gpg-context.c
@@ -2166,8 +2166,8 @@ gpg_decrypt_sync (CamelCipherContext *context,
        }
 
        /* Report errors only if nothing was decrypted; missing sender's key used
-          for signature of a signed and encrypted messages causes GPG to return
-          failure, thus count with it.
+        * for signature of a signed and encrypted messages causes GPG to return
+        * failure, thus count with it.
         */
        if (gpg_ctx_op_wait (gpg) != 0 && gpg->nodata) {
                const gchar *diagnostics;
diff --git a/camel/camel-object-bag.c b/camel/camel-object-bag.c
index e33c09c..4827bb4 100644
--- a/camel/camel-object-bag.c
+++ b/camel/camel-object-bag.c
@@ -104,10 +104,10 @@ object_bag_unreserve (CamelObjectBag *bag,
 }
 
 /* Ick. We need to store the original gobject pointer too, since that's
-   used as the key in one of the hash tables. So to clean up after the
-   object dies and the GWeakRef starts returning NULL, we'll need to
-   know where it *was*. This is safe because we'll always check and
-   avoid adding a duplicate. But still, ick. */
+ * used as the key in one of the hash tables. So to clean up after the
+ * object dies and the GWeakRef starts returning NULL, we'll need to
+ * know where it *was*. This is safe because we'll always check and
+ * avoid adding a duplicate. But still, ick. */
 typedef struct {
        GWeakRef ref;
        gpointer obj;
@@ -116,7 +116,7 @@ typedef struct {
 
 static void
 object_bag_notify (CamelObjectBag *bag,
-                  GObject *where_the_object_was)
+                   GObject *where_the_object_was)
 {
        gconstpointer key;
 
@@ -140,10 +140,11 @@ wref_free_func (gpointer p)
 
        if (obj) {
                /* The object is being removed from the bag while it's
-                  still alive, e.g. by camel_object_bag_remove()
-                  or camel_object_bag_destroy(). Drop the weak_ref. */
-               g_object_weak_unref (obj, (GWeakNotify) object_bag_notify,
-                                    ref->bag);
+                * still alive, e.g. by camel_object_bag_remove()
+                * or camel_object_bag_destroy(). Drop the weak_ref. */
+               g_object_weak_unref (
+                       obj, (GWeakNotify) object_bag_notify,
+                       ref->bag);
                g_object_unref (obj);
        }
        g_weak_ref_clear (&ref->ref);
@@ -384,7 +385,8 @@ camel_object_bag_reserve (CamelObjectBag *bag,
 }
 
 static gboolean
-object_in_bag (CamelObjectBag *bag, gpointer object)
+object_in_bag (CamelObjectBag *bag,
+               gpointer object)
 {
        gconstpointer key;
        ObjRef *ref;
@@ -438,7 +440,7 @@ camel_object_bag_add (CamelObjectBag *bag,
                ref = g_slice_new (ObjRef);
                ref->bag = bag;
                /* We need to stash a 'raw' pointer since that's the key we use
-                  in the key_table */
+                * in the key_table */
                ref->obj = object;
                g_weak_ref_init (&ref->ref, object);
                copied_key = bag->key_copy_func (key);
@@ -446,8 +448,9 @@ camel_object_bag_add (CamelObjectBag *bag,
                g_hash_table_insert (bag->object_table, copied_key, ref);
                object_bag_unreserve (bag, key);
 
-               g_object_weak_ref (G_OBJECT (object),
-                                  (GWeakNotify) object_bag_notify, bag);
+               g_object_weak_ref (
+                       G_OBJECT (object),
+                       (GWeakNotify) object_bag_notify, bag);
        }
 
        g_mutex_unlock (&bag->mutex);
diff --git a/camel/camel-sasl-ntlm.c b/camel/camel-sasl-ntlm.c
index 3018f54..eedb79d 100644
--- a/camel/camel-sasl-ntlm.c
+++ b/camel/camel-sasl-ntlm.c
@@ -976,7 +976,6 @@ exit:
        return ret;
 }
 
-
 static void
 sasl_ntlm_finalize (GObject *object)
 {
diff --git a/camel/camel-service.c b/camel/camel-service.c
index 46e9e1e..777a344 100644
--- a/camel/camel-service.c
+++ b/camel/camel-service.c
@@ -1900,9 +1900,9 @@ camel_service_disconnect (CamelService *service,
                        service->priv->connection_op = op;
 
                        /* Do not change the status if "Connecting" - in case a provider calls
-                          "Disconnect" during the connection phase, which confuses the other
-                          logic here, effectively makes the service's connection state "Connected",
-                          instead of "Disconnected", at the end. */
+                        * "Disconnect" during the connection phase, which confuses the other
+                        * logic here, effectively makes the service's connection state "Connected",
+                        * instead of "Disconnected", at the end. */
                        if (service->priv->status != CAMEL_SERVICE_CONNECTING) {
                                service->priv->status = CAMEL_SERVICE_DISCONNECTING;
                                service_queue_notify_connection_status (service);
diff --git a/tests/libebook/client/test-client-custom-summary.c 
b/tests/libebook/client/test-client-custom-summary.c
index fcbedfd..70a619b 100644
--- a/tests/libebook/client/test-client-custom-summary.c
+++ b/tests/libebook/client/test-client-custom-summary.c
@@ -627,8 +627,6 @@ main (gint argc,
                        suites[i].custom,
                        TRUE);
 
-
-
                /*********************************************
                 *             REGEX QUERIES FOLLOW          *
                 *********************************************/
@@ -637,7 +635,7 @@ main (gint argc,
                        "/Regex/Normal/.*jack.*",
                        suites[i].func,
                        e_book_query_field_test (
-                               E_CONTACT_FULL_NAME,
+                               E_CONTACT_FULL_NAME,
                                E_BOOK_QUERY_REGEX_NORMAL,
                                ".*jack.*"),
                        2,
@@ -650,7 +648,7 @@ main (gint argc,
                        "/Regex/Normal/Keypad/^[jkl5][ghi4][mno6].*",
                        suites[i].func,
                        e_book_query_field_test (
-                               E_CONTACT_FULL_NAME,
+                               E_CONTACT_FULL_NAME,
                                E_BOOK_QUERY_REGEX_NORMAL,
                                "^[jkl5][ghi4][mno6].*"),
                        3,
@@ -663,7 +661,7 @@ main (gint argc,
                        "/Regex/Normal/Fuzzy/VanityNumber/ELEPHANT",
                        suites[i].func,
                        e_book_query_field_test (
-                               E_CONTACT_TEL,
+                               E_CONTACT_TEL,
                                E_BOOK_QUERY_REGEX_NORMAL,
                                ".*[def3]"           /* E */
                                "[^\\da-z]*[jkl5]"    /* L */
@@ -683,7 +681,7 @@ main (gint argc,
                        "/Regex/Raw/.*Jack.*",
                        suites[i].func,
                        e_book_query_field_test (
-                               E_CONTACT_FULL_NAME,
+                               E_CONTACT_FULL_NAME,
                                E_BOOK_QUERY_REGEX_RAW,
                                ".*Jack.*"),
                        2,
@@ -696,7 +694,7 @@ main (gint argc,
                        "/Regex/Raw/Keypad/^[jkl5][ghi4][mno6].*",
                        suites[i].func,
                        e_book_query_field_test (
-                                E_CONTACT_FULL_NAME,
+                               E_CONTACT_FULL_NAME,
                                E_BOOK_QUERY_REGEX_RAW,
                                "^[jklJKL5][ghiGHI4][mnoMNO6].*"),
                        3,
@@ -709,7 +707,7 @@ main (gint argc,
                        "/Regex/Raw/Fuzzy/VanityNumber/ELEPHANT",
                        suites[i].func,
                        e_book_query_field_test (
-                               E_CONTACT_TEL,
+                               E_CONTACT_TEL,
                                E_BOOK_QUERY_REGEX_RAW,
                                ".*[defDEF3]"            /* E */
                                "[^\\da-z]*[jklJKL5]"    /* L */


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