[evolution/gnome-3-10] Coding style and whitespace cleanup.



commit 0de3815bdd50605ef7e94ebc6a1a608f95edb11b
Author: Matthew Barnes <mbarnes redhat com>
Date:   Sat Dec 7 09:31:10 2013 -0500

    Coding style and whitespace cleanup.

 addressbook/gui/widgets/e-contact-map-window.h     |    2 +-
 addressbook/gui/widgets/eab-contact-formatter.c    |    4 +-
 calendar/gui/comp-util.c                           |   52 +++++++++++---------
 calendar/gui/e-calendar-selector.c                 |   20 ++++----
 composer/e-msg-composer.c                          |   44 ++++++++++------
 mail/em-subscription-editor.c                      |    8 ++-
 .../evolution-cal-config-weather.c                 |   17 ++++---
 modules/calendar/e-cal-shell-view-private.c        |   10 ++--
 modules/itip-formatter/itip-view.c                 |    2 +-
 9 files changed, 90 insertions(+), 69 deletions(-)
---
diff --git a/addressbook/gui/widgets/e-contact-map-window.h b/addressbook/gui/widgets/e-contact-map-window.h
index 2db0bb6..ba4ffb8 100644
--- a/addressbook/gui/widgets/e-contact-map-window.h
+++ b/addressbook/gui/widgets/e-contact-map-window.h
@@ -63,7 +63,7 @@ struct _EContactMapWindowClass {
        GtkWindowClass parent_class;
 
        void            (*show_contact_editor)  (EContactMapWindow *window,
-                                                const gchar *contact_uid);
+                                                const gchar *contact_uid);
 };
 
 GType          e_contact_map_window_get_type   (void) G_GNUC_CONST;
