diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2009-12-26 13:26:18 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2009-12-26 13:26:18 +0800 |
commit | bd31f49bac99f21656dc7d0352d5b3f7385f71b2 (patch) | |
tree | b693ad7ec135bd8031458611b5ec485abd866463 | |
parent | 5f83c587b2da0b9578117796253b7726e98748cc (diff) | |
download | gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.gz gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.tar.zst gsoc2013-evolution-bd31f49bac99f21656dc7d0352d5b3f7385f71b2.zip |
Coding style and whitespace cleanup.
38 files changed, 227 insertions, 105 deletions
diff --git a/addressbook/gui/contact-editor/eab-editor.c b/addressbook/gui/contact-editor/eab-editor.c index 554db9aa7b..d6946e8341 100644 --- a/addressbook/gui/contact-editor/eab-editor.c +++ b/addressbook/gui/contact-editor/eab-editor.c @@ -351,9 +351,8 @@ eab_editor_get_window (EABEditor *editor) } /* This function prompts for saving if editor conents are in changed state and - save or discards or cancels(just returns with out doing anything) according to user input. - Editor gets destoryed in case of save and discard case. - */ + save or discards or cancels(just returns with out doing anything) according + to user input. Editor gets destroyed in case of save and discard case. */ gboolean eab_editor_prompt_to_save_changes (EABEditor *editor, GtkWindow *window) diff --git a/addressbook/gui/contact-list-editor/e-contact-list-editor.c b/addressbook/gui/contact-list-editor/e-contact-list-editor.c index 4c5b2ba8f8..18495d59c9 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -101,7 +101,10 @@ struct _EContactListEditorPrivate { GtkBuilder *builder; GtkTreeModel *model; ENameSelector *name_selector; - ENameSelectorEntry *email_entry; /* it's kept here, because the builder has an old widget, which was changed with this one */ + + /* This is kept here because the builder has an old widget + * which was changed with this one. */ + ENameSelectorEntry *email_entry; /* Whether we are editing a new contact or an existing one. */ guint is_new_list : 1; @@ -866,7 +869,7 @@ contact_list_editor_tree_view_key_press_event_cb (GtkWidget *widget, return FALSE; } -/*********************** GtkBuilder Custom Widgets Functions ***********************/ +/******************** GtkBuilder Custom Widgets Functions ********************/ static gpointer contact_editor_fudge_new (EBook *book, @@ -938,7 +941,9 @@ setup_custom_widgets (EContactListEditor *editor) name_selector_entry = e_name_selector_peek_section_entry ( name_selector, "Members"); - gtk_widget_set_name (GTK_WIDGET (name_selector_entry), gtk_widget_get_name (old)); + gtk_widget_set_name ( + GTK_WIDGET (name_selector_entry), + gtk_widget_get_name (old)); parent = gtk_widget_get_parent (old); gtk_container_child_get (GTK_CONTAINER (parent), old, @@ -955,9 +960,12 @@ setup_custom_widgets (EContactListEditor *editor) /* only hide it... */ gtk_widget_hide (old); - /* ... and place the new name selector to the exact place as is the old one in UI file */ + /* ... and place the new name selector to the + * exact place as is the old one in UI file */ gtk_widget_show (GTK_WIDGET (name_selector_entry)); - gtk_table_attach (GTK_TABLE (parent), GTK_WIDGET (name_selector_entry), la, ra, ta, ba, xo, yo, xp, yp); + gtk_table_attach ( + GTK_TABLE (parent), GTK_WIDGET (name_selector_entry), + la, ra, ta, ba, xo, yo, xp, yp); priv->email_entry = name_selector_entry; e_name_selector_entry_set_contact_editor_func ( diff --git a/calendar/gui/e-cal-component-preview.c b/calendar/gui/e-cal-component-preview.c index 6720156911..77fa25c995 100644 --- a/calendar/gui/e-cal-component-preview.c +++ b/calendar/gui/e-cal-component-preview.c @@ -72,7 +72,9 @@ clear_comp_info (ECalComponentPreview *preview) /* Stores information about actually shown component and returns whether component in the preview changed */ static gboolean -update_comp_info (ECalComponentPreview *preview, ECal *ecal, ECalComponent *comp) +update_comp_info (ECalComponentPreview *preview, + ECal *ecal, + ECalComponent *comp) { ECalComponentPreviewPrivate *priv; gboolean changed; diff --git a/calendar/gui/e-day-view-layout.c b/calendar/gui/e-day-view-layout.c index 51ced181b7..c11c4f6738 100644 --- a/calendar/gui/e-day-view-layout.c +++ b/calendar/gui/e-day-view-layout.c @@ -256,7 +256,9 @@ e_day_view_layout_day_event (EDayViewEvent *event, for (row = start_row; row <= end_row; row++) { /* resize the array if necessary */ if (e_bit_array_bit_count (grid [row]) <= free_col) - e_bit_array_insert (grid [row], e_bit_array_bit_count (grid [row]), free_col - e_bit_array_bit_count (grid [row]) + 1); + e_bit_array_insert ( + grid [row], e_bit_array_bit_count (grid [row]), + free_col - e_bit_array_bit_count (grid [row]) + 1); e_bit_array_change_one_row (grid [row], free_col, TRUE); cols_per_row[row]++; diff --git a/calendar/gui/e-day-view.h b/calendar/gui/e-day-view.h index 6729186b21..aee8be0683 100644 --- a/calendar/gui/e-day-view.h +++ b/calendar/gui/e-day-view.h @@ -45,7 +45,8 @@ G_BEGIN_DECLS of a normal event. */ #define E_DAY_VIEW_LONG_EVENT E_DAY_VIEW_MAX_DAYS -/* The maximum number of columns of appointments within a day in multi-day view. */ +/* The maximum number of columns of appointments within a day in multi-day + view. */ #define E_DAY_VIEW_MULTI_DAY_MAX_COLUMNS 6 /* minimum width of the event in one-day view in pixels */ @@ -533,7 +534,8 @@ gint e_day_view_get_work_day_end_minute (EDayView *day_view); void e_day_view_set_work_day_end_minute (EDayView *day_view, gint work_day_end_minute); -/* Whether we display the Marcus Bains Line in the main canvas and time canvas. */ +/* Whether we display the Marcus Bains Line in the main canvas and time + canvas. */ void e_day_view_marcus_bains_update (EDayView *day_view); gboolean e_day_view_marcus_bains_get_show_line(EDayView *day_view); void e_day_view_marcus_bains_set_show_line(EDayView *day_view, diff --git a/calendar/gui/print.c b/calendar/gui/print.c index ef511e5913..010a60423b 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -1339,7 +1339,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, /* Right align - 10 comes from print_day_long_event too */ x = right - gdk_pixbuf_get_width (pixbuf) * 0.5 - 10; - /* Placing '...' over the last all day event entry printed. '-1 -1' comes + /* Placing '...' over the last all day event entry printed. '-1 -1' comes from print_long_day_event (top/bottom spacing in each cell) */ y = top + LONG_DAY_EVENTS_TOP_SPACING + DAY_VIEW_ROW_HEIGHT * (i - 1) + (DAY_VIEW_ROW_HEIGHT - 1 - 1) * 0.5; @@ -1358,7 +1358,7 @@ print_day_details (GtkPrintContext *context, GnomeCalendar *gcal, time_t whence, cairo_set_source_rgb (cr, 0, 0, 0); print_border (context, left, right, - top, + top, top + rows_in_top_display * DAY_VIEW_ROW_HEIGHT + LONG_DAY_EVENTS_TOP_SPACING + LONG_DAY_EVENTS_BOTTOM_SPACING, 1.0, -1.0); diff --git a/composer/e-composer-header-table.c b/composer/e-composer-header-table.c index 3486ab6f64..b9602e64fc 100644 --- a/composer/e-composer-header-table.c +++ b/composer/e-composer-header-table.c @@ -512,23 +512,34 @@ composer_header_table_constructor (GType type, 0, 1, ii, ii + 1, GTK_FILL, GTK_FILL, 0, 3); if (composer_lite && ii == E_COMPOSER_HEADER_TO) { GtkWidget *box = gtk_hbox_new (FALSE, 0); - g_object_set_data ((GObject *)priv->headers[ii]->input_widget, "parent", object); - gtk_box_pack_start ((GtkBox *)box, priv->headers[ii]->input_widget, TRUE, TRUE, 3); - gtk_box_pack_start ((GtkBox *)box, (GtkWidget *)priv->actions_container, FALSE, FALSE, 0); + g_object_set_data ( + G_OBJECT (priv->headers[ii]->input_widget), + "parent", object); + gtk_box_pack_start ( + GTK_BOX (box), priv->headers[ii]->input_widget, + TRUE, TRUE, 3); + gtk_box_pack_start ( + GTK_BOX (box), + GTK_WIDGET (priv->actions_container), + FALSE, FALSE, 0); gtk_widget_show (box); gtk_table_attach ( - GTK_TABLE (object), box, - 1, 4, ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); + GTK_TABLE (object), box, 1, 4, ii, ii + 1, + GTK_FILL | GTK_EXPAND, 0, 0, 3); } else { gtk_table_attach ( - GTK_TABLE (object), priv->headers[ii]->input_widget, - 1, 4, ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); + GTK_TABLE (object), + priv->headers[ii]->input_widget, 1, 4, + ii, ii + 1, GTK_FILL | GTK_EXPAND, 0, 0, 3); } if (composer_lite && priv->headers[ii]->action_widget) { - /* Pack the widgets to the end. Helps formatting when hiding the From field */ - gtk_box_pack_end ((GtkBox *)priv->actions_container, priv->headers[ii]->action_widget, - FALSE, FALSE, 6); + /* Pack the widgets to the end. Helps formatting + * when hiding the From field. */ + gtk_box_pack_end ( + GTK_BOX (priv->actions_container), + priv->headers[ii]->action_widget, + FALSE, FALSE, 6); } } diff --git a/e-util/e-file-utils.c b/e-util/e-file-utils.c index 015da072f3..5c3aab4f1e 100644 --- a/e-util/e-file-utils.c +++ b/e-util/e-file-utils.c @@ -27,7 +27,8 @@ #include <sys/stat.h> #include <unistd.h> -/* This isn't as portable as, say, the stuff in GNU coreutils. But I care not for OSF1. */ +/* This isn't as portable as, say, the stuff in GNU coreutils. + * But I care not for OSF1. */ #ifdef HAVE_STATVFS # ifdef HAVE_SYS_STATVFS_H # include <sys/statvfs.h> diff --git a/e-util/e-import.c b/e-util/e-import.c index 13e09d4dba..e0bd5c6085 100644 --- a/e-util/e-import.c +++ b/e-util/e-import.c @@ -365,8 +365,9 @@ e_import_target_new_uri (EImport *import, const gchar *uri_src, const gchar *uri_dst) { - EImportTargetURI *t = e_import_target_new (import, E_IMPORT_TARGET_URI, sizeof (*t)); + EImportTargetURI *t; + t = e_import_target_new (import, E_IMPORT_TARGET_URI, sizeof (*t)); t->uri_src = g_strdup (uri_src); t->uri_dest = g_strdup (uri_dst); @@ -542,8 +543,11 @@ emph_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) ihook = emph_construct_importer (eph, node); if (ihook) { - e_import_class_add_importer (class, &ihook->importer, eih_free_importer, eph); - emph->importers = g_slist_append (emph->importers, ihook); + e_import_class_add_importer ( + class, &ihook->importer, + eih_free_importer, eph); + emph->importers = g_slist_append ( + emph->importers, ihook); } } node = node->next; diff --git a/e-util/e-signature.c b/e-util/e-signature.c index 2d8da48c12..ea6636c055 100644 --- a/e-util/e-signature.c +++ b/e-util/e-signature.c @@ -542,9 +542,13 @@ e_signature_to_xml (ESignature *signature) string = e_signature_get_filename (signature); if (string != NULL) { - node = xmlNewTextChild (root, NULL, (xmlChar *) "filename", (xmlChar *) string); + node = xmlNewTextChild ( + root, NULL, (xmlChar *) "filename", + (xmlChar *) string); if (e_signature_get_is_script (signature)) - xmlSetProp (node, (xmlChar *) "script", (xmlChar *) "true"); + xmlSetProp ( + node, (xmlChar *) "script", + (xmlChar *) "true"); } } else { /* this is to make Evolution-1.4 and older 1.5 versions happy */ diff --git a/filter/e-filter-input.c b/filter/e-filter-input.c index f8315d99e3..79d9fffb73 100644 --- a/filter/e-filter-input.c +++ b/filter/e-filter-input.c @@ -84,7 +84,10 @@ filter_input_validate (EFilterElement *element, pattern = input->values->data; - if ((regerr = regcomp (®expat, pattern, REG_EXTENDED | REG_NEWLINE | REG_ICASE))) { + regerr = regcomp ( + ®expat, pattern, + REG_EXTENDED | REG_NEWLINE | REG_ICASE); + if (regerr != 0) { if (alert) { gsize reglen; gchar *regmsg; diff --git a/filter/e-filter-part.c b/filter/e-filter-part.c index a999b8adb6..e86d2fabbc 100644 --- a/filter/e-filter-part.c +++ b/filter/e-filter-part.c @@ -190,7 +190,8 @@ e_filter_part_xml_create (EFilterPart *part, } else { g_warning ("Invalid xml format, missing/unknown input type"); } - } else if (!strcmp ((gchar *)n->name, "title") || !strcmp ((gchar *)n->name, "_title")) { + } else if (!strcmp ((gchar *)n->name, "title") || + !strcmp ((gchar *)n->name, "_title")) { if (!part->title) { str = (gchar *)xmlNodeGetContent (n); part->title = g_strdup (str); diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c index 06d9dd1f2f..65633da097 100644 --- a/mail/e-mail-backend.c +++ b/mail/e-mail-backend.c @@ -381,6 +381,7 @@ mail_backend_constructed (GObject *object) EShellBackend *shell_backend; MailFolderCache *folder_cache; const gchar *data_dir; + gboolean online; shell_backend = E_SHELL_BACKEND (object); shell = e_shell_backend_get_shell (shell_backend); @@ -388,7 +389,8 @@ mail_backend_constructed (GObject *object) /* This also initializes Camel, so it needs to happen early. */ mail_session_init (); - camel_session_set_online ((CamelSession *) session, e_shell_get_online (shell)); + online = e_shell_get_online (shell); + camel_session_set_online (CAMEL_SESSION (session), online); e_account_combo_box_set_session (session); /* XXX Don't ask... */ folder_cache = mail_folder_cache_get_default (); diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 9b7cc4d887..74b4f1a427 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -808,15 +808,22 @@ action_mail_save_as_cb (GtkAction *action, } if (!suggestion) { - /* To Translators: This is a part of a suggested file name used when saving - a message or multiple messages to an mbox format, when the first message - doesn't have a Subject. The extension ".mbox" is appended to this string, - thus it will be something like "Message.mbox" at the end. */ - suggestion = g_strconcat (ngettext ("Message", "Messages", uids->len), ".mbox", NULL); + const gchar *basename; + + /* Translators: This is a part of a suggested file name + * used when saving a message or multiple messages to an + * mbox format, when the first message doesn't have a + * Subject. The extension ".mbox" is appended to this + * string, thus it will be something like "Message.mbox" + * at the end. */ + basename = ngettext ("Message", "Messages", uids->len); + suggestion = g_strconcat (basename, ".mbox", NULL); } shell = e_shell_backend_get_shell (shell_backend); - file = e_shell_run_save_dialog (shell, title, suggestion, "*.mbox:application/mbox,message/rfc822", NULL, NULL); + file = e_shell_run_save_dialog ( + shell, title, suggestion, + "*.mbox:application/mbox,message/rfc822", NULL, NULL); if (file == NULL) { em_utils_uids_free (uids); diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 4752accc75..88912a4517 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -2477,7 +2477,7 @@ emae_receive_options_item (EConfig *ec, EConfigItem *item, GtkWidget *parent, Gt GtkWidget *box = gtk_hbox_new (FALSE, 12); gtk_widget_reparent (old, box); gtk_widget_show(box); - gtk_box_set_child_packing ((GtkBox *)box, old, TRUE, TRUE, 12, GTK_PACK_START); + gtk_box_set_child_packing ((GtkBox *)box, old, TRUE, TRUE, 12, GTK_PACK_START); gtk_box_pack_end ((GtkBox *)emae->pages[2], box, FALSE, FALSE, 0); } return old; diff --git a/mail/em-utils.c b/mail/em-utils.c index 0d64a5cbf3..63d323430f 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -2167,7 +2167,6 @@ em_utils_guess_account_with_recipients (CamelMimeMessage *message, CamelFolder * if (addr) recipients = g_list_append (recipients, (gpointer) addr); - /* finally recipient (to/cc) in account table */ account_hash = em_utils_generate_account_hash (); for (l = recipients; l == NULL; l = l->next) { diff --git a/mail/message-list.h b/mail/message-list.h index e239944783..953a444e11 100644 --- a/mail/message-list.h +++ b/mail/message-list.h @@ -196,7 +196,7 @@ GPtrArray * message_list_get_selected (MessageList *message_list); void message_list_set_selected (MessageList *message_list, GPtrArray *uids); gboolean message_list_select (MessageList *message_list, - MessageListSelectDirection direction, + MessageListSelectDirection direction, guint32 flags, guint32 mask); gboolean message_list_can_select (MessageList *message_list, diff --git a/modules/addressbook/e-book-shell-view-actions.c b/modules/addressbook/e-book-shell-view-actions.c index 5cfdbd347d..61434d4e52 100644 --- a/modules/addressbook/e-book-shell-view-actions.c +++ b/modules/addressbook/e-book-shell-view-actions.c @@ -259,7 +259,8 @@ action_address_book_save_as_cb (GtkAction *action, string = eab_suggest_filename (list); file = e_shell_run_save_dialog ( - shell, _("Save as vCard"), string, "*.vcf:text/x-vcard,text/directory", NULL, NULL); + shell, _("Save as vCard"), string, + "*.vcf:text/x-vcard,text/directory", NULL, NULL); g_free (string); if (file == NULL) @@ -522,7 +523,8 @@ action_contact_save_as_cb (GtkAction *action, string = eab_suggest_filename (list); file = e_shell_run_save_dialog ( - shell, _("Save as vCard"), string, "*.vcf:text/x-vcard,text/directory", NULL, NULL); + shell, _("Save as vCard"), string, + "*.vcf:text/x-vcard,text/directory", NULL, NULL); g_free (string); if (file == NULL) diff --git a/modules/addressbook/e-book-shell-view-private.c b/modules/addressbook/e-book-shell-view-private.c index 5b71c3c555..3e2e92a0c0 100644 --- a/modules/addressbook/e-book-shell-view-private.c +++ b/modules/addressbook/e-book-shell-view-private.c @@ -242,8 +242,12 @@ book_shell_view_activate_selected_source (EBookShellView *book_shell_view, widget = e_addressbook_view_new (shell_view, source); gtk_widget_show (widget); - /* default searching options for a new view */ - e_addressbook_view_set_search (E_ADDRESSBOOK_VIEW (widget), CONTACT_FILTER_ANY_CATEGORY, CONTACT_SEARCH_NAME_CONTAINS, NULL, NULL); + /* Default searching options for a new view. */ + e_addressbook_view_set_search ( + E_ADDRESSBOOK_VIEW (widget), + CONTACT_FILTER_ANY_CATEGORY, + CONTACT_SEARCH_NAME_CONTAINS, + NULL, NULL); e_book_shell_content_insert_view ( book_shell_content, diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 4946972efd..49b2f7f536 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -506,7 +506,8 @@ cal_shell_content_constructed (GObject *object) e_table_load_state (E_TABLE (widget), filename); g_free (filename); - e_cal_model_set_default_time_func (e_memo_table_get_model (E_MEMO_TABLE (widget)), gc_get_default_time, calendar); + e_cal_model_set_default_time_func ( + memo_model, gc_get_default_time, calendar); g_signal_connect_swapped ( widget, "open-component", diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 19c75e3e82..cfe852afed 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -529,8 +529,11 @@ cal_shell_sidebar_check_state (EShellSidebar *shell_sidebar) delete = e_source_get_property (source, "delete"); can_delete &= (delete == NULL || strcmp (delete, "no") != 0); - client = g_hash_table_lookup (cal_shell_sidebar->priv->client_table, e_source_peek_uid (source)); - refresh_supported = client && e_cal_get_refresh_supported (client); + client = g_hash_table_lookup ( + cal_shell_sidebar->priv->client_table, + e_source_peek_uid (source)); + refresh_supported = + client && e_cal_get_refresh_supported (client); } if (source != NULL) diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 117868d646..0e361c5e2c 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -170,12 +170,17 @@ action_calendar_jump_to_cb (GtkAction *action, ECalShellView *cal_shell_view) { ECalShellContent *cal_shell_content; + EShellWindow *shell_window; + EShellView *shell_view; GnomeCalendar *calendar; + shell_view = E_SHELL_VIEW (cal_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + cal_shell_content = cal_shell_view->priv->cal_shell_content; calendar = e_cal_shell_content_get_calendar (cal_shell_content); - goto_dialog (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (cal_shell_content))), calendar); + goto_dialog (GTK_WINDOW (shell_window), calendar); } static void @@ -350,14 +355,22 @@ static void action_calendar_refresh_cb (GtkAction *action, ECalShellView *cal_shell_view) { + ECalShellContent *cal_shell_content; + ECalShellSidebar *cal_shell_sidebar; + ESourceSelector *selector; ECal *client; ECalModel *model; ESource *source; gchar *uri; GError *error = NULL; - model = e_cal_shell_content_get_model (cal_shell_view->priv->cal_shell_content); - source = e_source_selector_peek_primary_selection (e_cal_shell_sidebar_get_selector (cal_shell_view->priv->cal_shell_sidebar)); + cal_shell_content = cal_shell_view->priv->cal_shell_content; + cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar; + + model = e_cal_shell_content_get_model (cal_shell_content); + selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar); + + source = e_source_selector_peek_primary_selection (selector); g_return_if_fail (E_IS_SOURCE (source)); uri = e_source_get_uri (source); @@ -370,7 +383,10 @@ action_calendar_refresh_cb (GtkAction *action, g_return_if_fail (e_cal_get_refresh_supported (client)); if (!e_cal_refresh (client, &error) && error) { - g_warning ("%s: Failed to refresh '%s', %s\n", G_STRFUNC, e_source_peek_name (source), error->message); + g_warning ( + "%s: Failed to refresh '%s', %s\n", + G_STRFUNC, e_source_peek_name (source), + error->message); g_error_free (error); } } @@ -1071,10 +1087,12 @@ action_event_save_as_cb (GtkAction *action, client = event->comp_data->client; icalcomp = event->comp_data->icalcomp; - /* To Translators: Default filename part saving an event to a file when no summary is filed, the '.ics' extension is concatenated to it */ + /* Translators: Default filename part saving an event to a file when + * no summary is filed, the '.ics' extension is concatenated to it. */ string = icalcomp_suggest_filename (icalcomp, _("event")); file = e_shell_run_save_dialog ( - shell, _("Save as iCalendar"), string, "*.ics:text/calendar", NULL, NULL); + shell, _("Save as iCalendar"), string, + "*.ics:text/calendar", NULL, NULL); g_free (string); if (file == NULL) return; @@ -1134,16 +1152,25 @@ edit_event_as (ECalShellView *cal_shell_view, gboolean as_meeting) /* do it on a copy, as user can cancel changes */ icalcomp = icalcomponent_new_clone (icalcomp); - #define remove_all(_kind) \ - while (prop = icalcomponent_get_first_property (icalcomp, _kind), prop != NULL) { \ - icalcomponent_remove_property (icalcomp, prop); \ - icalproperty_free (prop); \ - } + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ATTENDEE_PROPERTY); + while (prop != NULL) { + icalcomponent_remove_property (icalcomp, prop); + icalproperty_free (prop); + + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ATTENDEE_PROPERTY); + } - remove_all (ICAL_ATTENDEE_PROPERTY); - remove_all (ICAL_ORGANIZER_PROPERTY); + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ORGANIZER_PROPERTY); + while (prop != NULL) { + icalcomponent_remove_property (icalcomp, prop); + icalproperty_free (prop); - #undef remove_all + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ORGANIZER_PROPERTY); + } } e_calendar_view_edit_appointment ( diff --git a/modules/calendar/e-cal-shell-view-memopad.c b/modules/calendar/e-cal-shell-view-memopad.c index a65bf82cdd..e34dac9adb 100644 --- a/modules/calendar/e-cal-shell-view-memopad.c +++ b/modules/calendar/e-cal-shell-view-memopad.c @@ -219,10 +219,12 @@ action_calendar_memopad_save_as_cb (GtkAction *action, comp_data = list->data; g_slist_free (list); - /* To Translators: Default filename part saving a memo to a file when no summary is filed, the '.ics' extension is concatenated to it */ + /* Translators: Default filename part saving a memo to a file when + * no summary is filed, the '.ics' extension is concatenated to it. */ string = icalcomp_suggest_filename (comp_data->icalcomp, _("memo")); file = e_shell_run_save_dialog ( - shell, _("Save as iCalendar"), string, "*.ics:text/calendar", NULL, NULL); + shell, _("Save as iCalendar"), string, + "*.ics:text/calendar", NULL, NULL); g_free (string); if (file == NULL) return; diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 46cb825d21..ddf9dd7204 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -868,7 +868,8 @@ e_cal_shell_view_update_sidebar (ECalShellView *cal_shell_view) view_type = gnome_calendar_get_view (calendar); calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - if (!e_calendar_view_get_visible_time_range (calendar_view, &start_time, &end_time)) { + if (!e_calendar_view_get_visible_time_range ( + calendar_view, &start_time, &end_time)) { e_shell_sidebar_set_secondary_text (shell_sidebar, ""); return; } diff --git a/modules/calendar/e-cal-shell-view-taskpad.c b/modules/calendar/e-cal-shell-view-taskpad.c index f73d5839d1..33b21aeb55 100644 --- a/modules/calendar/e-cal-shell-view-taskpad.c +++ b/modules/calendar/e-cal-shell-view-taskpad.c @@ -287,10 +287,12 @@ action_calendar_taskpad_save_as_cb (GtkAction *action, comp_data = list->data; g_slist_free (list); - /* To Translators: Default filename part saving a task to a file when no summary is filed, the '.ics' extension is concatenated to it */ + /* Translators: Default filename part saving a task to a file when + * no summary is filed, the '.ics' extension is concatenated to it. */ string = icalcomp_suggest_filename (comp_data->icalcomp, _("task")); file = e_shell_run_save_dialog ( - shell, _("Save as iCalendar"), string, "*.ics:text/calendar", NULL, NULL); + shell, _("Save as iCalendar"), string, + "*.ics:text/calendar", NULL, NULL); g_free (string); if (file == NULL) return; diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index fb8ee9b04a..46ff03672a 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -474,8 +474,11 @@ memo_shell_sidebar_check_state (EShellSidebar *shell_sidebar) delete = e_source_get_property (source, "delete"); can_delete &= (delete == NULL || strcmp (delete, "no") != 0); - client = g_hash_table_lookup (memo_shell_sidebar->priv->client_table, e_source_peek_uid (source)); - refresh_supported = client && e_cal_get_refresh_supported (client); + client = g_hash_table_lookup ( + memo_shell_sidebar->priv->client_table, + e_source_peek_uid (source)); + refresh_supported = + client && e_cal_get_refresh_supported (client); } if (source != NULL) diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index 532e8f696b..eb5da18ffd 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -472,8 +472,11 @@ task_shell_sidebar_check_state (EShellSidebar *shell_sidebar) delete = e_source_get_property (source, "delete"); can_delete &= (delete == NULL || strcmp (delete, "no") != 0); - client = g_hash_table_lookup (task_shell_sidebar->priv->client_table, e_source_peek_uid (source)); - refresh_supported = client && e_cal_get_refresh_supported (client); + client = g_hash_table_lookup ( + task_shell_sidebar->priv->client_table, + e_source_peek_uid (source)); + refresh_supported = + client && e_cal_get_refresh_supported (client); } if (source != NULL) diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 067bd48370..3d14678f7b 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -282,16 +282,24 @@ action_task_list_properties_cb (GtkAction *action, static void action_task_list_refresh_cb (GtkAction *action, - ETaskShellView *task_shell_view) + ETaskShellView *task_shell_view) { + ETaskShellContent *task_shell_content; + ETaskShellSidebar *task_shell_sidebar; + ESourceSelector *selector; ECal *client; ECalModel *model; ESource *source; gchar *uri; GError *error = NULL; - model = e_task_shell_content_get_task_model (task_shell_view->priv->task_shell_content); - source = e_source_selector_peek_primary_selection (e_task_shell_sidebar_get_selector (task_shell_view->priv->task_shell_sidebar)); + task_shell_content = task_shell_view->priv->task_shell_content; + task_shell_sidebar = task_shell_view->priv->task_shell_sidebar; + + model = e_task_shell_content_get_task_model (task_shell_content); + selector = e_task_shell_sidebar_get_selector (task_shell_sidebar); + + source = e_source_selector_peek_primary_selection (selector); g_return_if_fail (E_IS_SOURCE (source)); uri = e_source_get_uri (source); @@ -304,7 +312,10 @@ action_task_list_refresh_cb (GtkAction *action, g_return_if_fail (e_cal_get_refresh_supported (client)); if (!e_cal_refresh (client, &error) && error) { - g_warning ("%s: Failed to refresh '%s', %s\n", G_STRFUNC, e_source_peek_name (source), error->message); + g_warning ( + "%s: Failed to refresh '%s', %s\n", + G_STRFUNC, e_source_peek_name (source), + error->message); g_error_free (error); } } @@ -608,10 +619,12 @@ action_task_save_as_cb (GtkAction *action, comp_data = list->data; g_slist_free (list); - /* To Translators: Default filename part saving a task to a file when no summary is filed, the '.ics' extension is concatenated to it */ + /* Translators: Default filename part saving a task to a file when + * no summary is filed, the '.ics' extension is concatenated to it */ string = icalcomp_suggest_filename (comp_data->icalcomp, _("task")); file = e_shell_run_save_dialog ( - shell, _("Save as iCalendar"), string, "*.ics:text/calendar", NULL, NULL); + shell, _("Save as iCalendar"), string, + "*.ics:text/calendar", NULL, NULL); g_free (string); if (file == NULL) return; diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index 4337f19a79..533a36d3eb 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -354,7 +354,8 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) e_task_shell_view_update_search_filter (task_shell_view); e_task_shell_view_update_timezone (task_shell_view); - /* call this when everything is ready, like actions in action groups and such */ + /* Call this when everything is ready, like actions in + * action groups and such. */ task_shell_view_update_timeout_cb (task_shell_view); priv->update_timeout = g_timeout_add_full ( G_PRIORITY_LOW, 60000, (GSourceFunc) diff --git a/modules/mail/e-mail-junk-hook.c b/modules/mail/e-mail-junk-hook.c index bf4a5ccf36..f17290f99d 100644 --- a/modules/mail/e-mail-junk-hook.c +++ b/modules/mail/e-mail-junk-hook.c @@ -85,7 +85,8 @@ mail_junk_hook_get_name (CamelJunkPlugin *junk_plugin) interface = (EMJunkInterface *) junk_plugin; if (!interface->hook->plugin->enabled) { - /* Translators: "None" for a junk hook name, when the junk plugin is not enabled */ + /* Translators: "None" for a junk hook name, + * when the junk plugin is not enabled. */ return C_("mail-junk-hook", "None"); } diff --git a/shell/e-shell-content.c b/shell/e-shell-content.c index 799df0d4fe..af318b8582 100644 --- a/shell/e-shell-content.c +++ b/shell/e-shell-content.c @@ -260,7 +260,8 @@ shell_content_forall (GtkContainer *container, priv = E_SHELL_CONTENT_GET_PRIVATE (container); - if (include_internals && priv->searchbar != NULL && container == (GtkContainer *)priv->searchbar->parent) + if (include_internals && priv->searchbar != NULL && + container == GTK_CONTAINER (priv->searchbar->parent)) callback (priv->searchbar, callback_data); /* Chain up to parent's forall() method. */ diff --git a/shell/e-shell-searchbar.c b/shell/e-shell-searchbar.c index c37a09a2ff..7d09589f7f 100644 --- a/shell/e-shell-searchbar.c +++ b/shell/e-shell-searchbar.c @@ -392,7 +392,7 @@ shell_searchbar_get_property (GObject *object, value, e_shell_searchbar_get_label_visible ( E_SHELL_SEARCHBAR (object))); return; - + case PROP_FILTER_VISIBLE: g_value_set_boolean ( value, e_shell_searchbar_get_filter_visible ( diff --git a/shell/e-shell-searchbar.h b/shell/e-shell-searchbar.h index 6bb402bf53..79b593b1cd 100644 --- a/shell/e-shell-searchbar.h +++ b/shell/e-shell-searchbar.h @@ -103,12 +103,11 @@ gboolean e_shell_searchbar_get_search_visible void e_shell_searchbar_set_search_visible (EShellSearchbar *searchbar, gboolean search_visible); -gboolean e_shell_searchbar_get_label_visible +gboolean e_shell_searchbar_get_label_visible (EShellSearchbar *searchbar); -void e_shell_searchbar_set_label_visible +void e_shell_searchbar_set_label_visible (EShellSearchbar *searchbar, - gboolean label_visible); - + gboolean label_visible); EActionComboBox * e_shell_searchbar_get_scope_combo_box (EShellSearchbar *searchbar); diff --git a/shell/e-shell-switcher.c b/shell/e-shell-switcher.c index e1ed8606e5..ec4f23ce53 100644 --- a/shell/e-shell-switcher.c +++ b/shell/e-shell-switcher.c @@ -127,7 +127,9 @@ shell_switcher_layout_actions (EShellSwitcher *switcher) y -= max_height; len = g_list_length (rows[i]); if (!icons_only) - extra_width = (allocation->width - (len * max_width ) - (len * H_PADDING)) / len; + extra_width = + (allocation->width - (len * max_width) - + (len * H_PADDING)) / len; else extra_width = 0; for (p = rows [i]; p != NULL; p = p->next) { diff --git a/shell/e-shell-utils.c b/shell/e-shell-utils.c index 70638ec2dd..f954492a0c 100644 --- a/shell/e-shell-utils.c +++ b/shell/e-shell-utils.c @@ -308,9 +308,10 @@ e_shell_utils_import_uris (EShell *shell, gchar **uris, gboolean preview) gtk_widget_show (assistant); } else { - g_warning ("%s: Cannot %s any of the given URIs", G_STRFUNC, preview ? "preview" : "import"); + g_warning ( + "%s: Cannot %s any of the given URIs", + G_STRFUNC, preview ? "preview" : "import"); } - /* like when all of them */ return g_strv_length (uris); } diff --git a/smclient/eggsmclient.c b/smclient/eggsmclient.c index e17d98c3a9..335da4b88e 100644 --- a/smclient/eggsmclient.c +++ b/smclient/eggsmclient.c @@ -44,7 +44,9 @@ struct _EggSMClientPrivate { GKeyFile *state_file; }; -#define EGG_SM_CLIENT_GET_PRIVATE(o) (G_TYPE_INSTANCE_GET_PRIVATE ((o), EGG_TYPE_SM_CLIENT, EggSMClientPrivate)) +#define EGG_SM_CLIENT_GET_PRIVATE(obj) \ + (G_TYPE_INSTANCE_GET_PRIVATE \ + ((obj), EGG_TYPE_SM_CLIENT, EggSMClientPrivate)) G_DEFINE_TYPE (EggSMClient, egg_sm_client, G_TYPE_OBJECT) diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index a6af71e216..adf40d4df4 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -109,11 +109,13 @@ attachment_button_menu_position (GtkMenu *menu, else if (menu_requisition.width > widget->allocation.width) *x -= menu_requisition.width - widget->allocation.width; - if ((*y + toggle_button->allocation.height + menu_requisition.height) <= monitor.y + monitor.height) + if ((*y + toggle_button->allocation.height + + menu_requisition.height) <= monitor.y + monitor.height) *y += toggle_button->allocation.height; else if ((*y - menu_requisition.height) >= monitor.y) *y -= menu_requisition.height; - else if (monitor.y + monitor.height - (*y + toggle_button->allocation.height) > *y) + else if (monitor.y + monitor.height - + (*y + toggle_button->allocation.height) > *y) *y += toggle_button->allocation.height; else *y -= menu_requisition.height; diff --git a/widgets/misc/e-attachment.c b/widgets/misc/e-attachment.c index dc9b533fcc..44dd467967 100644 --- a/widgets/misc/e-attachment.c +++ b/widgets/misc/e-attachment.c @@ -107,6 +107,7 @@ static gboolean create_system_thumbnail (EAttachment *attachment, GIcon **icon) { GFile *file; + GFile *icon_file; gchar *thumbnail = NULL; g_return_val_if_fail (attachment != NULL, FALSE); @@ -122,27 +123,33 @@ create_system_thumbnail (EAttachment *attachment, GIcon **icon) } } - if (thumbnail) { - GFile *gf = g_file_new_for_path (thumbnail); + if (thumbnail == NULL) + return FALSE; - g_return_val_if_fail (gf != NULL, FALSE); - if (*icon) - g_object_unref (*icon); + icon_file = g_file_new_for_path (thumbnail); - *icon = g_file_icon_new (gf); - g_object_unref (gf); + if (*icon) + g_object_unref (*icon); - if (file) { - GFileInfo *fi = e_attachment_get_file_info (attachment); + *icon = g_file_icon_new (icon_file); - if (fi) - g_file_info_set_attribute_byte_string (fi, G_FILE_ATTRIBUTE_THUMBNAIL_PATH, thumbnail); - } + g_object_unref (icon_file); + + if (file) { + GFileInfo *file_info; + const gchar *attribute; + + file_info = e_attachment_get_file_info (attachment); + attribute = G_FILE_ATTRIBUTE_THUMBNAIL_PATH; + + if (file_info != NULL) + g_file_info_set_attribute_byte_string ( + file_info, attribute, thumbnail); } g_free (thumbnail); - return thumbnail != NULL; + return TRUE; } static gchar * |