diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-06-05 04:53:10 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-06-09 01:14:48 +0800 |
commit | f014ab82c81078d60cb1df8c986305c2cc9948c2 (patch) | |
tree | c3bde4e5da923c9ee082fcb994b10c2ce2f61dc2 | |
parent | 7428fc93d58921bab9968a999172b843af2a2244 (diff) | |
download | gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.gz gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.bz2 gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.lz gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.xz gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.tar.zst gsoc2013-evolution-f014ab82c81078d60cb1df8c986305c2cc9948c2.zip |
Coding style and whitespace cleanups.
97 files changed, 1192 insertions, 724 deletions
diff --git a/a11y/gal-a11y-factory.h b/a11y/gal-a11y-factory.h index b5df8539b6..3c774dd52c 100644 --- a/a11y/gal-a11y-factory.h +++ b/a11y/gal-a11y-factory.h @@ -69,7 +69,7 @@ type_as_function ## _factory_get_type (void) \ static const GTypeInfo tinfo = \ { \ sizeof (AtkObjectFactoryClass), \ - NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \ + NULL, NULL, (GClassInitFunc) type_as_function ## _factory_class_init, \ NULL, NULL, sizeof (AtkObjectFactory), 0, NULL, NULL \ }; \ \ diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index 21eddb14d2..c2dc45304b 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -71,7 +71,9 @@ e_contact_editor_fullname_set_property (GObject *object, } break; case PROP_EDITABLE: { + gboolean editable; gint i; + const gchar *widget_names[] = { "comboentry-title", "comboentry-suffix", @@ -85,22 +87,32 @@ e_contact_editor_fullname_set_property (GObject *object, "label-last", NULL }; - e_contact_editor_fullname->editable = g_value_get_boolean (value) ? TRUE : FALSE; + + editable = g_value_get_boolean (value); + e_contact_editor_fullname->editable = editable; + for (i = 0; widget_names[i] != NULL; i++) { - GtkWidget *w = e_builder_get_widget ( + GtkWidget *widget; + + widget = e_builder_get_widget ( e_contact_editor_fullname->builder, widget_names[i]); - if (GTK_IS_ENTRY (w)) { - gtk_editable_set_editable (GTK_EDITABLE (w), - e_contact_editor_fullname->editable); - } - else if (GTK_IS_COMBO_BOX (w)) { - gtk_editable_set_editable (GTK_EDITABLE (gtk_bin_get_child (GTK_BIN (w))), - e_contact_editor_fullname->editable); - gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable); - } - else if (GTK_IS_LABEL (w)) { - gtk_widget_set_sensitive (w, e_contact_editor_fullname->editable); + + if (GTK_IS_ENTRY (widget)) { + gtk_editable_set_editable ( + GTK_EDITABLE (widget), editable); + + } else if (GTK_IS_COMBO_BOX (widget)) { + GtkWidget *child; + + child = gtk_bin_get_child (GTK_BIN (widget)); + + gtk_editable_set_editable ( + GTK_EDITABLE (child), editable); + gtk_widget_set_sensitive (widget, editable); + + } else if (GTK_IS_LABEL (widget)) { + gtk_widget_set_sensitive (widget, editable); } } break; diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 1df7b62082..b636190777 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -1787,7 +1787,9 @@ fill_in_im (EContactEditor *editor) gint slot; im_name = e_vcard_attribute_get_value (attr); - slot = alloc_ui_slot (editor, "entry-im-name", get_ui_slot (attr), IM_SLOTS); + slot = alloc_ui_slot ( + editor, "entry-im-name", + get_ui_slot (attr), IM_SLOTS); if (slot < 1) break; @@ -1870,7 +1872,8 @@ extract_im (EContactEditor *editor) e_vcard_attribute_add_value (attr, name); set_ui_slot (attr, i); - service_attr_list[service] = g_list_append (service_attr_list[service], attr); + service_attr_list[service] = g_list_append ( + service_attr_list[service], attr); } g_free (name); @@ -2795,7 +2798,8 @@ init_simple (EContactEditor *editor) gint i; for (i = 0; i < G_N_ELEMENTS (simple_field_map); i++) { - widget = e_builder_get_widget (editor->builder, simple_field_map[i].widget_name); + widget = e_builder_get_widget ( + editor->builder, simple_field_map[i].widget_name); if (!widget) continue; @@ -2829,7 +2833,8 @@ fill_in_simple (EContactEditor *editor) !simple_field_map[i].process_data) continue; - widget = e_builder_get_widget (editor->builder, simple_field_map[i].widget_name); + widget = e_builder_get_widget ( + editor->builder, simple_field_map[i].widget_name); if (!widget) continue; @@ -2878,7 +2883,8 @@ extract_simple (EContactEditor *editor) !simple_field_map[i].process_data) continue; - widget = e_builder_get_widget (editor->builder, simple_field_map[i].widget_name); + widget = e_builder_get_widget ( + editor->builder, simple_field_map[i].widget_name); if (!widget) continue; @@ -2899,7 +2905,8 @@ sensitize_simple (EContactEditor *editor) GtkWidget *widget; gboolean enabled = TRUE; - widget = e_builder_get_widget (editor->builder, simple_field_map[i].widget_name); + widget = e_builder_get_widget ( + editor->builder, simple_field_map[i].widget_name); if (!widget) continue; @@ -3121,15 +3128,23 @@ static void categories_response (GtkDialog *dialog, gint response, EContactEditor *editor) { const gchar *categories; - GtkWidget *entry = e_builder_get_widget(editor->builder, "entry-categories"); + GtkWidget *entry; + + entry = e_builder_get_widget (editor->builder, "entry-categories"); if (response == GTK_RESPONSE_OK) { - categories = e_categories_dialog_get_categories (E_CATEGORIES_DIALOG (dialog)); - if (entry && GTK_IS_ENTRY (entry)) - gtk_entry_set_text (GTK_ENTRY (entry), categories); + categories = e_categories_dialog_get_categories ( + E_CATEGORIES_DIALOG (dialog)); + if (GTK_IS_ENTRY (entry)) + gtk_entry_set_text ( + GTK_ENTRY (entry), categories); else - e_contact_set (editor->contact, E_CONTACT_CATEGORIES, (gchar *) categories); + e_contact_set ( + editor->contact, + E_CONTACT_CATEGORIES, + (gchar *) categories); } + gtk_widget_destroy (GTK_WIDGET (dialog)); editor->categories_dialog = NULL; } @@ -4150,7 +4165,9 @@ e_contact_editor_set_property (GObject *object, break; if (editor->target_book) { - g_signal_handler_disconnect (editor->target_book, editor->target_editable_id); + g_signal_handler_disconnect ( + editor->target_book, + editor->target_editable_id); g_object_unref (editor->target_book); } 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 31709bcf06..3fae1a2013 100644 --- a/addressbook/gui/contact-list-editor/e-contact-list-editor.c +++ b/addressbook/gui/contact-list-editor/e-contact-list-editor.c @@ -386,7 +386,9 @@ contact_list_editor_selection_changed_cb (GtkTreeSelection *selection, /* Item before selected item exists => enable Top/Up buttons */ selected = gtk_tree_selection_get_selected_rows (selection, &model); - first_item = gtk_tree_path_copy (selected->data); /* Don't update path in the list! */ + + /* Don't update path in the list! */ + first_item = gtk_tree_path_copy (selected->data); if (gtk_tree_path_prev (first_item)) { gtk_widget_set_sensitive (WIDGET (TOP_BUTTON), TRUE); gtk_widget_set_sensitive (WIDGET (UP_BUTTON), TRUE); @@ -934,21 +936,33 @@ contact_list_editor_top_button_clicked_cb (GtkButton *button); void contact_list_editor_top_button_clicked_cb (GtkButton *button) { - EContactListEditor *editor = contact_list_editor_extract (GTK_WIDGET (button)); - GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (WIDGET (TREE_VIEW))); - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WIDGET (TREE_VIEW))); + EContactListEditor *editor; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreeSelection *selection; GtkTreeIter iter; GtkTreePath *path; GList *references = NULL; + GList *l, *selected; + + editor = contact_list_editor_extract (GTK_WIDGET (button)); + + tree_view = GTK_TREE_VIEW (WIDGET (TREE_VIEW)); + model = gtk_tree_view_get_model (tree_view); + selection = gtk_tree_view_get_selection (tree_view); + + selected = gtk_tree_selection_get_selected_rows (selection, &model); - GList *l, *selected = gtk_tree_selection_get_selected_rows (selection, &model); for (l = selected; l; l = l->next) - references = g_list_prepend (references, gtk_tree_row_reference_new (model, l->data)); + references = g_list_prepend ( + references, + gtk_tree_row_reference_new (model, l->data)); for (l = references; l; l = l->next) { path = gtk_tree_row_reference_get_path (l->data); gtk_tree_model_get_iter (model, &iter, path); - gtk_list_store_move_after (GTK_LIST_STORE (model), &iter, NULL); + gtk_list_store_move_after ( + GTK_LIST_STORE (model), &iter, NULL); gtk_tree_path_free (path); } @@ -966,13 +980,21 @@ contact_list_editor_up_button_clicked_cb (GtkButton *button); void contact_list_editor_up_button_clicked_cb (GtkButton *button) { - EContactListEditor *editor = contact_list_editor_extract (GTK_WIDGET (button)); - GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (WIDGET (TREE_VIEW))); - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WIDGET (TREE_VIEW))); + EContactListEditor *editor; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreeSelection *selection; GtkTreeIter iter, iter2; GtkTreePath *path; + GList *selected; - GList *selected = gtk_tree_selection_get_selected_rows (selection, &model); + editor = contact_list_editor_extract (GTK_WIDGET (button)); + + tree_view = GTK_TREE_VIEW (WIDGET (TREE_VIEW)); + model = gtk_tree_view_get_model (tree_view); + selection = gtk_tree_view_get_selection (tree_view); + + selected = gtk_tree_selection_get_selected_rows (selection, &model); /* Get iter of item above the first selected item */ path = gtk_tree_path_copy (selected->data); @@ -997,12 +1019,20 @@ contact_list_editor_down_button_clicked_cb (GtkButton *button); void contact_list_editor_down_button_clicked_cb (GtkButton *button) { - EContactListEditor *editor = contact_list_editor_extract (GTK_WIDGET (button)); - GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (WIDGET (TREE_VIEW))); - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WIDGET (TREE_VIEW))); + EContactListEditor *editor; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreeSelection *selection; GtkTreeIter iter, iter2; + GList *selected; - GList *selected = gtk_tree_selection_get_selected_rows (selection, &model); + editor = contact_list_editor_extract (GTK_WIDGET (button)); + + tree_view = GTK_TREE_VIEW (WIDGET (TREE_VIEW)); + model = gtk_tree_view_get_model (tree_view); + selection = gtk_tree_view_get_selection (tree_view); + + selected = gtk_tree_selection_get_selected_rows (selection, &model); /* Iter of the first selected item */ gtk_tree_model_get_iter (model, &iter, selected->data); @@ -1025,22 +1055,34 @@ contact_list_editor_bottom_button_clicked_cb (GtkButton *button); void contact_list_editor_bottom_button_clicked_cb (GtkButton *button) { - EContactListEditor *editor = contact_list_editor_extract (GTK_WIDGET (button)); - GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (WIDGET (TREE_VIEW))); - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (WIDGET (TREE_VIEW))); + EContactListEditor *editor; + GtkTreeView *tree_view; + GtkTreeModel *model; + GtkTreeSelection *selection; GtkTreeIter iter; GtkTreePath *path; GList *references = NULL; - GList *l, *selected = gtk_tree_selection_get_selected_rows (selection, &model); + GList *l, *selected; + + editor = contact_list_editor_extract (GTK_WIDGET (button)); + + tree_view = GTK_TREE_VIEW (WIDGET (TREE_VIEW)); + model = gtk_tree_view_get_model (tree_view); + selection = gtk_tree_view_get_selection (tree_view); + + selected = gtk_tree_selection_get_selected_rows (selection, &model); for (l = selected; l; l = l->next) - references = g_list_prepend (references, gtk_tree_row_reference_new (model, l->data)); + references = g_list_prepend ( + references, + gtk_tree_row_reference_new (model, l->data)); references = g_list_reverse (references); for (l = references; l; l = l->next) { path = gtk_tree_row_reference_get_path (l->data); gtk_tree_model_get_iter (model, &iter, path); - gtk_list_store_move_before (GTK_LIST_STORE (model), &iter, NULL); + gtk_list_store_move_before ( + GTK_LIST_STORE (model), &iter, NULL); gtk_tree_path_free (path); } @@ -1052,7 +1094,6 @@ contact_list_editor_bottom_button_clicked_cb (GtkButton *button) contact_list_editor_selection_changed_cb (selection, editor); } - /******************** GtkBuilder Custom Widgets Functions ********************/ static gpointer diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index c2c21bdd78..30720513d0 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -395,19 +395,24 @@ addressbook_model_idle_cb (EAddressbookModel *model) remove_book_view (model); if (model->priv->first_get_view) { + gboolean do_initial_query; + model->priv->first_get_view = FALSE; - if (e_book_check_static_capability (model->priv->book, "do-initial-query")) { + do_initial_query = e_book_check_static_capability ( + model->priv->book, "do-initial-query"); + + if (do_initial_query) { e_book_get_book_view_async ( model->priv->book, model->priv->query, NULL, limit, book_view_loaded, model); } else { free_data (model); - g_signal_emit (model, - signals[MODEL_CHANGED], 0); - g_signal_emit (model, - signals[STOP_STATE_CHANGED], 0); + g_signal_emit ( + model, signals[MODEL_CHANGED], 0); + g_signal_emit ( + model, signals[STOP_STATE_CHANGED], 0); } } else e_book_get_book_view_async ( diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 1508e0690f..4421b1a739 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -399,13 +399,14 @@ e_minicard_view_widget_realize (GtkWidget *widget) EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET (widget); GtkStyle *style = gtk_widget_get_style (widget); - view->background = gnome_canvas_item_new (gnome_canvas_root ( GNOME_CANVAS (view) ), - e_canvas_background_get_type (), - "fill_color_gdk", &style->base[GTK_STATE_NORMAL], - NULL ); + view->background = gnome_canvas_item_new ( + gnome_canvas_root (GNOME_CANVAS (view)), + e_canvas_background_get_type (), + "fill_color_gdk", &style->base[GTK_STATE_NORMAL], + NULL ); view->emv = gnome_canvas_item_new ( - gnome_canvas_root ( GNOME_CANVAS (view) ), + gnome_canvas_root (GNOME_CANVAS (view)), e_minicard_view_get_type (), "height", (double) 100, "minimum_width", (double) 100, @@ -413,24 +414,26 @@ e_minicard_view_widget_realize (GtkWidget *widget) "column_width", view->column_width, NULL ); - g_signal_connect (E_REFLOW (view->emv)->selection, - "selection_changed", - G_CALLBACK (selection_change), view); - g_signal_connect (E_REFLOW (view->emv)->selection, - "selection_row_changed", - G_CALLBACK (selection_row_change), view); - g_signal_connect (view->emv, - "column_width_changed", - G_CALLBACK (column_width_changed), view); - g_signal_connect (view->emv, - "create-contact", - G_CALLBACK (create_contact), view); - g_signal_connect (view->emv, - "create-contact-list", - G_CALLBACK (create_contact_list), view); - g_signal_connect (view->emv, - "right_click", - G_CALLBACK (right_click), view); + g_signal_connect ( + E_REFLOW (view->emv)->selection, + "selection_changed", + G_CALLBACK (selection_change), view); + g_signal_connect ( + E_REFLOW (view->emv)->selection, + "selection_row_changed", + G_CALLBACK (selection_row_change), view); + g_signal_connect ( + view->emv, "column_width_changed", + G_CALLBACK (column_width_changed), view); + g_signal_connect ( + view->emv, "create-contact", + G_CALLBACK (create_contact), view); + g_signal_connect ( + view->emv, "create-contact-list", + G_CALLBACK (create_contact_list), view); + g_signal_connect ( + view->emv, "right_click", + G_CALLBACK (right_click), view); if (GTK_WIDGET_CLASS (parent_class)->realize) GTK_WIDGET_CLASS (parent_class)->realize (widget); diff --git a/addressbook/gui/widgets/ea-addressbook.c b/addressbook/gui/widgets/ea-addressbook.c index 20bca97948..b67d876139 100644 --- a/addressbook/gui/widgets/ea-addressbook.c +++ b/addressbook/gui/widgets/ea-addressbook.c @@ -79,7 +79,8 @@ ea_addressbook_focus_watcher (GSignalInvocationHint *ihint, GnomeCanvasItem *item = GNOME_CANVAS_ITEM (object); ea_event = atk_gobject_accessible_for_object (object); if (event->type == GDK_FOCUS_CHANGE) { - if ((event->focus_change.in) && (E_IS_MINICARD (item->canvas->focused_item))) + if ((event->focus_change.in) && + (E_IS_MINICARD (item->canvas->focused_item))) atk_focus_tracker_notify (ea_event); } } diff --git a/addressbook/importers/evolution-csv-importer.c b/addressbook/importers/evolution-csv-importer.c index 28d9f2d617..358b8198ab 100644 --- a/addressbook/importers/evolution-csv-importer.c +++ b/addressbook/importers/evolution-csv-importer.c @@ -316,7 +316,8 @@ date_from_string (const gchar *str) date->day = str[i] - '0' * 1; i = i+2; } - date->year = str[i] * 1000 + str[i+1] * 100 + str[i+2] * 10 + str[i+3] - '0' * 1111; + date->year = str[i] * 1000 + str[i + 1] * 100 + + str[i + 2] * 10 + str[i + 3] - '0' * 1111; return date; } @@ -388,7 +389,9 @@ map_fields (const gchar *header_line, gint pimporter) while (value = parseNextValue (&pptr), value != NULL) { for (j = 0; j < n_fields; j++) { if (g_ascii_strcasecmp (fields_array[j].csv_attribute, value->str) == 0) { - g_hash_table_insert (fmap, GINT_TO_POINTER (idx), GINT_TO_POINTER (j + 1)); + g_hash_table_insert ( + fmap, GINT_TO_POINTER (idx), + GINT_TO_POINTER (j + 1)); any_found = TRUE; break; } @@ -445,9 +448,12 @@ parseLine (CSVImporter *gci, EContact *contact, gchar *buf) { idx = ii; if (gci->fields_map) { - gpointer found = g_hash_table_lookup (gci->fields_map, GINT_TO_POINTER (idx)); + gpointer found; - if (!found) { + found = g_hash_table_lookup ( + gci->fields_map, GINT_TO_POINTER (idx)); + + if (found == NULL) { g_warning ("%s: No map for index %d, skipping it", G_STRFUNC, idx); idx = -1; } else { diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index c76f0763bf..85e46923d1 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -302,7 +302,10 @@ parseLine (GHashTable *dn_contact_hash, EContact *contact, } else { /* FIXME is everything a string? */ - e_contact_set (contact, ldif_fields[i].contact_field, ldif_value->str); + e_contact_set ( + contact, + ldif_fields[i].contact_field, + ldif_value->str); g_message ("set %s to %s", ptr, ldif_value->str); } field_handled = TRUE; diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 97f2551c38..04f81b222c 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -936,7 +936,9 @@ evolution_contact_importer_get_preview_widget (const GList *contacts) if (description) { const gchar *at = strchr (description, '@'); if (at) { - free_description = g_strndup (description, (gsize)(at - description)); + free_description = g_strndup ( + description, + (gsize) (at - description)); description = free_description; } } diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index 42dc10c6e9..e8e5485e45 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -2120,7 +2120,8 @@ remove_client_alarms (ClientAlarms *ca) { debug (("size %d", g_hash_table_size (ca->uid_alarms_hash))); - g_hash_table_foreach_remove (ca->uid_alarms_hash, (GHRFunc) remove_comp_by_id, ca); + g_hash_table_foreach_remove ( + ca->uid_alarms_hash, (GHRFunc) remove_comp_by_id, ca); /* The hash table should be empty now */ g_return_if_fail (g_hash_table_size (ca->uid_alarms_hash) == 0); diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c index e1fe1f48ff..41207d48fb 100644 --- a/calendar/gui/alarm-notify/config-data.c +++ b/calendar/gui/alarm-notify/config-data.c @@ -309,9 +309,13 @@ config_data_get_last_notification_time (ECal *cal) if (cal) { ESource *source = e_cal_get_source (cal); if (source) { - const gchar *last_notified = e_source_get_property (source, "last-notified"); + const gchar *last_notified; + GTimeVal tmval = {0}; + last_notified = e_source_get_property ( + source, "last-notified"); + if (last_notified && *last_notified && g_time_val_from_iso8601 (last_notified, &tmval)) { time_t now = time (NULL), val = (time_t) tmval.tv_sec; @@ -326,9 +330,13 @@ config_data_get_last_notification_time (ECal *cal) if (!(client = config_data_get_conf_client ())) return -1; - value = gconf_client_get_without_default (client, KEY_LAST_NOTIFICATION_TIME, NULL); + value = gconf_client_get_without_default ( + client, KEY_LAST_NOTIFICATION_TIME, NULL); if (value) { - time_t val = (time_t) gconf_value_get_int (value), now = time (NULL); + time_t val, now; + + val = (time_t) gconf_value_get_int (value); + now = time (NULL); if (val > now) val = now; diff --git a/calendar/gui/comp-util.c b/calendar/gui/comp-util.c index 4c5f80adcd..fbf9e7dc82 100644 --- a/calendar/gui/comp-util.c +++ b/calendar/gui/comp-util.c @@ -444,11 +444,15 @@ cal_comp_update_time_by_active_window (ECalComponent *comp, EShell *shell) g_return_if_fail (shell != NULL); window = e_shell_get_active_window (shell); - if (window && E_IS_SHELL_WINDOW (window)) { - EShellWindow *shell_window = E_SHELL_WINDOW (window); - if (e_shell_window_get_active_view (shell_window) - && g_str_equal (e_shell_window_get_active_view (shell_window), "calendar")) { + if (E_IS_SHELL_WINDOW (window)) { + EShellWindow *shell_window; + const gchar *active_view; + + shell_window = E_SHELL_WINDOW (window); + active_view = e_shell_window_get_active_view (shell_window); + + if (g_strcmp0 (active_view, "calendar") == 0) { EShellContent *shell_content; EShellView *shell_view; GnomeCalendar *gnome_cal; diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index c8640b608a..cc794ae3f5 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -477,9 +477,14 @@ save_comp (CompEditor *editor) if (result) g_signal_emit_by_name (editor, "object_created"); } else { + gboolean has_recurrences; - if (e_cal_component_has_recurrences (priv->comp) && priv->mod == CALOBJ_MOD_ALL) - comp_util_sanitize_recurrence_master (priv->comp, priv->client); + has_recurrences = + e_cal_component_has_recurrences (priv->comp); + + if (has_recurrences && priv->mod == CALOBJ_MOD_ALL) + comp_util_sanitize_recurrence_master ( + priv->comp, priv->client); if (priv->mod == CALOBJ_MOD_THIS) { e_cal_component_set_rdate_list (priv->comp, NULL); @@ -904,7 +909,9 @@ action_save_cb (GtkAction *action, e_cal_component_has_recurrences (priv->comp)) { gchar *rid; rid = e_cal_component_get_recurid_as_string (priv->comp); - e_cal_remove_object_with_mod (priv->client, uid, rid, priv->mod, &error); + e_cal_remove_object_with_mod ( + priv->client, uid, rid, + priv->mod, &error); g_free (rid); } else e_cal_remove_object (priv->client, uid, &error); @@ -3020,8 +3027,8 @@ set_attendees_for_delegation (ECalComponent *comp, icalcomp = e_cal_component_get_icalcomponent (comp); for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); - prop; - prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) { + prop; + prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) { const gchar *attendee = icalproperty_get_attendee (prop); const gchar *delfrom = NULL; @@ -3049,14 +3056,17 @@ get_users_from_memo_comp (ECalComponent *comp, GList **users) icalcomp = e_cal_component_get_icalcomponent (comp); for (icalprop = icalcomponent_get_first_property (icalcomp, ICAL_X_PROPERTY); - icalprop != NULL; - icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) { - if (g_str_equal (icalproperty_get_x_name (icalprop), "X-EVOLUTION-RECIPIENTS")) { + icalprop != NULL; + icalprop = icalcomponent_get_next_property (icalcomp, ICAL_X_PROPERTY)) { + const gchar *x_name; + + x_name = icalproperty_get_x_name (icalprop); + + if (g_str_equal (x_name, "X-EVOLUTION-RECIPIENTS")) break; - } } - if (icalprop) { + if (icalprop) { attendees = icalproperty_get_x (icalprop); emails = g_strsplit (attendees, ";", -1); diff --git a/calendar/gui/dialogs/copy-source-dialog.c b/calendar/gui/dialogs/copy-source-dialog.c index f1c568849b..547a91069c 100644 --- a/calendar/gui/dialogs/copy-source-dialog.c +++ b/calendar/gui/dialogs/copy-source-dialog.c @@ -119,9 +119,13 @@ copy_source (CopySourceDialogData *csdd) for (l = obj_list; l != NULL; l = l->next) { /* FIXME: process recurrences */ /* FIXME: process errors */ - if (e_cal_get_object (dest_client, icalcomponent_get_uid (l->data), NULL, - &icalcomp, NULL)) { - e_cal_modify_object (dest_client, l->data, CALOBJ_MOD_ALL, NULL); + if (e_cal_get_object ( + dest_client, + icalcomponent_get_uid (l->data), + NULL, &icalcomp, NULL)) { + e_cal_modify_object ( + dest_client, l->data, + CALOBJ_MOD_ALL, NULL); icalcomponent_free (icalcomp); } else { gchar *uid = NULL; @@ -129,8 +133,11 @@ copy_source (CopySourceDialogData *csdd) icalcomp = l->data; - /* add timezone information from source ECal to the destination ECal */ - icalcomponent_foreach_tzid (icalcomp, add_timezone_to_cal_cb, &ftd); + /* Add timezone information from source + * ECal to the destination ECal. */ + icalcomponent_foreach_tzid ( + icalcomp, + add_timezone_to_cal_cb, &ftd); if (e_cal_create_object (dest_client, icalcomp, &uid, &error)) { g_free (uid); diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 41985bd8b7..64d3b67891 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -363,7 +363,8 @@ event_editor_constructor (GType type, if (is_meeting) { - if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS)) + if (e_cal_get_static_capability ( + client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS)) event_page_show_options (priv->event_page); comp_editor_set_group_item (editor, TRUE); @@ -651,8 +652,13 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) for (l = attendees; l != NULL; l = l->next) { ECalComponentAttendee *ca = l->data; EMeetingAttendee *ia; + gboolean addresses_match; - if (delegate && !g_str_equal (itip_strip_mailto (ca->value), user_email)) + addresses_match = + g_str_equal (user_email, + itip_strip_mailto (ca->value)); + + if (delegate && !addresses_match) continue; ia = E_MEETING_ATTENDEE ( @@ -677,13 +683,16 @@ event_editor_edit_comp (CompEditor *editor, ECalComponent *comp) ia = e_meeting_store_find_self (priv->model, &row); if (ia != NULL) - e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_STATUS); + e_meeting_attendee_set_edit_level ( + ia, E_MEETING_ATTENDEE_EDIT_STATUS); } else if (e_cal_get_organizer_must_attend (client)) { EMeetingAttendee *ia; - ia = e_meeting_store_find_attendee (priv->model, organizer.value, &row); + ia = e_meeting_store_find_attendee ( + priv->model, organizer.value, &row); if (ia != NULL) - e_meeting_attendee_set_edit_level (ia, E_MEETING_ATTENDEE_EDIT_NONE); + e_meeting_attendee_set_edit_level ( + ia, E_MEETING_ATTENDEE_EDIT_NONE); } } diff --git a/calendar/gui/dialogs/goto-dialog.c b/calendar/gui/dialogs/goto-dialog.c index 282d5547ff..bc20baa7c2 100644 --- a/calendar/gui/dialogs/goto-dialog.c +++ b/calendar/gui/dialogs/goto-dialog.c @@ -60,21 +60,28 @@ static GoToDialog *dlg = NULL; static void year_changed (GtkAdjustment *adj, gpointer data) { + GtkSpinButton *spin_button; GoToDialog *dlg = data; - dlg->year_val = gtk_spin_button_get_value_as_int (GTK_SPIN_BUTTON (dlg->year)); - e_calendar_item_set_first_month (dlg->ecal->calitem, dlg->year_val, dlg->month_val); + spin_button = GTK_SPIN_BUTTON (dlg->year); + dlg->year_val = gtk_spin_button_get_value_as_int (spin_button); + + e_calendar_item_set_first_month ( + dlg->ecal->calitem, dlg->year_val, dlg->month_val); } /* Callback used when a month button is toggled */ static void month_changed (GtkToggleButton *toggle, gpointer data) { + GtkComboBox *combo_box; GoToDialog *dlg = data; - dlg->month_val = gtk_combo_box_get_active (GTK_COMBO_BOX (dlg->month_combobox)); + combo_box = GTK_COMBO_BOX (dlg->month_combobox); + dlg->month_val = gtk_combo_box_get_active (combo_box); - e_calendar_item_set_first_month (dlg->ecal->calitem, dlg->year_val, dlg->month_val); + e_calendar_item_set_first_month ( + dlg->ecal->calitem, dlg->year_val, dlg->month_val); } static void diff --git a/calendar/gui/dialogs/task-editor.c b/calendar/gui/dialogs/task-editor.c index 30a5bbb9f9..f24db192b2 100644 --- a/calendar/gui/dialogs/task-editor.c +++ b/calendar/gui/dialogs/task-editor.c @@ -168,7 +168,8 @@ task_editor_constructor (GType type, gtk_action_group_set_visible (action_group, is_assigned); if (is_assigned) { - if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS)) + if (e_cal_get_static_capability ( + client, CAL_STATIC_CAPABILITY_REQ_SEND_OPTIONS)) task_page_show_options (priv->task_page); comp_editor_set_group_item (editor, TRUE); } diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index 7d87f6a02d..e65dc4d617 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -542,7 +542,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, layout = pango_cairo_create_layout (cr); pango_layout_set_text (layout, buffer, -1); pango_layout_get_pixel_size (layout, &minute_width, NULL); - cairo_translate (cr, minute_x2 - minute_width, row_y + small_font_y_offset); + cairo_translate ( + cr, minute_x2 - minute_width, + row_y + small_font_y_offset); pango_cairo_update_layout (cr, layout); pango_cairo_show_layout (cr, layout); cairo_restore (cr); @@ -859,8 +861,12 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, if (zone == time_item->priv->second_zone) gtk_check_menu_item_set_active (GTK_CHECK_MENU_ITEM (item), TRUE); gtk_menu_shell_append (GTK_MENU_SHELL (submenu), item); - g_object_set_data_full (G_OBJECT (item), "timezone", g_strdup (s->data), g_free); - g_signal_connect (item, "toggled", G_CALLBACK (edvti_on_set_zone), time_item); + g_object_set_data_full ( + G_OBJECT (item), "timezone", + g_strdup (s->data), g_free); + g_signal_connect ( + item, "toggled", + G_CALLBACK (edvti_on_set_zone), time_item); } calendar_config_free_day_second_zones (recent_zones); diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index 0b8b65ad53..201d10394b 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -816,24 +816,31 @@ e_day_view_top_item_get_type (void) } void -e_day_view_top_item_get_day_label (EDayView *day_view, gint day, - gchar *buffer, gint buffer_len) +e_day_view_top_item_get_day_label (EDayView *day_view, + gint day, + gchar *buffer, + gint buffer_len) { + ECalendarView *view; struct icaltimetype day_start_tt; + const icaltimezone *zone; struct tm day_start = { 0 }; const gchar *format; - day_start_tt = icaltime_from_timet_with_zone (day_view->day_starts[day], - FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); + view = E_CALENDAR_VIEW (day_view); + zone = e_calendar_view_get_timezone (view); + + day_start_tt = icaltime_from_timet_with_zone ( + day_view->day_starts[day], FALSE, zone); day_start.tm_year = day_start_tt.year - 1900; day_start.tm_mon = day_start_tt.month - 1; day_start.tm_mday = day_start_tt.day; day_start.tm_isdst = -1; - day_start.tm_wday = time_day_of_week (day_start_tt.day, - day_start_tt.month - 1, - day_start_tt.year); + day_start.tm_wday = time_day_of_week ( + day_start_tt.day, + day_start_tt.month - 1, + day_start_tt.year); if (day_view->date_format == E_DAY_VIEW_DATE_FULL) /* strftime format %A = full weekday name, %d = day of month, diff --git a/calendar/gui/e-meeting-attendee.c b/calendar/gui/e-meeting-attendee.c index c7c5bdfca2..5b101a5d61 100644 --- a/calendar/gui/e-meeting-attendee.c +++ b/calendar/gui/e-meeting-attendee.c @@ -855,7 +855,13 @@ e_meeting_attendee_add_busy_period (EMeetingAttendee *ia, priv->busy_periods_start.hour = period.start.hour; priv->busy_periods_start.minute = period.start.minute; } else { - switch (g_date_compare (&period.start.date, &priv->busy_periods_start.date)) { + gint compare; + + compare = g_date_compare ( + &period.start.date, + &priv->busy_periods_start.date); + + switch (compare) { case -1: priv->busy_periods_start.date = period.start.date; priv->busy_periods_start.hour = period.start.hour; diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index 1ac83c8e0e..e18c259f65 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -1073,11 +1073,17 @@ e_meeting_store_remove_all_attendees (EMeetingStore *store) { gint i, j, k; - for (i = 0, j = e_meeting_store_count_actual_attendees (store), k = 0; i < j; i++) { - /* Always try to remove the attendee at index 0 since it is the only one that will - * continue to exist until all attendees are removed. */ - EMeetingAttendee *attendee = g_ptr_array_index (store->priv->attendees, k); - GtkTreePath *path = gtk_tree_path_new (); + for (i = 0, j = e_meeting_store_count_actual_attendees (store), k = 0; + i < j; i++) { + /* Always try to remove the attendee at index 0 since + * it is the only one that will continue to exist until + * all attendees are removed. */ + EMeetingAttendee *attendee; + GtkTreePath *path; + + attendee = g_ptr_array_index (store->priv->attendees, k); + + path = gtk_tree_path_new (); gtk_tree_path_append_index (path, k); gtk_tree_model_row_deleted (GTK_TREE_MODEL (store), path); gtk_tree_path_free (path); diff --git a/calendar/gui/e-task-table.c b/calendar/gui/e-task-table.c index b68dbea737..540ce1cc63 100644 --- a/calendar/gui/e-task-table.c +++ b/calendar/gui/e-task-table.c @@ -1615,13 +1615,17 @@ hide_completed_rows (ECalModel *model, ECalComponentId *id; ECalComponent *comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (m->data)); + e_cal_component_set_icalcomponent ( + comp, icalcomponent_new_clone (m->data)); id = e_cal_component_get_id (comp); - if ((comp_data = e_cal_model_get_component_for_uid (model, id))) { + comp_data = e_cal_model_get_component_for_uid (model, id); + if (comp_data != NULL) { e_table_model_pre_change (E_TABLE_MODEL (model)); - pos = get_position_in_array (comp_objects, comp_data); - e_table_model_row_deleted (E_TABLE_MODEL (model), pos); + pos = get_position_in_array ( + comp_objects, comp_data); + e_table_model_row_deleted ( + E_TABLE_MODEL (model), pos); changed = TRUE; if (g_ptr_array_remove (comp_objects, comp_data)) @@ -1665,16 +1669,20 @@ show_completed_rows (ECalModel *model, ECalComponentId *id; ECalComponent *comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (m->data)); + e_cal_component_set_icalcomponent ( + comp, icalcomponent_new_clone (m->data)); id = e_cal_component_get_id (comp); if (!(e_cal_model_get_component_for_uid (model, id))) { e_table_model_pre_change (E_TABLE_MODEL (model)); - comp_data = g_object_new (E_TYPE_CAL_MODEL_COMPONENT, NULL); + comp_data = g_object_new ( + E_TYPE_CAL_MODEL_COMPONENT, NULL); comp_data->client = g_object_ref (client); - comp_data->icalcomp = icalcomponent_new_clone (m->data); - e_cal_model_set_instance_times (comp_data, - e_cal_model_get_timezone (model)); + comp_data->icalcomp = + icalcomponent_new_clone (m->data); + e_cal_model_set_instance_times ( + comp_data, + e_cal_model_get_timezone (model)); comp_data->dtstart = NULL; comp_data->dtend = NULL; comp_data->due = NULL; @@ -1682,7 +1690,9 @@ show_completed_rows (ECalModel *model, comp_data->color = NULL; g_ptr_array_add (comp_objects, comp_data); - e_table_model_row_inserted (E_TABLE_MODEL (model), comp_objects->len - 1); + e_table_model_row_inserted ( + E_TABLE_MODEL (model), + comp_objects->len - 1); } e_cal_component_free_id (id); g_object_unref (comp); diff --git a/calendar/gui/e-week-view-event-item.c b/calendar/gui/e-week-view-event-item.c index 998e0b2643..917d7de46d 100644 --- a/calendar/gui/e-week-view-event-item.c +++ b/calendar/gui/e-week-view-event-item.c @@ -140,7 +140,8 @@ week_view_event_item_double_click (EWeekViewEventItem *event_item, if (week_view->editing_event_num >= 0) { EWeekViewEvent *editing; - if (!is_array_index_in_bounds (week_view->events, week_view->editing_event_num)) + if (!is_array_index_in_bounds ( + week_view->events, week_view->editing_event_num)) return TRUE; editing = &g_array_index ( @@ -569,7 +570,8 @@ week_view_event_item_draw_triangle (EWeekViewEventItem *event_item, cairo_restore (cr); cairo_save (cr); - gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]); + gdk_cairo_set_source_color ( + cr, &week_view->colors[E_WEEK_VIEW_COLOR_EVENT_BORDER]); /* If the height is odd we can use the same central point for both lines. If it is even we use different end-points. */ @@ -825,11 +827,15 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, if (can_draw_in_region (draw_region, cx0, cy0, rect_width, rect_height)) { cairo_save (cr); - draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); - - pat = cairo_pattern_create_linear (rect_x + 2, y1 + 1, rect_x + 2, y2 - 7.25); - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4); + draw_curved_rectangle ( + cr, cx0, cy0, rect_width, rect_height, radius); + + pat = cairo_pattern_create_linear ( + rect_x + 2, y1 + 1, rect_x + 2, y2 - 7.25); + cairo_pattern_add_color_stop_rgba ( + pat, 1, red/cc, green/cc, blue/cc, 0.8); + cairo_pattern_add_color_stop_rgba ( + pat, 0, red/cc, green/cc, blue/cc, 0.4); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); @@ -938,11 +944,15 @@ week_view_event_item_draw (GnomeCanvasItem *canvas_item, if (can_draw_in_region (draw_region, cx0, cy0, rect_width, rect_height)) { cairo_save (cr); - draw_curved_rectangle (cr, cx0, cy0, rect_width, rect_height, radius); - - pat = cairo_pattern_create_linear (rect_x + 2, y1 + 1, rect_x + 2, y2 - 7.25); - cairo_pattern_add_color_stop_rgba (pat, 1, red/cc, green/cc, blue/cc, 0.8); - cairo_pattern_add_color_stop_rgba (pat, 0, red/cc, green/cc, blue/cc, 0.4); + draw_curved_rectangle ( + cr, cx0, cy0, rect_width, rect_height, radius); + + pat = cairo_pattern_create_linear ( + rect_x + 2, y1 + 1, rect_x + 2, y2 - 7.25); + cairo_pattern_add_color_stop_rgba ( + pat, 1, red/cc, green/cc, blue/cc, 0.8); + cairo_pattern_add_color_stop_rgba ( + pat, 0, red/cc, green/cc, blue/cc, 0.4); cairo_set_source (cr, pat); cairo_fill_preserve (cr); cairo_pattern_destroy (pat); diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index ee0cd400e9..03cf3b56d4 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -90,8 +90,9 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, /* Set up Pango prerequisites */ font_desc = pango_font_description_copy (style->font_desc); pango_context = gtk_widget_get_pango_context (GTK_WIDGET (week_view)); - font_metrics = pango_context_get_metrics (pango_context, font_desc, - pango_context_get_language (pango_context)); + font_metrics = pango_context_get_metrics ( + pango_context, font_desc, + pango_context_get_language (pango_context)); day_of_week = gdate_to_cal_weekdays (g_date_get_weekday (date)); month = g_date_get_month (date); @@ -102,11 +103,16 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, E_WEEK_VIEW_DATE_LINE_T_PAD; if (!today) { + ECalendarView *view; struct icaltimetype tt; + const icaltimezone *zone; + + view = E_CALENDAR_VIEW (week_view); + zone = e_calendar_view_get_timezone (view); /* Check if we are drawing today */ - tt = icaltime_from_timet_with_zone (time (NULL), FALSE, - e_calendar_view_get_timezone (E_CALENDAR_VIEW (week_view))); + tt = icaltime_from_timet_with_zone ( + time (NULL), FALSE, zone); today = g_date_get_year (date) == tt.year && g_date_get_month (date) == tt.month && g_date_get_day (date) == tt.day; diff --git a/calendar/gui/ea-cal-view-event.c b/calendar/gui/ea-cal-view-event.c index bd73d59674..6682681483 100644 --- a/calendar/gui/ea-cal-view-event.c +++ b/calendar/gui/ea-cal-view-event.c @@ -299,9 +299,11 @@ ea_cal_view_event_get_name (AtkObject *accessible) summary = icalcomponent_get_summary (event->comp_data->icalcomp); if (summary) - summary_string = g_strdup_printf (_("Calendar Event: Summary is %s."), summary); + summary_string = g_strdup_printf ( + _("Calendar Event: Summary is %s."), summary); else - summary_string = g_strdup (_("Calendar Event: It has no summary.")); + summary_string = g_strdup ( + _("Calendar Event: It has no summary.")); name_string = g_strdup_printf ( "%s %s %s %s", summary_string, diff --git a/calendar/gui/ea-calendar.c b/calendar/gui/ea-calendar.c index dbc20fd9a6..423e2dfbd7 100644 --- a/calendar/gui/ea-calendar.c +++ b/calendar/gui/ea-calendar.c @@ -75,29 +75,30 @@ gnome_calendar_a11y_init (void) e_week_view_main_item_type = g_type_class_ref ( e_week_view_main_item_get_type ()); - g_signal_add_emission_hook (g_signal_lookup ("event", E_TYPE_TEXT), - 0, ea_calendar_focus_watcher, - NULL, (GDestroyNotify) NULL); - g_signal_add_emission_hook (g_signal_lookup ("event", GNOME_TYPE_CANVAS_PIXBUF), - 0, ea_calendar_focus_watcher, - NULL, (GDestroyNotify) NULL); - g_signal_add_emission_hook (g_signal_lookup ("event-after", - e_day_view_get_type ()), - 0, ea_calendar_focus_watcher, - NULL, (GDestroyNotify) NULL); - g_signal_add_emission_hook (g_signal_lookup ("event", - e_day_view_main_item_get_type ()), - 0, ea_calendar_focus_watcher, - NULL, (GDestroyNotify) NULL); - g_signal_add_emission_hook (g_signal_lookup ("event-after", - E_TYPE_WEEK_VIEW), - 0, ea_calendar_focus_watcher, - NULL, (GDestroyNotify) NULL); - g_signal_add_emission_hook (g_signal_lookup ("event", - e_week_view_main_item_get_type ()), - 0, ea_calendar_focus_watcher, - NULL, (GDestroyNotify) NULL); - + g_signal_add_emission_hook ( + g_signal_lookup ("event", E_TYPE_TEXT), + 0, ea_calendar_focus_watcher, + NULL, (GDestroyNotify) NULL); + g_signal_add_emission_hook ( + g_signal_lookup ("event", GNOME_TYPE_CANVAS_PIXBUF), + 0, ea_calendar_focus_watcher, + NULL, (GDestroyNotify) NULL); + g_signal_add_emission_hook ( + g_signal_lookup ("event-after", E_TYPE_DAY_VIEW), + 0, ea_calendar_focus_watcher, + NULL, (GDestroyNotify) NULL); + g_signal_add_emission_hook ( + g_signal_lookup ("event", E_TYPE_DAY_VIEW_MAIN_ITEM), + 0, ea_calendar_focus_watcher, + NULL, (GDestroyNotify) NULL); + g_signal_add_emission_hook ( + g_signal_lookup ("event-after", E_TYPE_WEEK_VIEW), + 0, ea_calendar_focus_watcher, + NULL, (GDestroyNotify) NULL); + g_signal_add_emission_hook ( + g_signal_lookup ("event", E_TYPE_WEEK_VIEW_MAIN_ITEM), + 0, ea_calendar_focus_watcher, + NULL, (GDestroyNotify) NULL); } } diff --git a/calendar/gui/ea-day-view-main-item.c b/calendar/gui/ea-day-view-main-item.c index 6ea15a4b8d..36abbc0954 100644 --- a/calendar/gui/ea-day-view-main-item.c +++ b/calendar/gui/ea-day-view-main-item.c @@ -1124,7 +1124,8 @@ table_interface_get_row_description (AtkTable *table, description = ea_cell_table_get_row_label (cell_data, row); if (!description) { gchar buffer[128]; - ea_day_view_main_item_get_row_label (ea_main_item, row, buffer, sizeof (buffer)); + ea_day_view_main_item_get_row_label ( + ea_main_item, row, buffer, sizeof (buffer)); ea_cell_table_set_row_label (cell_data, row, buffer); description = ea_cell_table_get_row_label (cell_data, row); diff --git a/calendar/gui/gnome-cal.c b/calendar/gui/gnome-cal.c index 789fbcc451..ffbc449584 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -1058,8 +1058,9 @@ free_dn_queries (GnomeCalendar *gcal) for (l = priv->dn_queries; l != NULL; l = l->next) { if (!l->data) continue; - g_signal_handlers_disconnect_matched ((ECalView *) l->data, G_SIGNAL_MATCH_DATA, - 0, 0, NULL, NULL, gcal); + g_signal_handlers_disconnect_matched ( + l->data, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, gcal); g_object_unref (l->data); } @@ -2262,12 +2263,16 @@ gnome_calendar_purge (GnomeCalendar *gcal, time_t older_than) if (e_cal_util_component_is_instance (m->data) || e_cal_util_component_has_recurrences (m->data)) { gchar *rid = NULL; - struct icaltimetype recur_id = icalcomponent_get_recurrenceid (m->data); + struct icaltimetype recur_id; + + recur_id = icalcomponent_get_recurrenceid (m->data); if (!icaltime_is_null_time (recur_id) ) rid = icaltime_as_ical_string_r (recur_id); - e_cal_remove_object_with_mod (client, uid, rid, CALOBJ_MOD_ALL, &error); + e_cal_remove_object_with_mod ( + client, uid, rid, + CALOBJ_MOD_ALL, &error); g_free (rid); } else { e_cal_remove_object (client, uid, &error); diff --git a/calendar/gui/gnome-cal.h b/calendar/gui/gnome-cal.h index 042282bc70..92f6f3ad36 100644 --- a/calendar/gui/gnome-cal.h +++ b/calendar/gui/gnome-cal.h @@ -120,9 +120,11 @@ void gnome_calendar_set_date_navigator (GnomeCalendar *gcal, ECalendar *date_navigator); GtkWidget * gnome_calendar_get_memo_table (GnomeCalendar *gcal); -void gnome_calendar_set_memo_table (GnomeCalendar *gcal, GtkWidget *memo_table); +void gnome_calendar_set_memo_table (GnomeCalendar *gcal, + GtkWidget *memo_table); GtkWidget * gnome_calendar_get_task_table (GnomeCalendar *gcal); -void gnome_calendar_set_task_table (GnomeCalendar *gcal, GtkWidget *task_table); +void gnome_calendar_set_task_table (GnomeCalendar *gcal, + GtkWidget *task_table); ECalModel * gnome_calendar_get_model (GnomeCalendar *gcal); void gnome_calendar_update_query (GnomeCalendar *gcal); void gnome_calendar_set_search_query (GnomeCalendar *gcal, diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 2bc566b771..4d56645b38 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -567,20 +567,26 @@ comp_to_list (ECalComponentItipMethod method, for (l = attendees; l != NULL; l = l->next) { ECalComponentAttendee *att = l->data; - if (att->cutype != ICAL_CUTYPE_INDIVIDUAL && att->cutype != ICAL_CUTYPE_GROUP) + if (att->cutype != ICAL_CUTYPE_INDIVIDUAL && + att->cutype != ICAL_CUTYPE_GROUP) continue; else if (users_has_attendee (users, att->value)) continue; - else if (att->sentby && users_has_attendee (users, att->sentby)) + else if (att->sentby && + users_has_attendee (users, att->sentby)) continue; - else if (!g_ascii_strcasecmp (att->value, organizer.value)) + else if (!g_ascii_strcasecmp ( + att->value, organizer.value)) continue; - else if (att->sentby && !g_ascii_strcasecmp (att->sentby, organizer.sentby)) + else if (att->sentby && !g_ascii_strcasecmp ( + att->sentby, organizer.sentby)) continue; - else if (!g_ascii_strcasecmp (itip_strip_mailto (att->value), sender)) + else if (!g_ascii_strcasecmp ( + itip_strip_mailto (att->value), sender)) continue; - else if (att->status == ICAL_PARTSTAT_DELEGATED && (att->delto && *att->delto) - && !(att->rsvp) && method == E_CAL_COMPONENT_METHOD_REQUEST) + else if (att->status == ICAL_PARTSTAT_DELEGATED && + (att->delto && *att->delto) && !(att->rsvp) && + method == E_CAL_COMPONENT_METHOD_REQUEST) continue; else if (only_attendees && !comp_editor_have_in_new_attendees_lst ( @@ -673,7 +679,8 @@ comp_to_list (ECalComponentItipMethod method, for (l = attendees; l != NULL; l = l->next) { ECalComponentAttendee *att = l->data; - if (att->cutype != ICAL_CUTYPE_INDIVIDUAL && att->cutype != ICAL_CUTYPE_GROUP) + if (att->cutype != ICAL_CUTYPE_INDIVIDUAL && + att->cutype != ICAL_CUTYPE_GROUP) continue; if (!g_ascii_strcasecmp ( @@ -1079,7 +1086,8 @@ comp_sentby (ECalComponent *comp, ECal *client) } } - if (!itip_organizer_is_user (comp, client) && !itip_sentby_is_user (comp, client)) { + if (!itip_organizer_is_user (comp, client) && + !itip_sentby_is_user (comp, client)) { EAccount *a = e_get_default_account (); organizer.value = g_strdup (organizer.value); diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 0be794727e..a4d4fd61c8 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -746,20 +746,27 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, } if (day != 0) { - time_t week_begin = time_week_begin_with_zone (now, week_start_day, zone); + time_t week_begin; - convert_timet_to_struct_tm (week_begin, zone, &tm); + week_begin = time_week_begin_with_zone ( + now, week_start_day, zone); - /* month in e_calendar_item_get_week_number is also zero-based */ + convert_timet_to_struct_tm ( + week_begin, zone, &tm); + + /* Month in e_calendar_item_get_week_number + * is also zero-based. */ sprintf ( buf, "%d", e_calendar_item_get_week_number ( NULL, tm.tm_mday, tm.tm_mon, tm.tm_year + 1900)); - print_text (context, font_normal, buf, PANGO_ALIGN_RIGHT, - cell_left, text_right, - cell_top, cell_bottom); + print_text ( + context, font_normal, + buf, PANGO_ALIGN_RIGHT, + cell_left, text_right, + cell_top, cell_bottom); } } @@ -1766,7 +1773,9 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font, + psi->rows_per_cell * (psi->row_height + 2); if (span->row >= psi->rows_per_compressed_cell && psi->compress_weekend) { - gint end_day_of_week = (psi->display_start_weekday + span->start_day) % 7; + gint end_day_of_week = + (psi->display_start_weekday + + span->start_day) % 7; if (end_day_of_week == 5 || end_day_of_week == 6) { /* Sat or Sun */ diff --git a/composer/e-composer-private.c b/composer/e-composer-private.c index 08cdd47e1f..693fd959f5 100644 --- a/composer/e-composer-private.c +++ b/composer/e-composer-private.c @@ -318,7 +318,8 @@ e_composer_private_constructed (EMsgComposer *composer) /* Construct the attachment paned. */ if (small_screen_mode) { - e_attachment_paned_set_default_height (75); /* short attachment bar for Anjal */ + /* short attachment bar for Anjal */ + e_attachment_paned_set_default_height (75); e_attachment_icon_view_set_default_icon_size (GTK_ICON_SIZE_BUTTON); } diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index 92cf04d661..5ff7427108 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -467,11 +467,16 @@ set_recipients_from_destv (CamelMimeMessage *msg, } } - header = redirect ? CAMEL_RECIPIENT_TYPE_RESENT_TO : CAMEL_RECIPIENT_TYPE_TO; + if (redirect) + header = CAMEL_RECIPIENT_TYPE_RESENT_TO; + else + header = CAMEL_RECIPIENT_TYPE_TO; + if (camel_address_length (CAMEL_ADDRESS (to_addr)) > 0) { camel_mime_message_set_recipients (msg, header, to_addr); } else if (seen_hidden_list) { - camel_medium_set_header (CAMEL_MEDIUM (msg), header, "Undisclosed-Recipient:;"); + camel_medium_set_header ( + CAMEL_MEDIUM (msg), header, "Undisclosed-Recipient:;"); } header = redirect ? CAMEL_RECIPIENT_TYPE_RESENT_CC : CAMEL_RECIPIENT_TYPE_CC; @@ -3056,7 +3061,8 @@ handle_multipart (EMsgComposer *composer, composer, mime_part, cancellable, depth + 1); - } else if (camel_content_type_is (content_type, "multipart", "alternative")) { + } else if (camel_content_type_is ( + content_type, "multipart", "alternative")) { handle_multipart_alternative ( composer, mp, cancellable, depth + 1); @@ -3079,7 +3085,8 @@ handle_multipart (EMsgComposer *composer, } else if (camel_mime_part_get_content_id (mime_part) || camel_mime_part_get_content_location (mime_part)) { /* special in-line attachment */ - e_msg_composer_add_inline_image_from_mime_part (composer, mime_part); + e_msg_composer_add_inline_image_from_mime_part ( + composer, mime_part); } else { /* normal attachment */ e_msg_composer_attach (composer, mime_part); @@ -3151,9 +3158,16 @@ e_msg_composer_new_with_message (EShell *shell, g_return_val_if_fail (E_IS_SHELL (shell), NULL); - for (headers = CAMEL_MIME_PART (message)->headers;headers;headers = headers->next) { - if (!strcmp (headers->name, "X-Evolution-PostTo")) - postto = g_list_append (postto, g_strstrip (g_strdup (headers->value))); + headers = CAMEL_MIME_PART (message)->headers; + while (headers != NULL) { + gchar *value; + + if (strcmp (headers->name, "X-Evolution-PostTo") == 0) { + value = g_strstrip (g_strdup (headers->value)); + postto = g_list_append (postto, value); + } + + headers = headers->next; } composer = e_msg_composer_new (shell); diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c index 9a47e81fc4..60867315b0 100644 --- a/e-util/e-dialog-widgets.c +++ b/e-util/e-dialog-widgets.c @@ -79,7 +79,6 @@ e_dialog_editable_set (GtkWidget *widget, const gchar *value) { gint pos = 0; - g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_EDITABLE (widget)); gtk_editable_delete_text (GTK_EDITABLE (widget), 0, -1); @@ -101,7 +100,6 @@ e_dialog_editable_set (GtkWidget *widget, const gchar *value) gchar * e_dialog_editable_get (GtkWidget *widget) { - g_return_val_if_fail (widget != NULL, NULL); g_return_val_if_fail (GTK_IS_EDITABLE (widget), NULL); return gtk_editable_get_chars (GTK_EDITABLE (widget), 0, -1); @@ -122,7 +120,6 @@ e_dialog_combo_box_set (GtkWidget *widget, gint value, const gint *value_map) { gint i; - g_return_if_fail (widget != NULL); g_return_if_fail (GTK_IS_COMBO_BOX (widget)); g_return_if_fail (value_map != NULL); @@ -131,8 +128,9 @@ e_dialog_combo_box_set (GtkWidget *widget, gint value, const gint *value_map) if (i != -1) gtk_combo_box_set_active (GTK_COMBO_BOX (widget), i); else - g_message ("e_dialog_combo_box_set(): could not find value %d in value map!", - value); + g_message ( + "e_dialog_combo_box_set(): could not " + "find value %d in value map!", value); } /** @@ -150,17 +148,22 @@ e_dialog_combo_box_set (GtkWidget *widget, gint value, const gint *value_map) gint e_dialog_combo_box_get (GtkWidget *widget, const gint *value_map) { + gint active; gint i; - g_return_val_if_fail (widget != NULL, -1); g_return_val_if_fail (GTK_IS_COMBO_BOX (widget), -1); g_return_val_if_fail (value_map != NULL, -1); - i = index_to_value (value_map, gtk_combo_box_get_active (GTK_COMBO_BOX (widget))); + active = gtk_combo_box_get_active (GTK_COMBO_BOX (widget)); + i = index_to_value (value_map, active); + if (i == -1) { - g_message ("e_dialog_combo_box_get(): could not find index %d in value map!", i); + g_message ( + "e_dialog_combo_box_get(): could not " + "find index %d in value map!", i); return -1; } + return i; } @@ -178,7 +181,6 @@ e_dialog_append_list_store_text (GtkTreeModel *list_store, GtkTreeIter iter; GtkListStore *store; - g_return_if_fail (list_store != NULL); g_return_if_fail (GTK_IS_LIST_STORE (list_store)); g_return_if_fail (text_column >= 0); g_return_if_fail (text_value != NULL); diff --git a/e-util/e-plugin.c b/e-util/e-plugin.c index e0f1aecd22..52bbe101cb 100644 --- a/e-util/e-plugin.c +++ b/e-util/e-plugin.c @@ -408,7 +408,8 @@ ep_load (const gchar *filename, gint load_level) ep = ep_load_plugin (root, pdoc); if (ep && load_level == 1) - e_plugin_invoke (ep, "load_plugin_type_register_function", NULL); + e_plugin_invoke ( + ep, "load_plugin_type_register_function", NULL); } } else if (load_level == 2) { ep = ep_load_plugin (root, pdoc); diff --git a/em-format/em-format.c b/em-format/em-format.c index 13b1febd84..be3e935728 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -1135,13 +1135,18 @@ em_format_is_attachment (EMFormat *emf, /*printf("checking is attachment %s/%s\n", ct->type, ct->subtype);*/ return !(camel_content_type_is (dw->mime_type, "multipart", "*") - || camel_content_type_is(dw->mime_type, "application", "x-pkcs7-mime") - || camel_content_type_is(dw->mime_type, "application", "pkcs7-mime") - || camel_content_type_is(dw->mime_type, "application", "x-inlinepgp-signed") - || camel_content_type_is(dw->mime_type, "application", "x-inlinepgp-encrypted") - || camel_content_type_is(dw->mime_type, "x-evolution", "evolution-rss-feed") - || camel_content_type_is(dw->mime_type, "text", "calendar") - || camel_content_type_is(dw->mime_type, "text", "x-calendar") + || camel_content_type_is ( + dw->mime_type, "application", "x-pkcs7-mime") + || camel_content_type_is ( + dw->mime_type, "application", "pkcs7-mime") + || camel_content_type_is ( + dw->mime_type, "application", "x-inlinepgp-signed") + || camel_content_type_is ( + dw->mime_type, "application", "x-inlinepgp-encrypted") + || camel_content_type_is ( + dw->mime_type, "x-evolution", "evolution-rss-feed") + || camel_content_type_is (dw->mime_type, "text", "calendar") + || camel_content_type_is (dw->mime_type, "text", "x-calendar") || (camel_content_type_is (dw->mime_type, "text", "*") && camel_mime_part_get_filename (part) == NULL)); } @@ -2179,7 +2184,8 @@ emf_inlinepgp_signed (EMFormat *emf, em_format_format_error ( emf, stream, "%s", local_error->message); em_format_format_source (emf, stream, ipart, cancellable); - /* I think this will loop: em_format_part_as(emf, stream, part, "text/plain"); */ + /* XXX I think this will loop: + * em_format_part_as(emf, stream, part, "text/plain"); */ g_clear_error (&local_error); g_object_unref (cipher); return; @@ -2273,7 +2279,8 @@ emf_inlinepgp_encrypted (EMFormat *emf, em_format_format_error ( emf, stream, _("Unknown error")); em_format_format_source (emf, stream, ipart, cancellable); - /* I think this will loop: em_format_part_as(emf, stream, part, "text/plain"); */ + /* XXX I think this will loop: + * em_format_part_as(emf, stream, part, "text/plain"); */ g_clear_error (&local_error); g_object_unref (cipher); diff --git a/filter/e-filter-rule.c b/filter/e-filter-rule.c index 590ed597ee..1a7441face 100644 --- a/filter/e-filter-rule.c +++ b/filter/e-filter-rule.c @@ -116,7 +116,9 @@ part_combobox_changed (GtkComboBox *combobox, data->part = newpart; data->partwidget = e_filter_part_get_widget (newpart); if (data->partwidget) - gtk_box_pack_start (GTK_BOX (data->container), data->partwidget, TRUE, TRUE, 0); + gtk_box_pack_start ( + GTK_BOX (data->container), + data->partwidget, TRUE, TRUE, 0); } static GtkWidget * diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c index 804dc2ed65..712ecfa039 100644 --- a/filter/e-rule-context.c +++ b/filter/e-rule-context.c @@ -254,7 +254,8 @@ rule_context_load (ERuleContext *context, } rule = rule->next; } - } else if ((rule_map = g_hash_table_lookup (context->rule_set_map, set->name))) { + } else if ((rule_map = g_hash_table_lookup ( + context->rule_set_map, set->name))) { rule = set->children; while (rule) { if (!strcmp ((gchar *)rule->name, "rule")) { @@ -404,12 +405,20 @@ rule_context_revert (ERuleContext *context, rest_data = g_hash_table_lookup (source_hash, part->source); if (rest_data == NULL) { rest_data = g_malloc0 (sizeof (*rest_data)); - rest_data->rules = g_hash_table_new (g_str_hash, g_str_equal); - g_hash_table_insert (source_hash, part->source, rest_data); + rest_data->rules = g_hash_table_new ( + g_str_hash, + g_str_equal); + g_hash_table_insert ( + source_hash, + part->source, + rest_data); } - frule = g_hash_table_lookup (rest_data->rules, part->name); + frule = g_hash_table_lookup ( + rest_data->rules, + part->name); if (frule) { - if (context->priv->frozen == 0 && !e_filter_rule_eq (frule, part)) + if (context->priv->frozen == 0 && + !e_filter_rule_eq (frule, part)) e_filter_rule_copy (frule, part); g_object_unref (part); diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c index b61ce2a25c..adb01548fc 100644 --- a/libgnomecanvas/gnome-canvas-text.c +++ b/libgnomecanvas/gnome-canvas-text.c @@ -245,7 +245,8 @@ gnome_canvas_text_class_init (GnomeCanvasTextClass *class) PROP_FAMILY, g_param_spec_string ("family", "Font family", - "Name of the font family, e.g. Sans, Helvetica, Times, Monospace", + "Name of the font family, e.g. " + "Sans, Helvetica, Times, Monospace", NULL, (G_PARAM_READABLE | G_PARAM_WRITABLE))); @@ -1174,8 +1175,9 @@ gnome_canvas_text_set_markup (GnomeCanvasText *textitem, &attr_list, &text, NULL, &error)) { - g_warning ("Failed to set cell text from markup due to error parsing markup: %s", - error->message); + g_warning ( + "Failed to set cell text from markup due to " + "error parsing markup: %s", error->message); g_error_free (error); return; } diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index bf4f1865be..a0ad066f44 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -1167,7 +1167,8 @@ gnome_canvas_item_request_update (GnomeCanvasItem *item) /* Recurse up the tree */ gnome_canvas_item_request_update (item->parent); } else { - /* Have reached the top of the tree, make sure the update call gets scheduled. */ + /* Have reached the top of the tree, make + * sure the update call gets scheduled. */ gnome_canvas_request_update (item->canvas); } } @@ -1536,7 +1537,10 @@ gnome_canvas_group_point (GnomeCanvasItem *item, for (list = g_list_last (group->item_list); list; list = list->prev) { child = list->data; - if ((child->x1 > cx) || (child->y1 > cy) || (child->x2 < cx) || (child->y2 < cy)) + if ((child->x1 > cx) || (child->y1 > cy)) + continue; + + if ((child->x2 < cx) || (child->y2 < cy)) continue; if (!(child->flags & GNOME_CANVAS_ITEM_VISIBLE)) @@ -2466,7 +2470,8 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) * synthesize an enter event. */ if (event != &canvas->pick_event) { - if ((event->type == GDK_MOTION_NOTIFY) || (event->type == GDK_BUTTON_RELEASE)) { + if ((event->type == GDK_MOTION_NOTIFY) || + (event->type == GDK_BUTTON_RELEASE)) { /* these fields have the same offsets in both types of events */ canvas->pick_event.crossing.type = GDK_ENTER_NOTIFY; diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c index d0b58e7b54..9553c8b62a 100644 --- a/mail/e-mail-migrate.c +++ b/mail/e-mail-migrate.c @@ -337,7 +337,11 @@ em_update_accounts_2_11 (void) if (g_str_has_prefix (account->source->url, "spool://")) { if (g_file_test (account->source->url + 8, G_FILE_TEST_IS_DIR)) { - gchar *str = g_strdup_printf ("spooldir://%s", account->source->url + 8); + gchar *str; + + str = g_strdup_printf ( + "spooldir://%s", + account->source->url + 8); g_free (account->source->url); account->source->url = str; @@ -890,7 +894,9 @@ copy_folders (CamelStore *mbox_store, /* sanitize folder names and copy folders */ maildir_folder_name = sanitize_maildir_folder_name (fi->full_name); - copy_folder (mbox_store, maildir_store, fi->full_name, maildir_folder_name); + copy_folder ( + mbox_store, maildir_store, + fi->full_name, maildir_folder_name); g_free (maildir_folder_name); } diff --git a/mail/e-mail-notebook-view.c b/mail/e-mail-notebook-view.c index 5a172e78c1..66bf9358f3 100644 --- a/mail/e-mail-notebook-view.c +++ b/mail/e-mail-notebook-view.c @@ -971,7 +971,8 @@ mail_netbook_view_open_mail (EMailView *view, #endif #if HAVE_CLUTTER - tab = (EMailTab *) e_mail_tab_new_full (camel_message_info_subject (info), NULL, 1); + tab = (EMailTab *) e_mail_tab_new_full ( + camel_message_info_subject (info), NULL, 1); g_object_set_data ((GObject *)tab, "page", pane); g_object_set_data ((GObject *)pane, "tab", tab); @@ -1046,7 +1047,9 @@ build_histogram (GtkWidget *widget, CamelFolder *folder) uids = camel_folder_get_uids (folder); camel_folder_summary_prepare_fetch_all (folder->summary, NULL); for (i = 0; i < uids->len; i++) { - CamelMessageInfo *info = camel_folder_get_message_info (folder, uids->pdata[i]); + CamelMessageInfo *info; + + info = camel_folder_get_message_info (folder, uids->pdata[i]); if (info) { time_t dreceived = now - camel_message_info_date_received (info); gint week; @@ -1451,11 +1454,15 @@ emnv_close_tab (EMailNotebookView *view, gpointer not_used) EMailNotebookViewPrivate *priv = view->priv; #if HAVE_CLUTTER - mnv_tab_closed (g_object_get_data((GObject *)priv->current_view, "tab"), - view); + mnv_tab_closed ( + g_object_get_data ( + G_OBJECT (priv->current_view), "tab"), + view); #else - tab_remove_gtk_cb (g_object_get_data((GObject *)priv->current_view, "close-button"), - view); + tab_remove_gtk_cb ( + g_object_get_data ( + G_OBJECT (priv->current_view), "close-button"), + view); #endif } diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c index af66b333f3..061311c820 100644 --- a/mail/e-mail-session.c +++ b/mail/e-mail-session.c @@ -367,8 +367,11 @@ main_get_filter_driver (CamelSession *session, continue; e_filter_rule_build_code (rule, fsearch); - em_filter_rule_build_action ((EMFilterRule *) rule, faction); - camel_filter_driver_add_rule (driver, rule->name, fsearch->str, faction->str); + em_filter_rule_build_action ( + EM_FILTER_RULE (rule), faction); + camel_filter_driver_add_rule ( + driver, rule->name, + fsearch->str, faction->str); } g_string_free (fsearch, TRUE); @@ -442,8 +445,9 @@ set_socks_proxy_from_gconf (CamelSession *session) mode = gconf_client_get_string (client, MODE_PROXY, NULL); if (!g_strcmp0(mode, "manual")) { - host = gconf_client_get_string (client, KEY_SOCKS_HOST, NULL); /* NULL-GError */ - port = gconf_client_get_int (client, KEY_SOCKS_PORT, NULL); /* NULL-GError */ + /* FIXME Pass GErrors */ + host = gconf_client_get_string (client, KEY_SOCKS_HOST, NULL); + port = gconf_client_get_int (client, KEY_SOCKS_PORT, NULL); camel_session_set_socks_proxy (session, host, port); g_free (host); } diff --git a/mail/e-mail-tab-picker.c b/mail/e-mail-tab-picker.c index 5bf173253a..160a03df6a 100644 --- a/mail/e-mail-tab-picker.c +++ b/mail/e-mail-tab-picker.c @@ -111,6 +111,7 @@ e_mail_tab_picker_drop (MxDroppable *droppable, { GList *t; EMailTabPickerProps *tab; + ClutterActor *parent; gint current_position, new_position; EMailTabPicker *picker = E_MAIL_TAB_PICKER (droppable); @@ -123,7 +124,8 @@ e_mail_tab_picker_drop (MxDroppable *droppable, if (!E_MAIL_IS_TAB (draggable)) return; - if (clutter_actor_get_parent (CLUTTER_ACTOR (draggable)) != (ClutterActor *) picker) + parent = clutter_actor_get_parent (CLUTTER_ACTOR (draggable)); + if (parent != (ClutterActor *) picker) return; /* Get current position and property data structure */ diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 1ab739185f..08fa927a67 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1060,7 +1060,10 @@ replace_variables (GSList *clues, CamelMimeMessage *message, gchar **pstr) if (!count1) { if (getenv (out+1)) { g_free (str); - str = g_strconcat (temp_str[0], getenv (out + 1), temp_str[1], NULL); + str = g_strconcat ( + temp_str[0], + getenv (out + 1), + temp_str[1], NULL); count1 = TRUE; string_changed = TRUE; } else @@ -1071,7 +1074,8 @@ replace_variables (GSList *clues, CamelMimeMessage *message, gchar **pstr) CamelInternetAddress *to; const gchar *name, *addr; - to = camel_mime_message_get_recipients (message, CAMEL_RECIPIENT_TYPE_TO); + to = camel_mime_message_get_recipients ( + message, CAMEL_RECIPIENT_TYPE_TO); if (!camel_internet_address_get (to, 0, &name, &addr)) continue; @@ -2314,21 +2318,30 @@ get_reply_sender (CamelMimeMessage *message, CamelNNTPAddress *postto) { CamelInternetAddress *reply_to; - const gchar *name, *addr, *posthdr; - gint i; + CamelMedium *medium; + const gchar *name, *addr; + const gchar *posthdr = NULL; + + medium = CAMEL_MEDIUM (message); /* check whether there is a 'Newsgroups: ' header in there */ - if (postto - && ((posthdr = camel_medium_get_header((CamelMedium *)message, "Followup-To")) - || (posthdr = camel_medium_get_header((CamelMedium *)message, "Newsgroups")))) { - camel_address_decode ((CamelAddress *) postto, posthdr); + if (postto != NULL && posthdr == NULL) + posthdr = camel_medium_get_header (medium, "Followup-To"); + + if (postto != NULL && posthdr == NULL) + posthdr = camel_medium_get_header (medium, "Newsgroups"); + + if (postto != NULL && posthdr != NULL) { + camel_address_decode (CAMEL_ADDRESS (postto), posthdr); return; } reply_to = get_reply_to (message); - if (reply_to) { - for (i = 0; camel_internet_address_get (reply_to, i, &name, &addr); i++) + if (reply_to != NULL) { + gint ii; + + while (camel_internet_address_get (reply_to, ii++, &name, &addr)) camel_internet_address_add (to, name, addr); } } @@ -2347,21 +2360,30 @@ get_reply_from (CamelMimeMessage *message, CamelNNTPAddress *postto) { CamelInternetAddress *from; - const gchar *name, *addr, *posthdr; - gint i; + CamelMedium *medium; + const gchar *name, *addr; + const gchar *posthdr = NULL; + + medium = CAMEL_MEDIUM (message); /* check whether there is a 'Newsgroups: ' header in there */ - if (postto - && ((posthdr = camel_medium_get_header((CamelMedium *)message, "Followup-To")) - || (posthdr = camel_medium_get_header((CamelMedium *)message, "Newsgroups")))) { - camel_address_decode ((CamelAddress *) postto, posthdr); + if (postto != NULL && posthdr == NULL) + posthdr = camel_medium_get_header (medium, "Followup-To"); + + if (postto != NULL && posthdr == NULL) + posthdr = camel_medium_get_header (medium, "Newsgroups"); + + if (postto != NULL && posthdr != NULL) { + camel_address_decode (CAMEL_ADDRESS (postto), posthdr); return; } from = camel_mime_message_get_from (message); - if (from) { - for (i = 0; camel_internet_address_get (from, i, &name, &addr); i++) + if (from != NULL) { + gint ii; + + while (camel_internet_address_get (from, ii++, &name, &addr)) camel_internet_address_add (to, name, addr); } } @@ -2594,48 +2616,63 @@ attribution_format (CamelMimeMessage *message) switch (type) { case ATTRIB_CUSTOM: - attribvars[i].v.formatter (str, attribvars[i].name, message); + attribvars[i].v.formatter ( + str, attribvars[i].name, message); break; case ATTRIB_TIMEZONE: - g_string_append_printf (str, attribvars[i].v.format, tzone); + g_string_append_printf ( + str, attribvars[i].v.format, tzone); break; case ATTRIB_STRFTIME: - e_utf8_strftime (buf, sizeof (buf), attribvars[i].v.format, &tm); + e_utf8_strftime ( + buf, sizeof (buf), attribvars[i].v.format, &tm); g_string_append (str, buf); break; case ATTRIB_TM_SEC: - g_string_append_printf (str, attribvars[i].v.format, tm.tm_sec); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_sec); break; case ATTRIB_TM_MIN: - g_string_append_printf (str, attribvars[i].v.format, tm.tm_min); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_min); break; case ATTRIB_TM_24HOUR: - g_string_append_printf (str, attribvars[i].v.format, tm.tm_hour); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_hour); break; case ATTRIB_TM_12HOUR: - g_string_append_printf (str, attribvars[i].v.format, (tm.tm_hour + 1) % 13); + g_string_append_printf ( + str, attribvars[i].v.format, + (tm.tm_hour + 1) % 13); break; case ATTRIB_TM_MDAY: - g_string_append_printf (str, attribvars[i].v.format, tm.tm_mday); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_mday); break; case ATTRIB_TM_MON: - g_string_append_printf (str, attribvars[i].v.format, tm.tm_mon + 1); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_mon + 1); break; case ATTRIB_TM_YEAR: - g_string_append_printf (str, attribvars[i].v.format, tm.tm_year + 1900); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_year + 1900); break; case ATTRIB_TM_2YEAR: - g_string_append_printf (str, attribvars[i].v.format, tm.tm_year % 100); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_year % 100); break; case ATTRIB_TM_WDAY: /* not actually used */ - g_string_append_printf (str, attribvars[i].v.format, tm.tm_wday); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_wday); break; case ATTRIB_TM_YDAY: - g_string_append_printf (str, attribvars[i].v.format, tm.tm_yday + 1); + g_string_append_printf ( + str, attribvars[i].v.format, tm.tm_yday + 1); break; default: - /* mis-spelled variable? drop the format argument and continue */ + /* Misspelled variable? Drop the + * format argument and continue. */ break; } } @@ -2704,15 +2741,24 @@ composer_set_body (EMsgComposer *composer, if (has_body_text && start_bottom) { GtkhtmlEditor *editor = GTKHTML_EDITOR (composer); + gboolean move_cursor_to_end; + gboolean top_signature; + const gchar *key; /* If we are placing signature on top, then move cursor to the end, otherwise try to find the signature place and place cursor just before the signature. We added there an empty line already. */ gtkhtml_editor_run_command (editor, "block-selection"); gtkhtml_editor_run_command (editor, "cursor-bod"); - if (gconf_client_get_bool ( - client, "/apps/evolution/mail/composer/top_signature", NULL) - || !gtkhtml_editor_search_by_data (editor, 1, "ClueFlow", "signature", "1")) + + key = "/apps/evolution/mail/composer/top_signature"; + top_signature = gconf_client_get_bool (client, key, NULL); + + move_cursor_to_end = top_signature || + !gtkhtml_editor_search_by_data ( + editor, 1, "ClueFlow", "signature", "1"); + + if (move_cursor_to_end) gtkhtml_editor_run_command (editor, "cursor-eod"); else gtkhtml_editor_run_command (editor, "selection-move-left"); diff --git a/mail/em-filter-rule.c b/mail/em-filter-rule.c index 77b4d971a9..7fec5abccd 100644 --- a/mail/em-filter-rule.c +++ b/mail/em-filter-rule.c @@ -356,7 +356,9 @@ part_combobox_changed (GtkComboBox *combobox, struct _part_data *data) data->part = newpart; data->partwidget = e_filter_part_get_widget (newpart); if (data->partwidget) - gtk_box_pack_start (GTK_BOX (data->container), data->partwidget, TRUE, TRUE, 0); + gtk_box_pack_start ( + GTK_BOX (data->container), + data->partwidget, TRUE, TRUE, 0); } static GtkWidget * diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index d740e265a4..46f3fc82ba 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -2783,8 +2783,11 @@ em_folder_tree_get_selected_uris (EMFolderTree *folder_tree) selection = gtk_tree_view_get_selection (tree_view); /* at first, add lost uris */ - for (sl = folder_tree->priv->select_uris; sl; sl = g_slist_next (sl)) - list = g_list_append (list, g_strdup (((struct _selected_uri *) sl->data)->uri)); + for (sl = folder_tree->priv->select_uris; sl; sl = g_slist_next (sl)) { + const gchar *uri; + uri = ((struct _selected_uri *) sl->data)->uri; + list = g_list_append (list, g_strdup (uri)); + } rows = gtk_tree_selection_get_selected_rows (selection, &model); for (l=rows; l; l=g_list_next (l)) { @@ -2960,7 +2963,11 @@ em_folder_tree_select_next_path (EMFolderTree *folder_tree, gboolean skip_read_f iter = child; } else { while (1) { - gboolean has_parent = gtk_tree_model_iter_parent (model, &parent, &iter); + gboolean has_parent; + + has_parent = gtk_tree_model_iter_parent ( + model, &parent, &iter); + if (gtk_tree_model_iter_next (model, &iter)) { path = gtk_tree_model_get_path (model, &iter); break; diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index 589729bcca..63931fba6d 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -170,9 +170,13 @@ emft_copy_folders__exec (struct _EMCopyFolders *m, pending = g_list_append (pending, info->child); if (m->tobase[0]) - g_string_printf (toname, "%s/%s", m->tobase, info->full_name + fromlen); + g_string_printf ( + toname, "%s/%s", m->tobase, + info->full_name + fromlen); else - g_string_printf (toname, "%s", info->full_name + fromlen); + g_string_printf ( + toname, "%s", + info->full_name + fromlen); d(printf ("Copying from '%s' to '%s'\n", info->full_name, toname->str)); @@ -516,7 +520,7 @@ new_folder_created_cb (CamelStore *store, data = g_object_get_data ( G_OBJECT (context->folder_tree), "select"); expand_only = GPOINTER_TO_INT (data) ? TRUE : FALSE; - + em_folder_tree_set_selected ( context->folder_tree, context->folder_uri, expand_only); diff --git a/mail/em-format-hook.c b/mail/em-format-hook.c index 7d16366c0e..f49c370a6e 100644 --- a/mail/em-format-hook.c +++ b/mail/em-format-hook.c @@ -193,7 +193,8 @@ emfh_construct (EPluginHook *eph, EPlugin *ep, xmlNodePtr root) em_format_class_add_handler (klass, &item->handler); } } - /* We don't actually need to keep this around once its set on the class */ + /* We don't actually need to keep this + * around once its set on the class. */ emfh->groups = g_slist_append (emfh->groups, group); } } diff --git a/mail/em-format-html.h b/mail/em-format-html.h index 37eace367f..68b5b438eb 100644 --- a/mail/em-format-html.h +++ b/mail/em-format-html.h @@ -90,6 +90,9 @@ typedef enum { typedef struct _EMFormatHTMLJob EMFormatHTMLJob; +typedef void (*EMFormatHTMLJobCallback) (EMFormatHTMLJob *job, + GCancellable *cancellable); + /** * struct _EMFormatHTMLJob - A formatting job. * @@ -120,7 +123,7 @@ struct _EMFormatHTMLJob { GNode *puri_level; CamelURL *base; - void (*callback)(EMFormatHTMLJob *job, GCancellable *cancellable); + EMFormatHTMLJobCallback callback; union { gchar *uri; CamelMedium *msg; @@ -275,7 +278,8 @@ EMFormatHTMLPObject * em_format_html_find_pobject (EMFormatHTML *efh, const gchar *classid); EMFormatHTMLPObject * - em_format_html_find_pobject_func (EMFormatHTML *efh, + em_format_html_find_pobject_func + (EMFormatHTML *efh, CamelMimePart *part, EMFormatHTMLPObjectFunc func); void em_format_html_remove_pobject (EMFormatHTML *efh, @@ -283,22 +287,29 @@ void em_format_html_remove_pobject (EMFormatHTML *efh, void em_format_html_clear_pobject (EMFormatHTML *efh); EMFormatHTMLJob * em_format_html_job_new (EMFormatHTML *efh, - void (*callback)(EMFormatHTMLJob *job, GCancellable *cancellable), + EMFormatHTMLJobCallback callback, gpointer data); void em_format_html_job_queue (EMFormatHTML *efh, EMFormatHTMLJob *job); -gboolean em_format_html_get_show_real_date (EMFormatHTML *efh); -void em_format_html_set_show_real_date (EMFormatHTML *efh, +gboolean em_format_html_get_show_real_date + (EMFormatHTML *efh); +void em_format_html_set_show_real_date + (EMFormatHTML *efh, gboolean show_real_date); EMFormatHTMLHeadersState - em_format_html_get_headers_state (EMFormatHTML *efh); -void em_format_html_set_headers_state (EMFormatHTML *efh, - EMFormatHTMLHeadersState state); -gboolean em_format_html_get_headers_collapsable (EMFormatHTML *efh); -void em_format_html_set_headers_collapsable (EMFormatHTML *efh, - gboolean collapsable); - -gchar * em_format_html_format_cert_infos (CamelCipherCertInfo *first_cinfo); + em_format_html_get_headers_state + (EMFormatHTML *efh); +void em_format_html_set_headers_state + (EMFormatHTML *efh, + EMFormatHTMLHeadersState state); +gboolean em_format_html_get_headers_collapsable + (EMFormatHTML *efh); +void em_format_html_set_headers_collapsable + (EMFormatHTML *efh, + gboolean collapsable); + +gchar * em_format_html_format_cert_infos + (CamelCipherCertInfo *first_cinfo); G_END_DECLS diff --git a/mail/em-utils.c b/mail/em-utils.c index 73c4d9be61..7d11f5e9bf 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -1661,16 +1661,24 @@ search_address_in_addressbooks (const gchar *address, book = e_book_new (source, &err); if (book == NULL) { - if (err && g_error_matches (err, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED)) { + if (err && g_error_matches ( + err, E_BOOK_ERROR, + E_BOOK_ERROR_CANCELLED)) { stop = TRUE; } else if (err) { - gchar *source_uid = g_strdup (e_source_peek_uid (source)); + gchar *source_uid; - g_hash_table_insert (emu_broken_books_hash, source_uid, source_uid); + source_uid = g_strdup ( + e_source_peek_uid (source)); + + g_hash_table_insert ( + emu_broken_books_hash, + source_uid, source_uid); g_warning ( "%s: Unable to create addressbook '%s': %s", - G_STRFUNC, e_source_peek_name (source), + G_STRFUNC, + e_source_peek_name (source), err->message); } g_clear_error (&err); @@ -1678,16 +1686,24 @@ search_address_in_addressbooks (const gchar *address, g_object_unref (book); book = NULL; - if (err && g_error_matches (err, E_BOOK_ERROR, E_BOOK_ERROR_CANCELLED)) { + if (err && g_error_matches ( + err, E_BOOK_ERROR, + E_BOOK_ERROR_CANCELLED)) { stop = TRUE; } else if (err) { - gchar *source_uid = g_strdup (e_source_peek_uid (source)); + gchar *source_uid; + + source_uid = g_strdup ( + e_source_peek_uid (source)); - g_hash_table_insert (emu_broken_books_hash, source_uid, source_uid); + g_hash_table_insert ( + emu_broken_books_hash, + source_uid, source_uid); g_warning ( "%s: Unable to open addressbook '%s': %s", - G_STRFUNC, e_source_peek_name (source), + G_STRFUNC, + e_source_peek_name (source), err->message); } g_clear_error (&err); @@ -1699,7 +1715,10 @@ search_address_in_addressbooks (const gchar *address, if (book && !stop && e_book_get_contacts (book, query, &contacts, &err)) { if (contacts != NULL) { if (!found_any) { - g_hash_table_insert (contact_cache, g_strdup (lowercase_addr), book); + g_hash_table_insert ( + contact_cache, + g_strdup (lowercase_addr), + book); } found_any = TRUE; diff --git a/mail/importers/elm-importer.c b/mail/importers/elm-importer.c index 0bf58a7b73..75cf996e14 100644 --- a/mail/importers/elm-importer.c +++ b/mail/importers/elm-importer.c @@ -271,7 +271,9 @@ elm_status_timeout (gpointer data) pc = importer->status_pc; g_mutex_unlock (importer->status_lock); - e_import_status (importer->import, (EImportTarget *) importer->target, what, pc); + e_import_status ( + importer->import, (EImportTarget *) + importer->target, what, pc); } return TRUE; diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 174c34b7a0..d0697b1850 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -103,22 +103,32 @@ mbox_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) view = e_shell_window_get_active_view (shell_window); if (view && g_str_equal (view, "mail")) { - EShellView *shell_view = e_shell_window_get_shell_view (shell_window, view); + EShellView *shell_view; + EShellSidebar *shell_sidebar; + EMFolderTree *folder_tree = NULL; - if (shell_view) { - EMFolderTree *folder_tree = NULL; - EShellSidebar *shell_sidebar = e_shell_view_get_shell_sidebar (shell_view); + shell_view = e_shell_window_get_shell_view ( + shell_window, view); - g_object_get (shell_sidebar, "folder-tree", &folder_tree, NULL); + shell_sidebar = + e_shell_view_get_shell_sidebar (shell_view); - if (folder_tree) - select_uri = em_folder_tree_get_selected_uri (folder_tree); - } + g_object_get ( + shell_sidebar, "folder-tree", + &folder_tree, NULL); + + select_uri = + em_folder_tree_get_selected_uri (folder_tree); + + g_object_unref (folder_tree); } } - if (!select_uri) - select_uri = g_strdup (e_mail_local_get_folder_uri (E_MAIL_LOCAL_FOLDER_INBOX)); + if (!select_uri) { + const gchar *uri; + uri = e_mail_local_get_folder_uri (E_MAIL_LOCAL_FOLDER_INBOX); + select_uri = g_strdup (uri); + } hbox = gtk_hbox_new (FALSE, 0); @@ -205,7 +215,9 @@ mbox_status_timeout (gpointer data) pc = importer->status_pc; g_mutex_unlock (importer->status_lock); - e_import_status (importer->import, (EImportTarget *) importer->target, what, pc); + e_import_status ( + importer->import, (EImportTarget *) + importer->target, what, pc); } return TRUE; @@ -255,7 +267,8 @@ mbox_import (EImport *ei, EImportTarget *target, EImportImporter *im) importer->cancellable, "status", G_CALLBACK (mbox_status), importer); - filename = g_filename_from_uri (((EImportTargetURI *) target)->uri_src, NULL, NULL); + filename = g_filename_from_uri ( + ((EImportTargetURI *) target)->uri_src, NULL, NULL); mail_importer_import_mbox ( session, filename, ((EImportTargetURI *) target)->uri_dest, importer->cancellable, mbox_import_done, importer); diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index 1c87afc7da..9f98779938 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -153,7 +153,9 @@ import_mbox_exec (struct _import_mbox_msg *m, cancellable, _("Importing '%s'"), camel_folder_get_full_name (folder)); camel_folder_freeze (folder); - while (camel_mime_parser_step (mp, NULL, NULL) == CAMEL_MIME_PARSER_STATE_FROM) { + while (camel_mime_parser_step (mp, NULL, NULL) == + CAMEL_MIME_PARSER_STATE_FROM) { + CamelMimeMessage *msg; const gchar *tmp; gint pc = 0; @@ -337,9 +339,12 @@ import_folders_rec (struct _import_folders_data *m, break; } /* FIXME: need a better way to get default store location */ - uri = g_strdup_printf("mbox:%s/local#%s", data_dir, folder); + uri = g_strdup_printf ( + "mbox:%s/local#%s", data_dir, folder); } else { - uri = g_strdup_printf("mbox:%s/local#%s/%s", data_dir, folderparent, folder); + uri = g_strdup_printf ( + "mbox:%s/local#%s/%s", + data_dir, folderparent, folder); } printf("importing to uri %s\n", uri); diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index aca6ef726e..45b074d6cf 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -273,7 +273,8 @@ rule_from_message (EFilterRule *rule, gchar *namestr; from = camel_mime_message_get_from (msg); - for (i = 0; from && camel_internet_address_get (from, i, &name, &address); i++) { + for (i = 0; from && camel_internet_address_get ( + from, i, &name, &address); i++) { rule_add_sender (context, rule, address); if (name == NULL || name[0] == '\0') name = address; @@ -297,7 +298,8 @@ rule_from_message (EFilterRule *rule, if (flags & AUTO_MLIST) { gchar *name, *mlist; - mlist = camel_header_raw_check_mailing_list (&((CamelMimePart *) msg)->headers); + mlist = camel_header_raw_check_mailing_list ( + &((CamelMimePart *) msg)->headers); if (mlist) { rule_match_mlist (context, rule, mlist); name = g_strdup_printf (_("%s mailing list"), mlist); diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 2107b2c100..4b9d5f500f 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -359,7 +359,8 @@ folder_changed_cb (CamelFolder *folder, /* for each added message, check to see that it is brand new, not junk and not already deleted */ for (i = 0; i < changes->uid_added->len; i++) { - info = camel_folder_get_message_info (folder, changes->uid_added->pdata[i]); + info = camel_folder_get_message_info ( + folder, changes->uid_added->pdata[i]); if (info) { flags = camel_message_info_flags (info); if (((flags & CAMEL_MESSAGE_SEEN) == 0) && @@ -586,7 +587,6 @@ rename_folders (MailFolderCache *self, g_hash_table_insert (si->folders, mfi->full_name, mfi); } else { - d(printf("Rename found a new folder? old '%s' new '%s'\n", old, fi->full_name)); /* Its a new op */ mfi = g_malloc0 (sizeof (*mfi)); mfi->full_name = g_strdup (fi->full_name); diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index 61eb302adf..2446c1c92e 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -882,12 +882,12 @@ receive_get_folder (CamelFilterDriver *d, /* and we assume the newer one is the same, but unref the old one anyway */ g_mutex_lock (info->data->lock); - if (g_hash_table_lookup_extended (info->data->folders, uri, &oldkey, &oldinfoptr)) { + if (g_hash_table_lookup_extended ( + info->data->folders, uri, &oldkey, &oldinfoptr)) { oldinfo = (struct _folder_info *) oldinfoptr; g_object_unref (oldinfo->folder); oldinfo->folder = folder; } else { - /*camel_folder_freeze (folder); */ oldinfo = g_malloc0 (sizeof (*oldinfo)); oldinfo->folder = folder; oldinfo->uri = g_strdup (uri); diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index db03ef2ac4..4c46c4d84a 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -566,6 +566,7 @@ mail_vfolder_delete_folder (EMailBackend *backend, CamelStore *store, const gchar *folder_name) { + ERuleContext *rule_context; EFilterRule *rule; EMailSession *session; const gchar *source; @@ -598,31 +599,40 @@ mail_vfolder_delete_folder (EMailBackend *backend, if (context == NULL) goto done; + rule_context = E_RULE_CONTEXT (context); + /* see if any rules directly reference this removed uri */ rule = NULL; - while ((rule = e_rule_context_next_rule ((ERuleContext *) context, rule, NULL))) { + while ((rule = e_rule_context_next_rule (rule_context, rule, NULL))) { + EMVFolderRule *vf_rule = EM_VFOLDER_RULE (rule); - if (!rule->name) { - d(printf("invalid rule (%p): rule->name is set to NULL\n", rule)); + if (!rule->name) continue; - } source = NULL; - while ((source = em_vfolder_rule_next_source ((EMVFolderRule *) rule, source))) { + while ((source = em_vfolder_rule_next_source (vf_rule, source))) { /* Remove all sources that match, ignore changed events though because the adduri call above does the work async */ if (e_mail_folder_uri_equal (CAMEL_SESSION (session), uri, source)) { - vf = g_hash_table_lookup (vfolder_hash, rule->name); + vf = g_hash_table_lookup ( + vfolder_hash, rule->name); + if (!vf) { g_warning ("vf is NULL for %s\n", rule->name); continue; } + g_signal_handlers_disconnect_matched ( rule, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, rule_changed, vf); - em_vfolder_rule_remove_source ((EMVFolderRule *) rule, source); - g_signal_connect (rule, "changed", G_CALLBACK(rule_changed), vf); + + em_vfolder_rule_remove_source (vf_rule, source); + + g_signal_connect ( + rule, "changed", + G_CALLBACK (rule_changed), vf); + if (changed_count == 0) { g_string_append (changed, rule->name); } else { @@ -630,8 +640,11 @@ mail_vfolder_delete_folder (EMailBackend *backend, g_string_prepend (changed, " "); g_string_append (changed, "\n"); } - g_string_append_printf (changed, " %s\n", rule->name); + g_string_append_printf ( + changed, " %s\n", + rule->name); } + changed_count++; source = NULL; } @@ -691,6 +704,7 @@ mail_vfolder_rename_folder (CamelStore *store, const gchar *old_folder_name, const gchar *new_folder_name) { + ERuleContext *rule_context; EFilterRule *rule; const gchar *source; CamelVeeFolder *vf; @@ -719,11 +733,15 @@ mail_vfolder_rename_folder (CamelStore *store, G_LOCK (vfolder); + rule_context = E_RULE_CONTEXT (context); + /* see if any rules directly reference this removed uri */ rule = NULL; - while ((rule = e_rule_context_next_rule ((ERuleContext *) context, rule, NULL))) { + while ((rule = e_rule_context_next_rule (rule_context, rule, NULL))) { + EMVFolderRule *vf_rule = EM_VFOLDER_RULE (rule); + source = NULL; - while ((source = em_vfolder_rule_next_source ((EMVFolderRule *) rule, source))) { + while ((source = em_vfolder_rule_next_source (vf_rule, source))) { /* Remove all sources that match, ignore changed events though because the adduri call above does the work async */ if (e_mail_folder_uri_equal (session, old_uri, source)) { @@ -732,13 +750,19 @@ mail_vfolder_rename_folder (CamelStore *store, g_warning ("vf is NULL for %s\n", rule->name); continue; } + g_signal_handlers_disconnect_matched ( rule, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, 0, 0, NULL, rule_changed, vf); - em_vfolder_rule_remove_source ((EMVFolderRule *) rule, source); - em_vfolder_rule_add_source ((EMVFolderRule *) rule, new_uri); - g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), vf); + + em_vfolder_rule_remove_source (vf_rule, source); + em_vfolder_rule_add_source (vf_rule, new_uri); + + g_signal_connect ( + vf_rule, "changed", + G_CALLBACK (rule_changed), vf); + changed++; source = NULL; } diff --git a/modules/addressbook/e-book-shell-content.c b/modules/addressbook/e-book-shell-content.c index a86d101e1b..82e1f297d9 100644 --- a/modules/addressbook/e-book-shell-content.c +++ b/modules/addressbook/e-book-shell-content.c @@ -437,7 +437,8 @@ book_shell_content_class_init (EBookShellContentClass *class) shell_content_class = E_SHELL_CONTENT_CLASS (class); shell_content_class->check_state = book_shell_content_check_state; - shell_content_class->focus_search_results = book_shell_content_focus_search_results; + shell_content_class->focus_search_results = + book_shell_content_focus_search_results; g_object_class_install_property ( object_class, diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 1ae493c30d..c6c9fa5673 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -687,12 +687,9 @@ e_cal_shell_view_private_dispose (ECalShellView *cal_shell_view) ECalShellViewPrivate *priv = cal_shell_view->priv; gint i; - /* Calling calendar's save state from here, because it is too late in its dispose */ - if (priv->cal_shell_content) - e_cal_shell_content_save_state (priv->cal_shell_content); - - /* Calling calendar's save state from here, because it is too late in its dispose */ - if (priv->cal_shell_content) + /* Calling calendar's save state from here, + * because it is too late in its dispose. */ + if (priv->cal_shell_content != NULL) e_cal_shell_content_save_state (priv->cal_shell_content); DISPOSE (priv->cal_shell_backend); diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index 1706fa0a5f..1d7269cd55 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -235,15 +235,19 @@ get_attendee_prop (icalcomponent *icalcomp, const gchar *address) if (!(address && *address)) return NULL; - for (prop = icalcomponent_get_first_property (icalcomp, ICAL_ATTENDEE_PROPERTY); - prop; - prop = icalcomponent_get_next_property (icalcomp, ICAL_ATTENDEE_PROPERTY)) { + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ATTENDEE_PROPERTY); + + while (prop != NULL) { const gchar *attendee = icalproperty_get_attendee (prop); - if (g_str_equal (itip_strip_mailto (attendee), address)) { + if (g_str_equal (itip_strip_mailto (attendee), address)) return prop; - } + + prop = icalcomponent_get_next_property ( + icalcomp, ICAL_ATTENDEE_PROPERTY); } + return NULL; } diff --git a/modules/calendar/e-memo-shell-content.c b/modules/calendar/e-memo-shell-content.c index 5c964fc505..9f7d0768b9 100644 --- a/modules/calendar/e-memo-shell-content.c +++ b/modules/calendar/e-memo-shell-content.c @@ -624,7 +624,8 @@ memo_shell_content_class_init (EMemoShellContentClass *class) shell_content_class = E_SHELL_CONTENT_CLASS (class); shell_content_class->check_state = memo_shell_content_check_state; - shell_content_class->focus_search_results = memo_shell_content_focus_search_results; + shell_content_class->focus_search_results = + memo_shell_content_focus_search_results; g_object_class_install_property ( object_class, diff --git a/modules/calendar/e-task-shell-content.c b/modules/calendar/e-task-shell-content.c index 2287ee893c..0ffa6fb5a3 100644 --- a/modules/calendar/e-task-shell-content.c +++ b/modules/calendar/e-task-shell-content.c @@ -647,7 +647,8 @@ task_shell_content_class_init (ETaskShellContentClass *class) shell_content_class = E_SHELL_CONTENT_CLASS (class); shell_content_class->check_state = task_shell_content_check_state; - shell_content_class->focus_search_results = task_shell_content_focus_search_results; + shell_content_class->focus_search_results = + task_shell_content_focus_search_results; g_object_class_install_property ( object_class, diff --git a/modules/mail/e-mail-shell-content.c b/modules/mail/e-mail-shell-content.c index fcb10e461f..9fd7d3b91a 100644 --- a/modules/mail/e-mail-shell-content.c +++ b/modules/mail/e-mail-shell-content.c @@ -422,7 +422,8 @@ mail_shell_content_class_init (EMailShellContentClass *class) shell_content_class = E_SHELL_CONTENT_CLASS (class); shell_content_class->check_state = mail_shell_content_check_state; - shell_content_class->focus_search_results = mail_shell_content_focus_search_results; + shell_content_class->focus_search_results = + mail_shell_content_focus_search_results; /* Inherited from EMailReader */ g_object_class_override_property ( diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c index 164cf53e10..f6a048e975 100644 --- a/plugins/bbdb/gaimbuddies.c +++ b/plugins/bbdb/gaimbuddies.c @@ -118,8 +118,9 @@ bbdb_sync_buddy_list_check (void) return; } - /* Reprocess the buddy list if it's been updated. */ gconf = gconf_client_get_default (); + + /* Reprocess the buddy list if it's been updated. */ last_sync_str = gconf_client_get_string ( gconf, GCONF_KEY_GAIM_LAST_SYNC_TIME, NULL); if (last_sync_str == NULL || !strcmp ((const gchar *)last_sync_str, "")) @@ -135,8 +136,10 @@ bbdb_sync_buddy_list_check (void) return; } - last_sync_str = gconf_client_get_string (gconf, GCONF_KEY_GAIM_LAST_SYNC_MD5, NULL); - g_object_unref (G_OBJECT (gconf)); + last_sync_str = gconf_client_get_string ( + gconf, GCONF_KEY_GAIM_LAST_SYNC_MD5, NULL); + + g_object_unref (gconf); md5 = get_md5_as_string (blist_path); @@ -224,12 +227,16 @@ bbdb_sync_buddy_list_in_thread (gpointer data) } /* Look for an exact match full name == buddy alias */ - query = e_book_query_field_test (E_CONTACT_FULL_NAME, E_BOOK_QUERY_IS, b->alias); + query = e_book_query_field_test ( + E_CONTACT_FULL_NAME, E_BOOK_QUERY_IS, b->alias); + if (!e_book_get_contacts (std->book, query, &contacts, NULL)) { e_book_query_unref (query); continue; } + e_book_query_unref (query); + if (contacts != NULL) { /* FIXME: If there's more than one contact with this @@ -486,7 +493,9 @@ bbdb_get_gaim_buddy_list (void) } } if (blist == NULL) { - fprintf (stderr, "bbdb: Could not find 'blist' element in Pidgin buddy list.\n"); + fprintf ( + stderr, "bbdb: Could not find 'blist' " + "element in Pidgin buddy list.\n"); xmlFreeDoc (buddy_xml); return NULL; } @@ -580,7 +589,9 @@ parse_contact (xmlNodePtr contact, GList **buddies, GSList *blocked) for (child = buddy->children; child != NULL && !is_blocked; child = child->next) { if (!strcmp ((const gchar *)child->name, "setting")) { gchar *setting_type; - setting_type = e_xml_get_string_prop_by_name (child, (const guchar *)"name"); + + setting_type = e_xml_get_string_prop_by_name ( + child, (const guchar *)"name"); if (!strcmp ((const gchar *)setting_type, "buddy_icon")) gb->icon = get_buddy_icon_from_setting (child); diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index 9b6f44c171..1c977750b1 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -219,22 +219,31 @@ org_gnome_evolution_readdbx_getwidget (EImport *ei, view = e_shell_window_get_active_view (shell_window); if (view && g_str_equal (view, "mail")) { - EShellView *shell_view = e_shell_window_get_shell_view (shell_window, view); + EShellView *shell_view; + EMFolderTree *folder_tree = NULL; + EShellSidebar *shell_sidebar; - if (shell_view) { - EMFolderTree *folder_tree = NULL; - EShellSidebar *shell_sidebar = e_shell_view_get_shell_sidebar (shell_view); + shell_view = e_shell_window_get_shell_view ( + shell_window, view); - g_object_get (shell_sidebar, "folder-tree", &folder_tree, NULL); + shell_sidebar = e_shell_view_get_shell_sidebar ( + shell_view); - if (folder_tree) - select_uri = em_folder_tree_get_selected_uri (folder_tree); - } + g_object_get ( + shell_sidebar, "folder-tree", + &folder_tree, NULL); + + select_uri = em_folder_tree_get_selected_uri ( + folder_tree); } } #endif - if (!select_uri) - select_uri = g_strdup (e_mail_local_get_folder_uri (E_MAIL_LOCAL_FOLDER_INBOX)); + if (!select_uri) { + const gchar *local_inbox_uri; + local_inbox_uri = e_mail_local_get_folder_uri ( + E_MAIL_LOCAL_FOLDER_INBOX); + select_uri = g_strdup (local_inbox_uri); + } hbox = gtk_hbox_new (FALSE, 0); diff --git a/plugins/save-calendar/csv-format.c b/plugins/save-calendar/csv-format.c index 8692908544..15ed83817e 100644 --- a/plugins/save-calendar/csv-format.c +++ b/plugins/save-calendar/csv-format.c @@ -154,10 +154,9 @@ add_time_to_csv (GString *line, icaltimetype *time, CsvConfig *config) struct tm mytm = icaltimetype_to_tm (time); gchar *str = (gchar *) g_malloc (sizeof (gchar) * 200); - /* - * Translator: the %F %T is the thirth argument for a strftime function. - * It lets you define the formatting of the date in the csv-file. - * */ + /* Translators: the %F %T is the third argument for a + * strftime function. It lets you define the formatting + * of the date in the csv-file. */ e_utf8_strftime (str, 200, _("%F %T"), &mytm); needquotes = string_needsquotes (str, config); @@ -332,7 +331,9 @@ do_save_calendar_csv (FormatHandler *handler, /* open source client */ source_client = e_auth_new_cal_from_source (primary_source, type); if (!e_cal_open (source_client, TRUE, &error)) { - display_error_message (gtk_widget_get_toplevel (GTK_WIDGET (selector)), error); + display_error_message ( + gtk_widget_get_toplevel (GTK_WIDGET (selector)), + error); g_object_unref (source_client); g_error_free (error); return; @@ -346,13 +347,15 @@ do_save_calendar_csv (FormatHandler *handler, config->newline = userstring_to_systemstring (tmp?tmp:"\\n"); tmp = gtk_entry_get_text (GTK_ENTRY (d->quote_entry)); config->quote = userstring_to_systemstring (tmp?tmp:"\""); - config->header = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (d->header_check)); + config->header = gtk_toggle_button_get_active ( + GTK_TOGGLE_BUTTON (d->header_check)); stream = open_for_writing ( GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (selector))), dest_uri, &error); - if (stream && e_cal_get_object_list_as_comp (source_client, "#t", &objects, NULL)) { + if (stream && e_cal_get_object_list_as_comp ( + source_client, "#t", &objects, NULL)) { if (config->header) { @@ -381,13 +384,15 @@ do_save_calendar_csv (FormatHandler *handler, line = g_string_new (""); for (i=0;i<G_N_ELEMENTS (labels);i++) { if (i>0) - line = g_string_append (line, config->delimiter); - line = g_string_append (line, _(labels[i])); + g_string_append (line, config->delimiter); + g_string_append (line, _(labels[i])); } - line = g_string_append (line, config->newline); + g_string_append (line, config->newline); - g_output_stream_write_all (stream, line->str, line->len, NULL, NULL, NULL); + g_output_stream_write_all ( + stream, line->str, line->len, + NULL, NULL, NULL); g_string_free (line, TRUE); } @@ -408,20 +413,24 @@ do_save_calendar_csv (FormatHandler *handler, line = add_string_to_csv (line, temp_constchar, config); e_cal_component_get_summary (comp, &temp_comptext); - line = add_string_to_csv (line, temp_comptext.value, config); + line = add_string_to_csv ( + line, temp_comptext.value, config); e_cal_component_get_description_list (comp, &temp_list); - line = add_list_to_csv (line, temp_list, config, ECALCOMPONENTTEXT); + line = add_list_to_csv ( + line, temp_list, config, ECALCOMPONENTTEXT); if (temp_list) e_cal_component_free_text_list (temp_list); e_cal_component_get_categories_list (comp, &temp_list); - line = add_list_to_csv (line, temp_list, config, CONSTCHAR); + line = add_list_to_csv ( + line, temp_list, config, CONSTCHAR); if (temp_list) e_cal_component_free_categories_list (temp_list); e_cal_component_get_comment_list (comp, &temp_list); - line = add_list_to_csv (line, temp_list, config, ECALCOMPONENTTEXT); + line = add_list_to_csv ( + line, temp_list, config, ECALCOMPONENTTEXT); if (temp_list) e_cal_component_free_text_list (temp_list); @@ -436,20 +445,27 @@ do_save_calendar_csv (FormatHandler *handler, e_cal_component_free_icaltimetype (temp_time); e_cal_component_get_contact_list (comp, &temp_list); - line = add_list_to_csv (line, temp_list, config, ECALCOMPONENTTEXT); + line = add_list_to_csv ( + line, temp_list, config, ECALCOMPONENTTEXT); if (temp_list) e_cal_component_free_text_list (temp_list); e_cal_component_get_dtstart (comp, &temp_dt); - line = add_time_to_csv (line, temp_dt.value ? temp_dt.value : NULL, config); + line = add_time_to_csv ( + line, temp_dt.value ? + temp_dt.value : NULL, config); e_cal_component_free_datetime (&temp_dt); e_cal_component_get_dtend (comp, &temp_dt); - line = add_time_to_csv (line, temp_dt.value ? temp_dt.value : NULL, config); + line = add_time_to_csv ( + line, temp_dt.value ? + temp_dt.value : NULL, config); e_cal_component_free_datetime (&temp_dt); e_cal_component_get_due (comp, &temp_dt); - line = add_time_to_csv (line, temp_dt.value ? temp_dt.value : NULL, config); + line = add_time_to_csv ( + line, temp_dt.value ? + temp_dt.value : NULL, config); e_cal_component_free_datetime (&temp_dt); e_cal_component_get_percent (comp, &temp_int); @@ -463,11 +479,15 @@ do_save_calendar_csv (FormatHandler *handler, if (e_cal_component_has_attendees (comp)) { e_cal_component_get_attendee_list (comp, &temp_list); - line = add_list_to_csv (line, temp_list, config, ECALCOMPONENTATTENDEE); + line = add_list_to_csv ( + line, temp_list, config, + ECALCOMPONENTATTENDEE); if (temp_list) e_cal_component_free_attendee_list (temp_list); } else { - line = add_list_to_csv (line, NULL, config, ECALCOMPONENTATTENDEE); + line = add_list_to_csv ( + line, NULL, config, + ECALCOMPONENTATTENDEE); } e_cal_component_get_location (comp, &temp_constchar); @@ -487,14 +507,17 @@ do_save_calendar_csv (FormatHandler *handler, /* Important note! * The documentation is not requiring this! * - * if (temp_time) e_cal_component_free_icaltimetype (temp_time); + * if (temp_time) + * e_cal_component_free_icaltimetype (temp_time); * * Please uncomment and fix documentation if untrue * http://www.gnome.org/projects/evolution/ * developer-doc/libecal/ECalComponent.html * #e-cal-component-get-last-modified */ - g_output_stream_write_all (stream, line->str, line->len, NULL, NULL, &error); + g_output_stream_write_all ( + stream, line->str, line->len, + NULL, NULL, &error); /* It's written, so we can free it */ g_string_free (line, TRUE); @@ -516,7 +539,9 @@ do_save_calendar_csv (FormatHandler *handler, g_free (config); if (error) { - display_error_message (gtk_widget_get_toplevel (GTK_WIDGET (selector)), error); + display_error_message ( + gtk_widget_get_toplevel (GTK_WIDGET (selector)), + error); g_error_free (error); } @@ -535,7 +560,8 @@ create_options_widget (FormatHandler *handler) d->delimiter_entry = gtk_entry_new (); d->newline_entry = gtk_entry_new (); d->quote_entry = gtk_entry_new (); - d->header_check = gtk_check_button_new_with_mnemonic (_("Prepend a _header")); + d->header_check = gtk_check_button_new_with_mnemonic ( + _("Prepend a _header")); /* Advanced CSV options */ gtk_entry_set_text (GTK_ENTRY(d->delimiter_entry), ", "); @@ -547,24 +573,36 @@ create_options_widget (FormatHandler *handler) label = gtk_label_new_with_mnemonic (_("_Value delimiter:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), d->delimiter_entry); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 0, 1, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_table_attach (GTK_TABLE (table), d->delimiter_entry, 1, 2, 0, 1, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); + gtk_table_attach ( + GTK_TABLE (table), label, 0, 1, 0, 1, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach ( + GTK_TABLE (table), d->delimiter_entry, 1, 2, 0, 1, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); label = gtk_label_new_with_mnemonic (_("_Record delimiter:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), d->newline_entry); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 1, 2, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_table_attach (GTK_TABLE (table), d->newline_entry, 1, 2, 1, 2, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); + gtk_table_attach ( + GTK_TABLE (table), label, 0, 1, 1, 2, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach ( + GTK_TABLE (table), d->newline_entry, 1, 2, 1, 2, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); label = gtk_label_new_with_mnemonic (_("_Encapsulate values with:")); gtk_misc_set_alignment (GTK_MISC (label), 0, 0.0); gtk_label_set_mnemonic_widget (GTK_LABEL (label), d->quote_entry); - gtk_table_attach (GTK_TABLE (table), label, 0, 1, 2, 3, - (GtkAttachOptions) (GTK_FILL), (GtkAttachOptions) (0), 0, 0); - gtk_table_attach (GTK_TABLE (table), d->quote_entry, 1, 2, 2, 3, - (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), (GtkAttachOptions) (0), 0, 0); + gtk_table_attach ( + GTK_TABLE (table), label, 0, 1, 2, 3, + (GtkAttachOptions) (GTK_FILL), + (GtkAttachOptions) (0), 0, 0); + gtk_table_attach ( + GTK_TABLE (table), d->quote_entry, 1, 2, 2, 3, + (GtkAttachOptions) (GTK_EXPAND | GTK_FILL), + (GtkAttachOptions) (0), 0, 0); gtk_box_pack_start (GTK_BOX (vbox), d->header_check, TRUE, TRUE, 0); gtk_box_pack_start (GTK_BOX (vbox), table, TRUE, TRUE, 0); diff --git a/shell/e-shell-meego.c b/shell/e-shell-meego.c index 0845e63735..6b5c0f22d0 100644 --- a/shell/e-shell-meego.c +++ b/shell/e-shell-meego.c @@ -90,24 +90,30 @@ e_shell_detect_meego (gboolean *is_meego, } display = gdk_display_get_default (); - screen = gdk_display_get_default_screen (gdk_display_get_default ()); + screen = gdk_display_get_default_screen (display); gdk_error_trap_push (); /* get the window manager's supporting window */ - fns.XGetWindowProperty (gdk_x11_display_get_xdisplay (display), - GDK_WINDOW_XID (gdk_screen_get_root_window (screen)), - gdk_x11_atom_to_xatom_for_display (display, wm_win), - 0, 1, False, XA_WINDOW, &dummy_t, &dummy_i, - &dummy_l, &dummy_l, (guchar **)(&wm_window_v)); + fns.XGetWindowProperty ( + gdk_x11_display_get_xdisplay (display), + GDK_WINDOW_XID (gdk_screen_get_root_window (screen)), + gdk_x11_atom_to_xatom_for_display (display, wm_win), + 0, 1, False, XA_WINDOW, + &dummy_t, &dummy_i, + &dummy_l, &dummy_l, + (guchar **) (&wm_window_v)); /* get the '_Moblin' setting */ if (wm_window_v && (*wm_window_v != None)) - fns.XGetWindowProperty (gdk_x11_display_get_xdisplay (display), *wm_window_v, - gdk_x11_atom_to_xatom_for_display (display, mob_atom), - 0, 8192, False, XA_STRING, - &dummy_t, &dummy_i, &dummy_l, &dummy_l, - &moblin_string); + fns.XGetWindowProperty ( + gdk_x11_display_get_xdisplay (display), + *wm_window_v, + gdk_x11_atom_to_xatom_for_display (display, mob_atom), + 0, 8192, False, XA_STRING, + &dummy_t, &dummy_i, + &dummy_l, &dummy_l, + &moblin_string); gdk_error_trap_pop_ignored (); } diff --git a/shell/e-shell-migrate.c b/shell/e-shell-migrate.c index 5863e1c4a0..f5e1174729 100644 --- a/shell/e-shell-migrate.c +++ b/shell/e-shell-migrate.c @@ -846,7 +846,8 @@ merge_duplicate_local_sources (GConfClient *client, const gchar *gconf_key) if (g_strcmp0 (val1, val2) == 0) break; - /* relative uri should not be empty (but adressbook can have it empty) */ + /* relative uri should not be empty + * (but adressbook can have it empty) */ val1 = e_source_peek_relative_uri (dupe_source); val2 = e_source_peek_relative_uri (my_source); if (g_strcmp0 (val1, val2) == 0 && val1 && *val1) diff --git a/shell/es-event.c b/shell/es-event.c index 7628f64869..9d31f390e9 100644 --- a/shell/es-event.c +++ b/shell/es-event.c @@ -34,36 +34,14 @@ static GObjectClass *eme_parent; static ESEvent *es_event; static void -eme_init (GObject *o) -{ - /*ESEvent *eme = (ESEvent *)o; */ -} - -static void -eme_finalise (GObject *o) +eme_class_init (GObjectClass *class) { - ((GObjectClass *) eme_parent)->finalize (o); } static void -eme_target_free (EEvent *ep, EEventTarget *t) -{ - switch (t->type) { - case ES_EVENT_TARGET_STATE: { - ESEventTargetState *s = (ESEventTargetState *) t; - - s = s; - break; } - } - - ((EEventClass *) eme_parent)->target_free (ep, t); -} - -static void -eme_class_init (GObjectClass *klass) +eme_init (GObject *o) { - klass->finalize = eme_finalise; - ((EEventClass *) klass)->target_free = eme_target_free; + /*ESEvent *eme = (ESEvent *)o; */ } GType @@ -109,34 +87,6 @@ ESEvent *es_event_peek (void) return es_event; } -ESEventTargetShell * -es_event_target_new (ESEvent *eme) -{ - return e_event_target_new ( - &eme->event, ES_EVENT_TARGET_SHELL, - sizeof (ESEventTargetShell)); -} - -ESEventTargetState * -es_event_target_new_state (ESEvent *eme, gint state) -{ - ESEventTargetState *t; - guint32 mask = ~0; - - t = e_event_target_new ( - &eme->event, ES_EVENT_TARGET_STATE, sizeof (*t)); - t->state = state; - - if (state) - mask &= ~ES_EVENT_STATE_ONLINE; - else - mask &= ~ES_EVENT_STATE_OFFLINE; - - t->target.mask = mask; - - return t; -} - ESEventTargetUpgrade * es_event_target_new_upgrade (ESEvent *eme, gint major, gint minor, gint revision) { @@ -151,34 +101,13 @@ es_event_target_new_upgrade (ESEvent *eme, gint major, gint minor, gint revision return t; } -ESEventTargetComponent * -es_event_target_new_component (ESEvent *eme, const gchar *id) -{ - ESEventTargetComponent *t; - - t = e_event_target_new ( - &eme->event, ES_EVENT_TARGET_COMPONENT, sizeof (*t)); - t->id = id; - - return t; -} - /* ********************************************************************** */ static gpointer emeh_parent_class; #define emeh ((ESEventHook *)eph) -static const EEventHookTargetMask emeh_state_masks[] = { - { "online", ES_EVENT_STATE_ONLINE }, - { "offline", ES_EVENT_STATE_OFFLINE }, - { NULL } -}; - static const EEventHookTargetMap emeh_targets[] = { - { "state", ES_EVENT_TARGET_STATE, emeh_state_masks }, { "upgrade", ES_EVENT_TARGET_UPGRADE, NULL }, - { "shell", ES_EVENT_TARGET_SHELL, NULL }, - { "component", ES_EVENT_TARGET_COMPONENT, NULL }, { NULL } }; @@ -191,7 +120,7 @@ emeh_finalise (GObject *o) } static void -emeh_class_init (EPluginHookClass *klass) +emeh_class_init (EPluginHookClass *class) { gint i; @@ -202,13 +131,14 @@ emeh_class_init (EPluginHookClass *klass) * A hook for events coming from the shell. **/ - ((GObjectClass *) klass)->finalize = emeh_finalise; - ((EPluginHookClass *)klass)->id = "org.gnome.evolution.shell.events:1.0"; + ((GObjectClass *) class)->finalize = emeh_finalise; + ((EPluginHookClass *)class)->id = "org.gnome.evolution.shell.events:1.0"; for (i=0;emeh_targets[i].type;i++) - e_event_hook_class_add_target_map ((EEventHookClass *) klass, &emeh_targets[i]); + e_event_hook_class_add_target_map ( + (EEventHookClass *) class, &emeh_targets[i]); - ((EEventHookClass *) klass)->event = (EEvent *) es_event_peek (); + ((EEventHookClass *) class)->event = (EEvent *) es_event_peek (); } GType @@ -227,7 +157,8 @@ es_event_hook_get_type (void) }; emeh_parent_class = g_type_class_ref (e_event_hook_get_type ()); - type = g_type_register_static(e_event_hook_get_type(), "ESEventHook", &info, 0); + type = g_type_register_static ( + e_event_hook_get_type(), "ESEventHook", &info, 0); } return type; diff --git a/shell/es-event.h b/shell/es-event.h index 31823d118f..eba3f3d6b6 100644 --- a/shell/es-event.h +++ b/shell/es-event.h @@ -33,32 +33,10 @@ typedef struct _ESEventClass ESEventClass; /* Current target description */ enum _es_event_target_t { - ES_EVENT_TARGET_STATE, - ES_EVENT_TARGET_UPGRADE, - ES_EVENT_TARGET_SHELL, - ES_EVENT_TARGET_COMPONENT + ES_EVENT_TARGET_UPGRADE }; -/* Flags that qualify TARGET_STATE */ -enum { - ES_EVENT_STATE_ONLINE = 1<<0, - ES_EVENT_STATE_OFFLINE = 1<<1 -}; - -typedef struct _ESEventTargetState ESEventTargetState; typedef struct _ESEventTargetUpgrade ESEventTargetUpgrade; -typedef struct _ESEventTargetShell ESEventTargetShell; -typedef struct _ESEventTargetComponent ESEventTargetComponent; - -struct _ESEventTargetShell { - EEventTarget target; -}; - -struct _ESEventTargetState { - EEventTarget target; - - gint state; -}; struct _ESEventTargetUpgrade { EEventTarget target; @@ -68,12 +46,6 @@ struct _ESEventTargetUpgrade { gint revision; }; -struct _ESEventTargetComponent { - EEventTarget target; - - const gchar *id; -}; - typedef struct _EEventItem ESEventItem; /* The object */ @@ -89,19 +61,11 @@ struct _ESEventClass { GType es_event_get_type (void); ESEvent * es_event_peek (void); -ESEventTargetShell * - es_event_target_new (ESEvent *eme); -ESEventTargetState * - es_event_target_new_state (ESEvent *emp, - gint state); ESEventTargetUpgrade * es_event_target_new_upgrade (ESEvent *event, gint major, gint minor, gint revision); -ESEventTargetComponent * - es_event_target_new_component (ESEvent *event, - const gchar *id); /* ********************************************************************** */ diff --git a/smclient/eggsmclient-xsmp.c b/smclient/eggsmclient-xsmp.c index 97d035d50f..c643284701 100644 --- a/smclient/eggsmclient-xsmp.c +++ b/smclient/eggsmclient-xsmp.c @@ -533,7 +533,10 @@ sm_client_xsmp_end_session (EggSMClient *client, else save_type = SmSaveGlobal; - g_debug ("Sending SaveYourselfRequest(SmSaveGlobal, Shutdown, SmInteractStyleAny, %sFast)", request_confirmation ? "!" : ""); + g_debug ( + "Sending SaveYourselfRequest(" + "SmSaveGlobal, Shutdown, SmInteractStyleAny, %sFast)", + request_confirmation ? "!" : ""); SmcRequestSaveYourself (xsmp->connection, save_type, True, /* shutdown */ diff --git a/smime/lib/e-asn1-object.c b/smime/lib/e-asn1-object.c index 144f53db9b..a717a6942a 100644 --- a/smime/lib/e-asn1-object.c +++ b/smime/lib/e-asn1-object.c @@ -269,7 +269,9 @@ build_from_der (EASN1Object *parent, gchar *data, gchar *end) asn1object->priv->tag = tagnum; asn1object->priv->type = type; - if (!build_from_der (asn1object, data, (len == 0) ? end : data + len)) { + if (!build_from_der ( + asn1object, data, + (len == 0) ? end : data + len)) { g_object_unref (asn1object); return FALSE; } diff --git a/widgets/menus/gal-define-views-model.c b/widgets/menus/gal-define-views-model.c index b72a262c7f..14031caf2b 100644 --- a/widgets/menus/gal-define-views-model.c +++ b/widgets/menus/gal-define-views-model.c @@ -142,8 +142,12 @@ gdvm_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer val) { GalDefineViewsModel *views = GAL_DEFINE_VIEWS_MODEL (etc); if (views->editable) { + GalView *view; + + view = gal_view_collection_get_view (views->collection, row); + e_table_model_pre_change (etc); - gal_view_set_title (gal_view_collection_get_view (views->collection, row), val); + gal_view_set_title (view, val); e_table_model_cell_changed (etc, col, row); } } diff --git a/widgets/misc/e-attachment-button.c b/widgets/misc/e-attachment-button.c index 88c965e787..efc184b090 100644 --- a/widgets/misc/e-attachment-button.c +++ b/widgets/misc/e-attachment-button.c @@ -271,7 +271,8 @@ attachment_button_expand_drag_data_get_cb (EAttachmentButton *button, if (button->priv->attachment) { gchar *mime_type; - mime_type = e_attachment_get_mime_type (button->priv->attachment); + mime_type = e_attachment_get_mime_type ( + button->priv->attachment); if (mime_type) { gboolean processed = FALSE; @@ -284,7 +285,9 @@ attachment_button_expand_drag_data_get_cb (EAttachmentButton *button, if (g_strcmp0 (atom_name, mime_type) == 0) { CamelMimePart *mime_part; - mime_part = e_attachment_get_mime_part (button->priv->attachment); + mime_part = e_attachment_get_mime_part ( + button->priv->attachment); + if (CAMEL_IS_MIME_PART (mime_part)) { CamelDataWrapper *wrapper; CamelStream *stream; @@ -292,12 +295,18 @@ attachment_button_expand_drag_data_get_cb (EAttachmentButton *button, buffer = g_byte_array_new (); stream = camel_stream_mem_new (); - camel_stream_mem_set_byte_array (CAMEL_STREAM_MEM (stream), buffer); - wrapper = camel_medium_get_content (CAMEL_MEDIUM (mime_part)); - camel_data_wrapper_decode_to_stream_sync (wrapper, stream, NULL, NULL); + camel_stream_mem_set_byte_array ( + CAMEL_STREAM_MEM (stream), + buffer); + wrapper = camel_medium_get_content ( + CAMEL_MEDIUM (mime_part)); + camel_data_wrapper_decode_to_stream_sync ( + wrapper, stream, NULL, NULL); g_object_unref (stream); - gtk_selection_data_set (selection, atom, 8, buffer->data, buffer->len); + gtk_selection_data_set ( + selection, atom, 8, + buffer->data, buffer->len); processed = TRUE; g_byte_array_free (buffer, TRUE); @@ -780,7 +789,9 @@ e_attachment_button_set_attachment (EAttachmentButton *button, attach_entry[0].target = simple_type; - gtk_target_list_add_table (list, attach_entry, G_N_ELEMENTS (attach_entry)); + gtk_target_list_add_table ( + list, attach_entry, + G_N_ELEMENTS (attach_entry)); g_free (simple_type); } diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index ad7b95bfd4..fd626c674c 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -1619,7 +1619,9 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, } /* Draw the 1- or 2-digit day number. */ - day_x += calitem->cell_width - (calitem->cell_width - min_cell_width) / 2; + day_x += calitem->cell_width - + (calitem->cell_width - + min_cell_width) / 2; day_x -= E_CALENDAR_ITEM_MIN_CELL_XPAD / 2; day_y += (calitem->cell_height - min_cell_height + 1) / 2; day_y += E_CALENDAR_ITEM_MIN_CELL_YPAD / 2; @@ -1628,7 +1630,9 @@ e_calendar_item_draw_day_numbers (ECalendarItem *calitem, if (day_num >= 10) { digit = day_num / 10; day_x -= calitem->digit_widths[digit]; - num_chars += sprintf (&buffer[num_chars], get_digit_fomat (), digit); + num_chars += sprintf ( + &buffer[num_chars], + get_digit_fomat (), digit); } digit = day_num % 10; @@ -2117,7 +2121,8 @@ e_calendar_item_button_press (ECalendarItem *calitem, tmp_start_moff = calitem->selection_start_month_offset; tmp_start_day = calitem->selection_start_day; - e_calendar_item_round_down_selection (calitem, &tmp_start_moff, &tmp_start_day); + e_calendar_item_round_down_selection ( + calitem, &tmp_start_moff, &tmp_start_day); e_calendar_item_round_down_selection (calitem, &month_offset, &day); month_offset += calitem->selection_start_month_offset - tmp_start_moff; diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index b0e8cbe12f..2c0c6ab9c0 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -137,10 +137,11 @@ e_calendar_init (ECalendar *cal) /* Create the small font. */ - small_font_desc = - pango_font_description_copy (gtk_widget_get_style (GTK_WIDGET (cal))->font_desc); - pango_font_description_set_size (small_font_desc, - E_CALENDAR_SMALL_FONT_PTSIZE * PANGO_SCALE); + small_font_desc = pango_font_description_copy ( + gtk_widget_get_style (GTK_WIDGET (cal))->font_desc); + pango_font_description_set_size ( + small_font_desc, + E_CALENDAR_SMALL_FONT_PTSIZE * PANGO_SCALE); canvas_group = GNOME_CANVAS_GROUP (GNOME_CANVAS (cal)->root); diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index c5d953b396..b27b7182d7 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -222,7 +222,8 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) * synthesize an enter event. */ if (event != &canvas->pick_event) { - if ((event->type == GDK_MOTION_NOTIFY) || (event->type == GDK_BUTTON_RELEASE)) { + if ((event->type == GDK_MOTION_NOTIFY) || + (event->type == GDK_BUTTON_RELEASE)) { /* these fields have the same offsets in both types of events */ canvas->pick_event.crossing.type = GDK_ENTER_NOTIFY; diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 7fb0f8cd79..acc3c08fe5 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -1918,8 +1918,8 @@ e_date_edit_update_date_entry (EDateEdit *dedit) gtk_entry_set_text (GTK_ENTRY (priv->date_entry), C_("date", "None")); } else { /* This is a strftime() format for a short date. - %x the preferred date representation for the current locale without the time, - but has forced to use 4 digit year */ + * %x the preferred date representation for the current locale + * without the time, but is forced to use 4 digit year. */ gchar *format = e_time_get_d_fmt_with_4digit_year (); time_t tt; diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index 3069692f52..69cf847ae5 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -614,7 +614,8 @@ import_simple_done (EImport *ei, gpointer user_data) /* process next file URI */ g_free (priv->simple_page.target->uri_src); - priv->simple_page.target->uri_src = g_ptr_array_remove_index (priv->fileuris, 0); + priv->simple_page.target->uri_src = + g_ptr_array_remove_index (priv->fileuris, 0); e_import_import ( priv->import, priv->import_target, diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index ef1d805130..dd02486a43 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -945,7 +945,9 @@ e_map_set_zoom (EMap *map, EMapZoomState zoom) } void -e_map_zoom_to_location (EMap *map, gdouble longitude, gdouble latitude) +e_map_zoom_to_location (EMap *map, + gdouble longitude, + gdouble latitude) { gdouble prevlong, prevlat; gdouble prevzoom; @@ -959,7 +961,9 @@ e_map_zoom_to_location (EMap *map, gdouble longitude, gdouble latitude) e_map_set_zoom (map, E_MAP_ZOOMED_IN); center_at (map, longitude, latitude); - e_map_tween_new_from (map, E_MAP_TWEEN_DURATION_MSECS, prevlong, prevlat, prevzoom); + e_map_tween_new_from ( + map, E_MAP_TWEEN_DURATION_MSECS, + prevlong, prevlat, prevzoom); } void diff --git a/widgets/misc/e-searching-tokenizer.c b/widgets/misc/e-searching-tokenizer.c index 6d34b6d8f0..3da81e44bd 100644 --- a/widgets/misc/e-searching-tokenizer.c +++ b/widgets/misc/e-searching-tokenizer.c @@ -272,9 +272,10 @@ build_trie (gint nocase, gint len, guchar **words) /* Step 2: Build failure graph */ - /* This searches for the longest substring which is a prefix of another string and - builds a graph of failure links so you can find multiple substrings concurrently, - using aho-corasick's algorithm */ + /* This searches for the longest substring which is a prefix of + * another string and builds a graph of failure links so you can + * find multiple substrings concurrently, using aho-corasick's + * algorithm. */ for (i=0;i<state_depth_size;i++) { q = state_depth[i]; @@ -726,7 +727,8 @@ searcher_next_token (struct _searcher *s) if (q->matches == NULL) { if (s->submatchp == 0) { - /* nothing pending, always put something in so we can try merge */ + /* nothing pending, always put + * something in so we can try merge */ push_subpending (s, offstart, offend); } else if (!merge_subpending (s, offstart, offend)) { /* can't merge, output what we have, and start againt */ diff --git a/widgets/misc/e-selection-model-simple.c b/widgets/misc/e-selection-model-simple.c index 1bdd99c3eb..e7bd0c2f16 100644 --- a/widgets/misc/e-selection-model-simple.c +++ b/widgets/misc/e-selection-model-simple.c @@ -44,12 +44,11 @@ e_selection_model_simple_init (ESelectionModelSimple *selection) } static void -e_selection_model_simple_class_init (ESelectionModelSimpleClass *klass) +e_selection_model_simple_class_init (ESelectionModelSimpleClass *class) { ESelectionModelArrayClass *esma_class; - esma_class = E_SELECTION_MODEL_ARRAY_CLASS (klass); - + esma_class = E_SELECTION_MODEL_ARRAY_CLASS (class); esma_class->get_row_count = esms_get_row_count; } @@ -68,7 +67,7 @@ e_selection_model_simple_new (void) void e_selection_model_simple_set_row_count (ESelectionModelSimple *esms, - gint row_count) + gint row_count) { if (esms->row_count != row_count) { ESelectionModelArray *esma = E_SELECTION_MODEL_ARRAY (esms); @@ -78,6 +77,7 @@ e_selection_model_simple_set_row_count (ESelectionModelSimple *esms, esma->selected_row = -1; esma->selected_range_end = -1; } + esms->row_count = row_count; } @@ -89,27 +89,31 @@ esms_get_row_count (ESelectionModelArray *esma) return esms->row_count; } -void e_selection_model_simple_insert_rows (ESelectionModelSimple *esms, - gint row, - gint count) +void +e_selection_model_simple_insert_rows (ESelectionModelSimple *esms, + gint row, + gint count) { esms->row_count += count; - e_selection_model_array_insert_rows (E_SELECTION_MODEL_ARRAY (esms), row, count); + e_selection_model_array_insert_rows ( + E_SELECTION_MODEL_ARRAY (esms), row, count); } void -e_selection_model_simple_delete_rows (ESelectionModelSimple *esms, - gint row, - gint count) +e_selection_model_simple_delete_rows (ESelectionModelSimple *esms, + gint row, + gint count) { esms->row_count -= count; - e_selection_model_array_delete_rows (E_SELECTION_MODEL_ARRAY (esms), row, count); + e_selection_model_array_delete_rows ( + E_SELECTION_MODEL_ARRAY (esms), row, count); } void -e_selection_model_simple_move_row (ESelectionModelSimple *esms, - gint old_row, - gint new_row) +e_selection_model_simple_move_row (ESelectionModelSimple *esms, + gint old_row, + gint new_row) { - e_selection_model_array_move_row (E_SELECTION_MODEL_ARRAY (esms), old_row, new_row); + e_selection_model_array_move_row ( + E_SELECTION_MODEL_ARRAY (esms), old_row, new_row); } diff --git a/widgets/table/e-cell-number.c b/widgets/table/e-cell-number.c index 7e9395ba6c..7944bbea51 100644 --- a/widgets/table/e-cell-number.c +++ b/widgets/table/e-cell-number.c @@ -37,7 +37,11 @@ G_DEFINE_TYPE (ECellNumber, e_cell_number, E_TYPE_CELL_TEXT) static gchar * ecn_get_text (ECellText *cell, ETableModel *model, gint col, gint row) { - return e_format_number (GPOINTER_TO_INT (e_table_model_value_at (model, col, row))); + gpointer value; + + value = e_table_model_value_at (model, col, row); + + return e_format_number (GPOINTER_TO_INT (value)); } static void diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index 06b26c53d4..bec9f5d005 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -246,10 +246,13 @@ cell_toggle_event (ECellView *ecell_view, return FALSE; /* Fall through */ case GDK_BUTTON_PRESS: - if (!e_table_model_is_cell_editable (ecell_view->e_table_model, model_col, row)) + if (!e_table_model_is_cell_editable ( + ecell_view->e_table_model, model_col, row)) return FALSE; - etog_set_value (toggle_view, model_col, view_col, row, value + 1); + etog_set_value ( + toggle_view, model_col, view_col, row, value + 1); + return TRUE; default: diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 9b85cd3b85..4bfb80d1e9 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -1398,19 +1398,19 @@ e_table_config_construct (ETableConfig *config, * Returns: The config object. */ ETableConfig * -e_table_config_new (const gchar *header, - ETableSpecification *spec, - ETableState *state, - GtkWindow *parent_window) +e_table_config_new (const gchar *header, + ETableSpecification *spec, + ETableState *state, + GtkWindow *parent_window) { - ETableConfig *config = g_object_new (E_TYPE_TABLE_CONFIG, NULL); + ETableConfig *config; GtkDialog *dialog; GtkWidget *widget; - if (e_table_config_construct (config, header, spec, state, parent_window) == NULL) { - g_object_unref (config); - return NULL; - } + config = g_object_new (E_TYPE_TABLE_CONFIG, NULL); + + e_table_config_construct ( + config, header, spec, state, parent_window); dialog = GTK_DIALOG (config->dialog_toplevel); diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 451b0388b0..e2dc6f1721 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -129,7 +129,9 @@ etfci_rebuild_combined (ETableFieldChooserItem *etfci) ETableCol *ecol = e_table_header_get_column (etfci->header, i); if (ecol->disabled) continue; - g_hash_table_insert (hash, GINT_TO_POINTER (ecol->col_idx), GINT_TO_POINTER (1)); + g_hash_table_insert ( + hash, GINT_TO_POINTER (ecol->col_idx), + GINT_TO_POINTER (1)); } count = e_table_header_count (etfci->full_header); @@ -357,13 +359,17 @@ etfci_set_property (GObject *object, case PROP_FULL_HEADER: etfci_drop_full_header (etfci); if (g_value_get_object (value)) - etfci_add_full_header (etfci, E_TABLE_HEADER (g_value_get_object (value))); + etfci_add_full_header ( + etfci, E_TABLE_HEADER ( + g_value_get_object (value))); break; case PROP_HEADER: etfci_drop_table_header (etfci); if (g_value_get_object (value)) - etfci_add_table_header (etfci, E_TABLE_HEADER (g_value_get_object (value))); + etfci_add_table_header ( + etfci, E_TABLE_HEADER ( + g_value_get_object (value))); break; case PROP_DND_CODE: diff --git a/widgets/table/e-table-group-leaf.c b/widgets/table/e-table-group-leaf.c index 46f30a9cf4..bf4f1553aa 100644 --- a/widgets/table/e-table-group-leaf.c +++ b/widgets/table/e-table-group-leaf.c @@ -151,10 +151,10 @@ e_table_group_leaf_construct (GnomeCanvasGroup *parent, */ ETableGroup * e_table_group_leaf_new (GnomeCanvasGroup *parent, - ETableHeader *full_header, - ETableHeader *header, - ETableModel *model, - ETableSortInfo *sort_info) + ETableHeader *full_header, + ETableHeader *header, + ETableModel *model, + ETableSortInfo *sort_info) { ETableGroupLeaf *etgl; @@ -162,32 +162,44 @@ e_table_group_leaf_new (GnomeCanvasGroup *parent, etgl = g_object_new (E_TYPE_TABLE_GROUP_LEAF, NULL); - e_table_group_leaf_construct (parent, etgl, full_header, - header, model, sort_info); + e_table_group_leaf_construct ( + parent, etgl, full_header, + header, model, sort_info); + return E_TABLE_GROUP (etgl); } static void -etgl_cursor_change (GObject *object, gint row, ETableGroupLeaf *etgl) +etgl_cursor_change (GObject *object, + gint row, + ETableGroupLeaf *etgl) { if (row < E_TABLE_SUBSET (etgl->ets)->n_map) - e_table_group_cursor_change (E_TABLE_GROUP (etgl), - E_TABLE_SUBSET (etgl->ets)->map_table[row]); + e_table_group_cursor_change ( + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[row]); } static void -etgl_cursor_activated (GObject *object, gint view_row, ETableGroupLeaf *etgl) +etgl_cursor_activated (GObject *object, + gint view_row, + ETableGroupLeaf *etgl) { if (view_row < E_TABLE_SUBSET (etgl->ets)->n_map) - e_table_group_cursor_activated (E_TABLE_GROUP (etgl), - E_TABLE_SUBSET (etgl->ets)->map_table[view_row]); + e_table_group_cursor_activated ( + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[view_row]); } static void -etgl_double_click (GObject *object, gint model_row, gint model_col, GdkEvent *event, - ETableGroupLeaf *etgl) +etgl_double_click (GObject *object, + gint model_row, + gint model_col, + GdkEvent *event, + ETableGroupLeaf *etgl) { - e_table_group_double_click (E_TABLE_GROUP (etgl), model_row, model_col, event); + e_table_group_double_click ( + E_TABLE_GROUP (etgl), model_row, model_col, event); } static gboolean @@ -207,21 +219,28 @@ etgl_key_press (GObject *object, } static gboolean -etgl_start_drag (GObject *object, gint model_row, gint model_col, GdkEvent *event, - ETableGroupLeaf *etgl) +etgl_start_drag (GObject *object, + gint model_row, + gint model_col, + GdkEvent *event, + ETableGroupLeaf *etgl) { - return e_table_group_start_drag (E_TABLE_GROUP (etgl), model_row, model_col, event); + return e_table_group_start_drag ( + E_TABLE_GROUP (etgl), model_row, model_col, event); } static gboolean -etgl_right_click (GObject *object, gint view_row, gint model_col, GdkEvent *event, - ETableGroupLeaf *etgl) +etgl_right_click (GObject *object, + gint view_row, + gint model_col, + GdkEvent *event, + ETableGroupLeaf *etgl) { if (view_row < E_TABLE_SUBSET (etgl->ets)->n_map) - return e_table_group_right_click (E_TABLE_GROUP (etgl), - E_TABLE_SUBSET (etgl->ets)->map_table[view_row], - model_col, - event); + return e_table_group_right_click ( + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[view_row], + model_col, event); else return FALSE; } @@ -234,10 +253,10 @@ etgl_click (GObject *object, ETableGroupLeaf *etgl) { if (row < E_TABLE_SUBSET (etgl->ets)->n_map) - return e_table_group_click (E_TABLE_GROUP (etgl), - E_TABLE_SUBSET (etgl->ets)->map_table[row], - col, - event); + return e_table_group_click ( + E_TABLE_GROUP (etgl), + E_TABLE_SUBSET (etgl->ets)->map_table[row], + col, event); else return FALSE; } @@ -247,12 +266,8 @@ etgl_reflow (GnomeCanvasItem *item, gint flags) { ETableGroupLeaf *leaf = E_TABLE_GROUP_LEAF (item); - g_object_get (leaf->item, - "height", &leaf->height, - NULL); - g_object_get (leaf->item, - "width", &leaf->width, - NULL); + g_object_get (leaf->item, "height", &leaf->height, NULL); + g_object_get (leaf->item, "width", &leaf->width, NULL); e_canvas_item_request_parent_reflow (item); } diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index d8a7d0d7a0..16633f967c 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -1625,13 +1625,13 @@ ethi_header_context_menu (ETableHeaderItem *ethi, GdkEventButton *event) info->ethi = ethi; info->col = ethi_find_col_by_x (ethi, event->x); - popup = e_popup_menu_create_with_domain (ethi_context_menu, - 1 + - 0 + - ((ethi->table || ethi->tree) ? 0 : 4) + - ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), - ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + - 128, info, GETTEXT_PACKAGE); + popup = e_popup_menu_create_with_domain ( + ethi_context_menu, + 1 + + ((ethi->table || ethi->tree) ? 0 : 4) + + ((e_table_header_count (ethi->eth) > 1) ? 0 : 8), + ((e_table_sort_info_get_can_group (ethi->sort_info)) ? 0 : 16) + + 128, info, GETTEXT_PACKAGE); menu_item = gtk_menu_item_new_with_mnemonic (_("_Sort By")); gtk_widget_show (menu_item); @@ -1761,9 +1761,9 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) gint j; for (j = i + 1; j < length; j++) - e_table_sort_info_sorting_set_nth (ethi->sort_info, - j - 1, - e_table_sort_info_sorting_get_nth (ethi->sort_info, j)); + e_table_sort_info_sorting_set_nth ( + ethi->sort_info, j - 1, + e_table_sort_info_sorting_get_nth (ethi->sort_info, j)); e_table_sort_info_sorting_truncate (ethi->sort_info, length - 1); length--; @@ -1968,7 +1968,8 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) (e->key.keyval == GDK_KEY_KP_Left)) { ETableCol *ecol; - if ((ethi->selected_col <= 0) || (ethi->selected_col >= ethi->eth->col_count)) + if ((ethi->selected_col <= 0) || + (ethi->selected_col >= ethi->eth->col_count)) ethi->selected_col = ethi->eth->col_count - 1; else ethi->selected_col--; diff --git a/widgets/table/e-table-without.c b/widgets/table/e-table-without.c index ea2554b7bc..59d254c862 100644 --- a/widgets/table/e-table-without.c +++ b/widgets/table/e-table-without.c @@ -193,7 +193,8 @@ etw_proxy_model_rows_deleted (ETableSubset *etss, gboolean shift = FALSE; for (i = 0; i < etss->n_map; i++) { - if (etss->map_table[i] >= model_row && etss->map_table[i] < model_row + count) { + if (etss->map_table[i] >= model_row && + etss->map_table[i] < model_row + count) { remove_row (etw, i); i--; } else if (etss->map_table[i] >= model_row + count) { diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index eec9333e65..4b9a977f05 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -514,11 +514,14 @@ e_tree_memory_node_insert (ETreeMemory *tree_model, if (parent_path != NULL) { e_tree_memory_path_insert (parent_path, position, new_path); if (!tree_model->priv->frozen) - e_tree_model_node_inserted (E_TREE_MODEL (tree_model), parent_path, new_path); + e_tree_model_node_inserted ( + E_TREE_MODEL (tree_model), + parent_path, new_path); } else { priv->root = new_path; if (!tree_model->priv->frozen) - e_tree_model_node_changed (E_TREE_MODEL (tree_model), new_path); + e_tree_model_node_changed ( + E_TREE_MODEL (tree_model), new_path); } return new_path; diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index fe9f3d7474..25fdcc7e48 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1257,7 +1257,8 @@ e_tree_set_state_object (ETree *e_tree, ETableState *state) NULL); if (e_tree->priv->etta) - e_tree_table_adapter_set_sort_info (e_tree->priv->etta, e_tree->priv->sort_info); + e_tree_table_adapter_set_sort_info ( + e_tree->priv->etta, e_tree->priv->sort_info); e_tree_state_change (e_tree); } @@ -2065,11 +2066,17 @@ e_tree_get_next_row (ETree *e_tree, return e_sorter_sorted_to_model (E_SORTER (e_tree->priv->sorter), i); } else return -1; - } else - if (model_row < e_table_model_row_count (E_TABLE_MODEL (e_tree->priv->etta)) - 1) + } else { + gint row_count; + + row_count = e_table_model_row_count ( + E_TABLE_MODEL (e_tree->priv->etta)); + + if (model_row < row_count - 1) return model_row + 1; else return -1; + } } gint diff --git a/widgets/table/gal-a11y-e-cell-vbox.c b/widgets/table/gal-a11y-e-cell-vbox.c index bbe278537a..e663bb1f1f 100644 --- a/widgets/table/gal-a11y-e-cell-vbox.c +++ b/widgets/table/gal-a11y-e-cell-vbox.c @@ -220,7 +220,8 @@ AtkObject *gal_a11y_e_cell_vbox_new (ETableItem *item, a11y = g_object_new (gal_a11y_e_cell_vbox_get_type (), NULL); - gal_a11y_e_cell_construct (a11y, item, cell_view, parent, model_col, view_col, row); + gal_a11y_e_cell_construct ( + a11y, item, cell_view, parent, model_col, view_col, row); gaec = GAL_A11Y_E_CELL (a11y); gaev = GAL_A11Y_E_CELL_VBOX (a11y); diff --git a/widgets/table/gal-a11y-e-cell.c b/widgets/table/gal-a11y-e-cell.c index 0ba51dcb4d..d5853270a4 100644 --- a/widgets/table/gal-a11y-e-cell.c +++ b/widgets/table/gal-a11y-e-cell.c @@ -350,7 +350,9 @@ gal_a11y_e_cell_remove_action_by_name (GalA11yECell *cell, g_return_val_if_fail (GAL_A11Y_IS_E_CELL (cell), FALSE); for (list_node = cell->action_list; list_node && !action_found; list_node = list_node->next) { - if (!g_ascii_strcasecmp (((ActionInfo *)(list_node->data))->name, action_name)) { + if (!g_ascii_strcasecmp ( + ((ActionInfo *)(list_node->data))->name, + action_name)) { action_found = TRUE; break; } diff --git a/widgets/text/e-text-model.c b/widgets/text/e-text-model.c index 10f32b1592..f079346b72 100644 --- a/widgets/text/e-text-model.c +++ b/widgets/text/e-text-model.c @@ -155,7 +155,6 @@ e_text_model_dispose (GObject *object) { ETextModel *model; - g_return_if_fail (object != NULL); g_return_if_fail (E_IS_TEXT_MODEL (object)); model = E_TEXT_MODEL (object); @@ -300,7 +299,6 @@ e_text_model_real_delete (ETextModel *model, gint position, gint length) void e_text_model_changed (ETextModel *model) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); /* @@ -326,7 +324,6 @@ e_text_model_cancel_completion (ETextModel *model) void e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos_data) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (fn != NULL); @@ -338,7 +335,6 @@ e_text_model_reposition (ETextModel *model, ETextModelReposFn fn, gpointer repos gint e_text_model_validate_position (ETextModel *model, gint pos) { - g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); if (E_TEXT_MODEL_GET_CLASS (model)->validate_pos) @@ -350,7 +346,6 @@ e_text_model_validate_position (ETextModel *model, gint pos) const gchar * e_text_model_get_text (ETextModel *model) { - g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); if (E_TEXT_MODEL_GET_CLASS (model)->get_text) @@ -362,7 +357,6 @@ e_text_model_get_text (ETextModel *model) gint e_text_model_get_text_length (ETextModel *model) { - g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); if (E_TEXT_MODEL_GET_CLASS (model)->get_text_len (model)) { @@ -388,7 +382,6 @@ e_text_model_get_text_length (ETextModel *model) void e_text_model_set_text (ETextModel *model, const gchar *text) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); if (E_TEXT_MODEL_GET_CLASS (model)->set_text) @@ -398,7 +391,6 @@ e_text_model_set_text (ETextModel *model, const gchar *text) void e_text_model_insert (ETextModel *model, gint position, const gchar *text) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); if (text == NULL) @@ -414,7 +406,6 @@ e_text_model_insert_length (ETextModel *model, const gchar *text, gint length) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (length >= 0); @@ -428,7 +419,6 @@ e_text_model_insert_length (ETextModel *model, void e_text_model_prepend (ETextModel *model, const gchar *text) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); if (text == NULL) @@ -440,7 +430,6 @@ e_text_model_prepend (ETextModel *model, const gchar *text) void e_text_model_append (ETextModel *model, const gchar *text) { - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); if (text == NULL) @@ -454,7 +443,6 @@ e_text_model_delete (ETextModel *model, gint position, gint length) { gint txt_len; - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); g_return_if_fail (length >= 0); @@ -472,7 +460,6 @@ e_text_model_delete (ETextModel *model, gint position, gint length) gint e_text_model_object_count (ETextModel *model) { - g_return_val_if_fail (model != NULL, 0); g_return_val_if_fail (E_IS_TEXT_MODEL (model), 0); if (E_TEXT_MODEL_GET_CLASS (model)->obj_count) @@ -484,7 +471,6 @@ e_text_model_object_count (ETextModel *model) const gchar * e_text_model_get_nth_object (ETextModel *model, gint n, gint *len) { - g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); if (n < 0 || n >= e_text_model_object_count (model)) @@ -502,7 +488,6 @@ e_text_model_strdup_nth_object (ETextModel *model, gint n) const gchar *obj; gint len = 0; - g_return_val_if_fail (model != NULL, NULL); g_return_val_if_fail (E_IS_TEXT_MODEL (model), NULL); obj = e_text_model_get_nth_object (model, n, &len); @@ -523,7 +508,6 @@ e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint const gchar *txt = NULL, *obj = NULL; gint len = 0; - g_return_if_fail (model != NULL); g_return_if_fail (E_IS_TEXT_MODEL (model)); txt = e_text_model_get_text (model); @@ -540,7 +524,6 @@ e_text_model_get_nth_object_bounds (ETextModel *model, gint n, gint *start, gint gint e_text_model_get_object_at_offset (ETextModel *model, gint offset) { - g_return_val_if_fail (model != NULL, -1); g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); if (offset < 0 || offset >= e_text_model_get_text_length (model)) @@ -572,11 +555,11 @@ e_text_model_get_object_at_offset (ETextModel *model, gint offset) gint e_text_model_get_object_at_pointer (ETextModel *model, const gchar *s) { - g_return_val_if_fail (model != NULL, -1); g_return_val_if_fail (E_IS_TEXT_MODEL (model), -1); g_return_val_if_fail (s != NULL, -1); - return e_text_model_get_object_at_offset (model, s - e_text_model_get_text (model)); + return e_text_model_get_object_at_offset ( + model, s - e_text_model_get_text (model)); } void diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 175eea65d7..fefc0a3317 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1483,16 +1483,21 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, else state = GTK_STATE_ACTIVE; - indices[0] = MIN (text->selection_start, text->selection_end); - indices[1] = MAX (text->selection_start, text->selection_end); + indices[0] = MIN ( + text->selection_start, + text->selection_end); + indices[1] = MAX ( + text->selection_start, + text->selection_end); /* convert these into byte indices */ - indices[0] = g_utf8_offset_to_pointer (text->text, indices[0]) - text->text; - indices[1] = g_utf8_offset_to_pointer (text->text, indices[1]) - text->text; + indices[0] = g_utf8_offset_to_pointer ( + text->text, indices[0]) - text->text; + indices[1] = g_utf8_offset_to_pointer ( + text->text, indices[1]) - text->text; - clip_region = gdk_pango_layout_get_clip_region (text->layout, - xpos, ypos, - indices, 1); + clip_region = gdk_pango_layout_get_clip_region ( + text->layout, xpos, ypos, indices, 1); gdk_cairo_region (cr, clip_region); cairo_clip (cr); cairo_region_destroy (clip_region); @@ -1506,7 +1511,10 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, } else { if (text->show_cursor) { PangoRectangle strong_pos, weak_pos; - gchar *offs = g_utf8_offset_to_pointer (text->text, text->selection_start); + gchar *offs; + + offs = g_utf8_offset_to_pointer ( + text->text, text->selection_start); pango_layout_get_cursor_pos ( text->layout, offs - text->text + @@ -1867,7 +1875,10 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) /* Simulate a GdkEventButton here, so that we can * call e_text_do_popup directly */ - GdkEventButton *button = (GdkEventButton *) gdk_event_new (GDK_BUTTON_PRESS); + GdkEventButton *button; + + button = (GdkEventButton *) + gdk_event_new (GDK_BUTTON_PRESS); button->time = event->key.time; button->button = 0; e_text_do_popup (text, button, 0); @@ -1883,7 +1894,9 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) gint ret; if (text->im_context && - gtk_im_context_filter_keypress (text->im_context, (GdkEventKey*) event)) { + gtk_im_context_filter_keypress ( + text->im_context, + (GdkEventKey*) event)) { text->need_im_reset = TRUE; return 1; } @@ -1935,10 +1948,12 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = get_position_from_xy (text, button.x, button.y); + e_tep_event.button.position = + get_position_from_xy ( + text, button.x, button.y); _get_tep (text); - return_val = e_text_event_processor_handle_event (text->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + text->tep, &e_tep_event); e_tep_event.type = GDK_BUTTON_RELEASE; } #else @@ -1954,8 +1969,11 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) /* We follow convention and emit popup events on right-clicks. */ if (event->type == GDK_BUTTON_PRESS && event->button.button == 3) { if (text->handle_popup) { - e_text_do_popup (text, &(event->button), - get_position_from_xy (text, event->button.x, event->button.y)); + e_text_do_popup ( + text, &(event->button), + get_position_from_xy ( + text, event->button.x, + event->button.y)); return 1; } else { @@ -1968,13 +1986,13 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) if (event->type == GDK_BUTTON_PRESS) { if (text->dbl_timeout == 0 && text->tpl_timeout == 0) { - text->dbl_timeout = g_timeout_add (200, - _click, - &(text->dbl_timeout)); + text->dbl_timeout = g_timeout_add ( + 200, _click, &(text->dbl_timeout)); } else { if (text->tpl_timeout == 0) { e_tep_event.type = GDK_2BUTTON_PRESS; - text->tpl_timeout = g_timeout_add (200, _click, &(text->tpl_timeout)); + text->tpl_timeout = g_timeout_add ( + 200, _click, &(text->tpl_timeout)); } else { e_tep_event.type = GDK_3BUTTON_PRESS; } @@ -1986,10 +2004,12 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) e_tep_event.button.time = button.time; e_tep_event.button.state = button.state; e_tep_event.button.button = button.button; - e_tep_event.button.position = get_position_from_xy (text, button.x, button.y); + e_tep_event.button.position = + get_position_from_xy ( + text, button.x, button.y); _get_tep (text); - return_val = e_text_event_processor_handle_event (text->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + text->tep, &e_tep_event); if (event->button.button == 1) { if (event->type == GDK_BUTTON_PRESS) text->button_down = TRUE; @@ -2006,10 +2026,12 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) GdkEventMotion motion = event->motion; e_tep_event.motion.time = motion.time; e_tep_event.motion.state = motion.state; - e_tep_event.motion.position = get_position_from_xy (text, motion.x, motion.y); + e_tep_event.motion.position = + get_position_from_xy ( + text, motion.x, motion.y); _get_tep (text); - return_val = e_text_event_processor_handle_event (text->tep, - &e_tep_event); + return_val = e_text_event_processor_handle_event ( + text->tep, &e_tep_event); text->lastx = motion.x; text->lasty = motion.y; text->last_state = motion.state; @@ -2028,7 +2050,8 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) text->pointer_in = FALSE; if (text->editing || text->draw_borders) { if (!text->default_cursor_shown) { - gdk_window_set_cursor (window, text->default_cursor); + gdk_window_set_cursor ( + window, text->default_cursor); text->default_cursor_shown = TRUE; } } @@ -2329,18 +2352,17 @@ e_text_do_popup (EText *text, GdkEventButton *button, gint position) { PopupClosure *closure = g_new (PopupClosure, 1); - closure->text = text; - g_object_ref (closure->text); + closure->text = g_object_ref (text); closure->button = (GdkEventButton *) gdk_event_copy ((GdkEvent *) button); closure->position = position; gtk_clipboard_request_contents ( - - gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), - GDK_SELECTION_CLIPBOARD), - gdk_atom_intern ("TARGETS", FALSE), - popup_targets_received, - closure); + gtk_widget_get_clipboard ( + GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), + GDK_SELECTION_CLIPBOARD), + gdk_atom_intern ("TARGETS", FALSE), + popup_targets_received, + closure); } static void @@ -2430,7 +2452,8 @@ _get_updated_position (EText *text, gboolean direction) length = g_utf8_strlen (text->text, -1); - /* length checks to make sure we are not wandering off into nonexistant memory... */ + /* length checks to make sure we are not wandering + * off into nonexistant memory... */ if ((text->selection_end >= length) && (TRUE == direction)) /* forward */ return length; /* checking for -ve value wont hurt! */ @@ -2452,7 +2475,8 @@ _get_updated_position (EText *text, gboolean direction) new_pos = text->selection_end; while (1) { - /* check before moving forward/backwards if we have more chars to move or not */ + /* check before moving forward/backwards + * if we have more chars to move or not */ if (TRUE == direction) p = g_utf8_next_char (p); else @@ -2677,7 +2701,8 @@ _get_position (EText *text, ETextEventProcessorCommand *command) to activate that object. (Normally, double click == select word, which is why this is here.) */ - obj_num = e_text_model_get_object_at_offset (text->model, text->selection_start); + obj_num = e_text_model_get_object_at_offset ( + text->model, text->selection_start); if (obj_num != -1) { e_text_model_activate_nth_object (text->model, obj_num); new_pos = text->selection_start; |