diff --git a/addressbook/gui/widgets/eab-contact-formatter.c b/addressbook/gui/widgets/eab-contact-formatter.c
index 0601291..11371ac 100644
--- a/addressbook/gui/widgets/eab-contact-formatter.c
+++ b/addressbook/gui/widgets/eab-contact-formatter.c
@@ -701,8 +701,8 @@ render_personal_column (EABContactFormatter *formatter,
 
 static void
 render_other_column (EABContactFormatter *formatter,
-                    EContact *contact,
-                    GString *buffer)
+                     EContact *contact,
+                     GString *buffer)
 {
        GString *accum = g_string_new ("");
 
diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c
index b2569d5..e725375 100644
--- a/calendar/gui/comp-util.c
+++ b/calendar/gui/comp-util.c
@@ -852,7 +852,7 @@ async_context_free (AsyncContext *async_context)
 
 static void
 add_timezone_to_cal_cb (icalparameter *param,
-                       gpointer data)
+                        gpointer data)
 {
        struct ForeachTzidData *ftd = data;
        icaltimezone *tz = NULL;
@@ -882,8 +882,8 @@ add_timezone_to_cal_cb (icalparameter *param,
 /* Helper for cal_comp_transfer_item_to() */
 static void
 cal_comp_transfer_item_to_thread (GSimpleAsyncResult *simple,
-                                 GObject *source_object,
-                                 GCancellable *cancellable)
+                                  GObject *source_object,
+                                  GCancellable *cancellable)
 {
        AsyncContext *async_context;
        GError *local_error = NULL;
@@ -903,12 +903,12 @@ cal_comp_transfer_item_to_thread (GSimpleAsyncResult *simple,
 
 void
 cal_comp_transfer_item_to (ECalClient *src_client,
-                          ECalClient *dest_client,
-                          icalcomponent *icalcomp_vcal,
-                          gboolean do_copy,
-                          GCancellable *cancellable,
-                          GAsyncReadyCallback callback,
-                          gpointer user_data)
+                           ECalClient *dest_client,
+                           icalcomponent *icalcomp_vcal,
+                           gboolean do_copy,
+                           GCancellable *cancellable,
+                           GAsyncReadyCallback callback,
+                           gpointer user_data)
 {
        GSimpleAsyncResult *simple;
        AsyncContext *async_context;
@@ -940,8 +940,8 @@ cal_comp_transfer_item_to (ECalClient *src_client,
 
 gboolean
 cal_comp_transfer_item_to_finish (ECalClient *client,
-                                 GAsyncResult *result,
-                                 GError **error)
+                                  GAsyncResult *result,
+                                  GError **error)
 {
        GSimpleAsyncResult *simple;
 
@@ -959,11 +959,11 @@ cal_comp_transfer_item_to_finish (ECalClient *client,
 
 gboolean
 cal_comp_transfer_item_to_sync (ECalClient *src_client,
-                               ECalClient *dest_client,
-                               icalcomponent *icalcomp_vcal,
-                               gboolean do_copy,
-                               GCancellable *cancellable,
-                               GError **error)
+                                ECalClient *dest_client,
+                                icalcomponent *icalcomp_vcal,
+                                gboolean do_copy,
+                                GCancellable *cancellable,
+                                GError **error)
 {
        icalcomponent *icalcomp;
        icalcomponent *icalcomp_event, *subcomp;
@@ -1051,7 +1051,7 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
 
                if (e_cal_util_component_is_instance (icalcomp_event)) {
                        GSList *ecalcomps = NULL, *eiter;
-                       ECalComponent *comp ;
+                       ECalComponent *comp;
 
                        success = e_cal_client_get_objects_for_uid_sync (src_client, uid, &ecalcomps, 
cancellable, error);
                        if (!success)
@@ -1066,7 +1066,8 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                                for (eiter = ecalcomps; eiter; eiter = g_slist_next (eiter)) {
                                        comp = eiter->data;
 
-                                       icalcomponent_add_component (icalcomp,
+                                       icalcomponent_add_component (
+                                               icalcomp,
                                                icalcomponent_new_clone (e_cal_component_get_icalcomponent 
(comp)));
                                }
                        }
@@ -1081,7 +1082,7 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                        new_uid = e_cal_component_gen_uid ();
                        if (icalcomponent_isa (icalcomp) == ICAL_VCALENDAR_COMPONENT) {
                                /* in case of a vCalendar, the component might have detached instances,
-                                  thus change the UID on all of the subcomponents of it */
+                                * thus change the UID on all of the subcomponents of it */
                                for (subcomp = icalcomponent_get_first_component (icalcomp, icalcomp_kind);
                                     subcomp;
                                     subcomp = icalcomponent_get_next_component (icalcomp, icalcomp_kind)) {
@@ -1102,7 +1103,7 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
 
                if (icalcomponent_isa (icalcomp) == ICAL_VCALENDAR_COMPONENT) {
                        /* in case of a vCalendar, the component might have detached instances,
-                          thus check timezones on all of the subcomponents of it */
+                        * thus check timezones on all of the subcomponents of it */
                        for (subcomp = icalcomponent_get_first_component (icalcomp, icalcomp_kind);
                             subcomp && ftd.success;
                             subcomp = icalcomponent_get_next_component (icalcomp, icalcomp_kind)) {
@@ -1121,13 +1122,14 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                        gboolean did_add = FALSE;
 
                        /* in case of a vCalendar, the component might have detached instances,
-                          thus add the master object first, and then all of the subcomponents of it */
+                        * thus add the master object first, and then all of the subcomponents of it */
                        for (subcomp = icalcomponent_get_first_component (icalcomp, icalcomp_kind);
                             subcomp && !did_add;
                             subcomp = icalcomponent_get_next_component (icalcomp, icalcomp_kind)) {
                                if (icaltime_is_null_time (icalcomponent_get_recurrenceid (subcomp))) {
                                        did_add = TRUE;
-                                       success = e_cal_client_create_object_sync (dest_client, subcomp,
+                                       success = e_cal_client_create_object_sync (
+                                               dest_client, subcomp,
                                                &new_uid, cancellable, error);
                                        g_free (new_uid);
                                }
@@ -1144,12 +1146,14 @@ cal_comp_transfer_item_to_sync (ECalClient *src_client,
                             subcomp = icalcomponent_get_next_component (icalcomp, icalcomp_kind)) {
                                if (!icaltime_is_null_time (icalcomponent_get_recurrenceid (subcomp))) {
                                        if (did_add) {
-                                               success = e_cal_client_modify_object_sync (dest_client, 
subcomp,
+                                               success = e_cal_client_modify_object_sync (
+                                                       dest_client, subcomp,
                                                        CALOBJ_MOD_THIS, cancellable, error);
                                        } else {
                                                /* just in case there are only detached instances and no 
master object */
                                                did_add = TRUE;
-                                               success = e_cal_client_create_object_sync (dest_client, 
subcomp,
+                                               success = e_cal_client_create_object_sync (
+                                                       dest_client, subcomp,
                                                        &new_uid, cancellable, error);
                                                g_free (new_uid);
                                        }
diff --git a/calendar/gui/e-calendar-selector.c b/calendar/gui/e-calendar-selector.c
index c134d29..5244d93 100644
--- a/calendar/gui/e-calendar-selector.c
+++ b/calendar/gui/e-calendar-selector.c
@@ -49,10 +49,10 @@ enum {
 
 static void
 cal_transferring_update_alert (ECalendarSelector *calendar_selector,
-                              EShellView *shell_view,
-                              const gchar *domain,
-                              const gchar *calendar,
-                              const gchar *message)
+                               EShellView *shell_view,
+                               const gchar *domain,
+                               const gchar *calendar,
+                               const gchar *message)
 {
        ECalendarSelectorPrivate *priv;
        EShellContent *shell_content;
@@ -98,8 +98,8 @@ typedef struct _TransferItemToData {
 
 static void
 transfer_item_to_cb (GObject *source_object,
-                    GAsyncResult *result,
-                    gpointer user_data)
+                     GAsyncResult *result,
+                     gpointer user_data)
 {
        TransferItemToData *titd = user_data;
        GError *error = NULL;
@@ -130,8 +130,8 @@ transfer_item_to_cb (GObject *source_object,
 
 static void
 destination_client_connect_cb (GObject *source_object,
-                              GAsyncResult *result,
-                              gpointer user_data)
+                               GAsyncResult *result,
+                               gpointer user_data)
 {
        EClient *client;
        TransferItemToData *titd = user_data;
@@ -181,8 +181,8 @@ exit:
 
 static void
 source_client_connect_cb (GObject *source_object,
-                         GAsyncResult *result,
-                         gpointer user_data)
+                          GAsyncResult *result,
+                          gpointer user_data)
 {
        EClient *client;
        TransferItemToData *titd = user_data;
diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c
index 2a03f33..622cc5c 100644
--- a/composer/e-msg-composer.c
+++ b/composer/e-msg-composer.c
@@ -1120,17 +1120,19 @@ composer_build_message (EMsgComposer *composer,
        context->session = e_msg_composer_ref_session (composer);
        context->from = e_msg_composer_get_from (composer);
 
-       if ((flags & COMPOSER_FLAG_PGP_SIGN) != 0 && (flags & COMPOSER_FLAG_DRAFT) == 0)
-               context->pgp_sign = TRUE;
+       if ((flags & COMPOSER_FLAG_DRAFT) == 0) {
+               if ((flags & COMPOSER_FLAG_PGP_SIGN) != 0)
+                       context->pgp_sign = TRUE;
 
-       if ((flags & COMPOSER_FLAG_PGP_ENCRYPT) != 0 && (flags & COMPOSER_FLAG_DRAFT) == 0)
-               context->pgp_encrypt = TRUE;
+               if ((flags & COMPOSER_FLAG_PGP_ENCRYPT) != 0)
+                       context->pgp_encrypt = TRUE;
 
-       if ((flags & COMPOSER_FLAG_SMIME_SIGN) != 0 && (flags & COMPOSER_FLAG_DRAFT) == 0)
-               context->smime_sign = TRUE;
+               if ((flags & COMPOSER_FLAG_SMIME_SIGN) != 0)
+                       context->smime_sign = TRUE;
 
-       if ((flags & COMPOSER_FLAG_SMIME_ENCRYPT) != 0 && (flags & COMPOSER_FLAG_DRAFT) == 0)
-               context->smime_encrypt = TRUE;
+               if ((flags & COMPOSER_FLAG_SMIME_ENCRYPT) != 0)
+                       context->smime_encrypt = TRUE;
+       }
 
        context->need_thread =
                context->pgp_sign || context->pgp_encrypt ||
@@ -1572,7 +1574,6 @@ msg_composer_subject_changed_cb (EMsgComposer *composer)
 static void
 msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
 {
-       EMsgComposerPrivate *p = composer->priv;
        EMailSignatureComboBox *combo_box;
        ESourceMailComposition *mc;
        ESourceOpenPGP *pgp;
@@ -1580,6 +1581,7 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
        EComposerHeaderTable *table;
        GtkToggleAction *action;
        ESource *source;
+       gboolean active;
        gboolean can_sign;
        gboolean pgp_sign;
        gboolean smime_sign;
@@ -1610,21 +1612,29 @@ msg_composer_mail_identity_changed_cb (EMsgComposer *composer)
        smime_encrypt = e_source_smime_get_encrypt_by_default (smime);
 
        can_sign =
-               (p->mime_type == NULL) ||
+               (composer->priv->mime_type == NULL) ||
                e_source_mail_composition_get_sign_imip (mc) ||
-               (g_ascii_strncasecmp (p->mime_type, "text/calendar", 13) != 0);
+               (g_ascii_strncasecmp (
+                       composer->priv->mime_type,
+                       "text/calendar", 13) != 0);
 
        action = GTK_TOGGLE_ACTION (ACTION (PGP_SIGN));
-       gtk_toggle_action_set_active (action, (can_sign && pgp_sign) ||
-               (p->is_from_message && gtk_toggle_action_get_active (action)));
+       active = gtk_toggle_action_get_active (action);
+       active &= composer->priv->is_from_message;
+       active |= (can_sign && pgp_sign);
+       gtk_toggle_action_set_active (action, active);
 
        action = GTK_TOGGLE_ACTION (ACTION (SMIME_SIGN));
-       gtk_toggle_action_set_active (action, (can_sign && smime_sign) ||
-               (p->is_from_message && gtk_toggle_action_get_active (action)));
+       active = gtk_toggle_action_get_active (action);
+       active &= composer->priv->is_from_message;
+       active |= (can_sign && smime_sign);
+       gtk_toggle_action_set_active (action, active);
 
        action = GTK_TOGGLE_ACTION (ACTION (SMIME_ENCRYPT));
-       gtk_toggle_action_set_active (action, smime_encrypt ||
-               (p->is_from_message && gtk_toggle_action_get_active (action)));
+       active = gtk_toggle_action_get_active (action);
+       active &= composer->priv->is_from_message;
+       active |= smime_encrypt;
+       gtk_toggle_action_set_active (action, active);
 
        combo_box = e_composer_header_table_get_signature_combo_box (table);
        e_mail_signature_combo_box_set_identity_uid (combo_box, uid);
diff --git a/mail/em-subscription-editor.c b/mail/em-subscription-editor.c
index e210652..6d44e53 100644
--- a/mail/em-subscription-editor.c
+++ b/mail/em-subscription-editor.c
@@ -1603,8 +1603,12 @@ subscription_editor_constructed (GObject *object)
        /* Chain up to parent's constructed() method. */
        G_OBJECT_CLASS (em_subscription_editor_parent_class)->constructed (object);
 
-       g_signal_connect (editor, "delete-event", G_CALLBACK (subscription_editor_delete_event_cb), NULL);
-       g_signal_connect (editor, "response", G_CALLBACK (subscription_editor_response_cb), NULL);
+       g_signal_connect (
+               editor, "delete-event",
+               G_CALLBACK (subscription_editor_delete_event_cb), NULL);
+       g_signal_connect (
+               editor, "response",
+               G_CALLBACK (subscription_editor_response_cb), NULL);
 }
 
 static void
diff --git a/modules/cal-config-weather/evolution-cal-config-weather.c 
b/modules/cal-config-weather/evolution-cal-config-weather.c
index 5bdd6f9..0b523b3 100644
--- a/modules/cal-config-weather/evolution-cal-config-weather.c
+++ b/modules/cal-config-weather/evolution-cal-config-weather.c
@@ -75,7 +75,8 @@ cal_config_weather_location_to_string (GBinding *binding,
 
        if (location) {
                gdouble latitude, longitude;
-               gchar lat_str[G_ASCII_DTOSTR_BUF_SIZE + 1], lon_str[G_ASCII_DTOSTR_BUF_SIZE + 1];
+               gchar lat_str[G_ASCII_DTOSTR_BUF_SIZE + 1];
+               gchar lon_str[G_ASCII_DTOSTR_BUF_SIZE + 1];
 
                gweather_location_get_coords (location, &latitude, &longitude);
 
@@ -92,13 +93,13 @@ cal_config_weather_location_to_string (GBinding *binding,
 
 static GWeatherLocation *
 cal_config_weather_find_location_by_coords (GWeatherLocation *start,
-                                           gdouble latitude,
-                                           gdouble longitude)
+                                            gdouble latitude,
+                                            gdouble longitude)
 {
        GWeatherLocation *location, **children;
        gint ii;
 
-       if (!start)
+       if (start == NULL)
                return NULL;
 
        location = start;
@@ -113,8 +114,9 @@ cal_config_weather_find_location_by_coords (GWeatherLocation *start,
 
        children = gweather_location_get_children (location);
        for (ii = 0; children[ii]; ii++) {
-               location = cal_config_weather_find_location_by_coords (children[ii], latitude, longitude);
-               if (location)
+               location = cal_config_weather_find_location_by_coords (
+                       children[ii], latitude, longitude);
+               if (location != NULL)
                        return location;
        }
 
@@ -150,7 +152,8 @@ cal_config_weather_string_to_location (GBinding *binding,
        latitude = g_ascii_strtod (tokens[0], NULL);
        longitude = g_ascii_strtod (tokens[1], NULL);
 
-       match = cal_config_weather_find_location_by_coords (world, latitude, longitude);
+       match = cal_config_weather_find_location_by_coords (
+               world, latitude, longitude);
 
        g_value_set_boxed (target_value, match);
 
diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c
index c03b3e3..581ef16 100644
--- a/modules/calendar/e-cal-shell-view-private.c
+++ b/modules/calendar/e-cal-shell-view-private.c
@@ -995,9 +995,9 @@ e_cal_shell_view_set_status_message (ECalShellView *cal_shell_view,
 
 static void
 cal_transferring_update_alert (ECalShellView *cal_shell_view,
-                              const gchar *domain,
-                              const gchar *calendar,
-                              const gchar *message)
+                               const gchar *domain,
+                               const gchar *calendar,
+                               const gchar *message)
 {
        ECalShellViewPrivate *priv;
        EShellContent *shell_content;
@@ -1039,8 +1039,8 @@ typedef struct _TransferItemToData {
 
 static void
 transfer_item_to_cb (GObject *src_object,
-                    GAsyncResult *result,
-                    gpointer user_data)
+                     GAsyncResult *result,
+                     gpointer user_data)
 {
        TransferItemToData *titd = user_data;
        GError *error = NULL;
diff --git a/modules/itip-formatter/itip-view.c b/modules/itip-formatter/itip-view.c
index 73937d6..4b743bc 100644
--- a/modules/itip-formatter/itip-view.c
+++ b/modules/itip-formatter/itip-view.c
@@ -914,7 +914,7 @@ append_info_item_row (ItipView *view,
 
        id = g_strdup_printf ("%s_row_%d", table_id, item->id);
 #if WEBKIT_CHECK_VERSION(2,2,0)  /* XXX should really be (2,1,something) */
-       webkit_dom_element_set_id (WEBKIT_DOM_ELEMENT(row), id);
+       webkit_dom_element_set_id (WEBKIT_DOM_ELEMENT (row), id);
 #else
        webkit_dom_html_element_set_id (row, id);
 #endif


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