diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-05-21 22:02:58 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2011-05-22 05:56:06 +0800 |
commit | cb97c2dc8fd97b381af048f206333d5e557892ae (patch) | |
tree | c2901380e607a3b439abb1bed165344ba8f4fc83 | |
parent | 64fa8ad9c0851e2d5c1e90ac2e75af8d455d9fea (diff) | |
download | gsoc2013-evolution-cb97c2dc8fd97b381af048f206333d5e557892ae.tar gsoc2013-evolution-cb97c2dc8fd97b381af048f206333d5e557892ae.tar.gz gsoc2013-evolution-cb97c2dc8fd97b381af048f206333d5e557892ae.tar.bz2 gsoc2013-evolution-cb97c2dc8fd97b381af048f206333d5e557892ae.tar.lz gsoc2013-evolution-cb97c2dc8fd97b381af048f206333d5e557892ae.tar.xz gsoc2013-evolution-cb97c2dc8fd97b381af048f206333d5e557892ae.tar.zst gsoc2013-evolution-cb97c2dc8fd97b381af048f206333d5e557892ae.zip |
Coding style and whitespace cleanup.
107 files changed, 2036 insertions, 1101 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-editor-fullname.c b/addressbook/gui/contact-editor/e-contact-editor-fullname.c index dee1bd2630..1ca6014707 100644 --- a/addressbook/gui/contact-editor/e-contact-editor-fullname.c +++ b/addressbook/gui/contact-editor/e-contact-editor-fullname.c @@ -121,10 +121,13 @@ e_contact_editor_fullname_get_property (GObject *object, switch (property_id) { case PROP_NAME: extract_info (e_contact_editor_fullname); - g_value_set_pointer (value, e_contact_name_copy (e_contact_editor_fullname->name)); + g_value_set_pointer ( + value, e_contact_name_copy ( + e_contact_editor_fullname->name)); break; case PROP_EDITABLE: - g_value_set_boolean (value, e_contact_editor_fullname->editable ? TRUE : FALSE); + g_value_set_boolean ( + value, e_contact_editor_fullname->editable); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec); diff --git a/addressbook/gui/contact-editor/e-contact-editor.c b/addressbook/gui/contact-editor/e-contact-editor.c index 4b259e098b..f6e7f0ff71 100644 --- a/addressbook/gui/contact-editor/e-contact-editor.c +++ b/addressbook/gui/contact-editor/e-contact-editor.c @@ -71,25 +71,34 @@ enum { NUM_IM_COLUMNS }; -static void e_contact_editor_init (EContactEditor *editor); -static void e_contact_editor_class_init (EContactEditorClass *klass); -static void e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void e_contact_editor_dispose (GObject *object); - -static void e_contact_editor_raise (EABEditor *editor); -static void e_contact_editor_show (EABEditor *editor); -static void e_contact_editor_save_contact (EABEditor *editor, gboolean should_close); -static void e_contact_editor_close (EABEditor *editor); -static gboolean e_contact_editor_is_valid (EABEditor *editor); -static gboolean e_contact_editor_is_changed (EABEditor *editor); -static GtkWindow* e_contact_editor_get_window (EABEditor *editor); - -static void save_contact (EContactEditor *ce, gboolean should_close); -static void entry_activated (EContactEditor *editor); - -static void set_entry_text (EContactEditor *editor, GtkEntry *entry, const gchar *string); -static void sensitize_ok (EContactEditor *ce); +static void e_contact_editor_init (EContactEditor *editor); +static void e_contact_editor_class_init (EContactEditorClass *klass); +static void e_contact_editor_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void e_contact_editor_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void e_contact_editor_dispose (GObject *object); +static void e_contact_editor_raise (EABEditor *editor); +static void e_contact_editor_show (EABEditor *editor); +static void e_contact_editor_save_contact (EABEditor *editor, + gboolean should_close); +static void e_contact_editor_close (EABEditor *editor); +static gboolean e_contact_editor_is_valid (EABEditor *editor); +static gboolean e_contact_editor_is_changed (EABEditor *editor); +static GtkWindow * + e_contact_editor_get_window (EABEditor *editor); +static void save_contact (EContactEditor *ce, + gboolean should_close); +static void entry_activated (EContactEditor *editor); + +static void set_entry_text (EContactEditor *editor, + GtkEntry *entry, + const gchar *string); +static void sensitize_ok (EContactEditor *ce); static EABEditorClass *parent_class = NULL; @@ -260,7 +269,9 @@ e_contact_editor_get_type (void) (GInstanceInitFunc) e_contact_editor_init, }; - contact_editor_type = g_type_register_static (EAB_TYPE_EDITOR, "EContactEditor", &contact_editor_info, 0); + contact_editor_type = g_type_register_static ( + EAB_TYPE_EDITOR, "EContactEditor", + &contact_editor_info, 0); } return contact_editor_type; @@ -430,7 +441,9 @@ style_makes_sense (const EContactName *name, const gchar *company, gint style) return FALSE; case 4: /* Fall Through */ case 5: - if (company && *company && name && ((name->given && *name->given) || (name->family && *name->family))) + if (company && *company && name && + ((name->given && *name->given) || + (name->family && *name->family))) return TRUE; else return FALSE; @@ -518,8 +531,11 @@ name_to_style (const EContactName *name, const gchar *company, gint style) static gint file_as_get_style (EContactEditor *editor) { - GtkEntry *file_as = GTK_ENTRY (gtk_bin_get_child (GTK_BIN (e_builder_get_widget(editor->builder, "combo-file-as")))); - GtkEntry *company_w = GTK_ENTRY (e_builder_get_widget (editor->builder, "entry-company")); + GtkEntry *file_as = GTK_ENTRY ( + gtk_bin_get_child (GTK_BIN ( + e_builder_get_widget(editor->builder, "combo-file-as")))); + GtkEntry *company_w = GTK_ENTRY ( + e_builder_get_widget (editor->builder, "entry-company")); gchar *filestring; gchar *trystring; EContactName *name = editor->name; @@ -551,8 +567,10 @@ file_as_set_style (EContactEditor *editor, gint style) gchar *string; gint i; GList *strings = NULL; - GtkComboBox *combo_file_as = GTK_COMBO_BOX (e_builder_get_widget (editor->builder, "combo-file-as")); - GtkEntry *company_w = GTK_ENTRY (e_builder_get_widget (editor->builder, "entry-company")); + GtkComboBox *combo_file_as = GTK_COMBO_BOX ( + e_builder_get_widget (editor->builder, "combo-file-as")); + GtkEntry *company_w = GTK_ENTRY ( + e_builder_get_widget (editor->builder, "entry-company")); const gchar *company; if (!(combo_file_as && GTK_IS_COMBO_BOX (combo_file_as))) @@ -586,7 +604,8 @@ file_as_set_style (EContactEditor *editor, gint style) GtkListStore *list_store; GtkTreeIter iter; - list_store = GTK_LIST_STORE (gtk_combo_box_get_model (combo_file_as)); + list_store = GTK_LIST_STORE ( + gtk_combo_box_get_model (combo_file_as)); gtk_list_store_clear (list_store); @@ -601,7 +620,9 @@ file_as_set_style (EContactEditor *editor, gint style) if (style != -1) { string = name_to_style (editor->name, company, style); - set_entry_text (editor, GTK_ENTRY (gtk_bin_get_child (GTK_BIN (combo_file_as))), string); + set_entry_text ( + editor, GTK_ENTRY (gtk_bin_get_child ( + GTK_BIN (combo_file_as))), string); g_free (string); } } @@ -683,16 +704,24 @@ sensitize_ok (EContactEditor *ce) { GtkWidget *widget; gboolean allow_save; - GtkWidget *entry_fullname = e_builder_get_widget (ce->builder, "entry-fullname" ); - GtkWidget *entry_file_as = gtk_bin_get_child (GTK_BIN (e_builder_get_widget (ce->builder, "combo-file-as"))); - GtkWidget *company_name = e_builder_get_widget (ce->builder, "entry-company"); - const gchar *name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); - const gchar *file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); - const gchar *company_name_string = gtk_entry_get_text (GTK_ENTRY (company_name)); - - allow_save = ce->target_editable && ce->changed ? TRUE : FALSE; - - if (!strcmp (name_entry_string, "") || !strcmp (file_as_entry_string, "")) { + GtkWidget *entry_fullname = + e_builder_get_widget (ce->builder, "entry-fullname" ); + GtkWidget *entry_file_as = + gtk_bin_get_child (GTK_BIN ( + e_builder_get_widget (ce->builder, "combo-file-as"))); + GtkWidget *company_name = + e_builder_get_widget (ce->builder, "entry-company"); + const gchar *name_entry_string = + gtk_entry_get_text (GTK_ENTRY (entry_fullname)); + const gchar *file_as_entry_string = + gtk_entry_get_text (GTK_ENTRY (entry_file_as)); + const gchar *company_name_string = + gtk_entry_get_text (GTK_ENTRY (company_name)); + + allow_save = ce->target_editable && ce->changed; + + if (!strcmp (name_entry_string, "") || + !strcmp (file_as_entry_string, "")) { if (strcmp (company_name_string , "")) { allow_save = TRUE; } @@ -766,7 +795,8 @@ init_email_record_location (EContactEditor *editor, gint record) g_free (widget_name); widget_name = g_strdup_printf ("combobox-email-%d", record); - location_combo_box = GTK_COMBO_BOX (e_builder_get_widget (editor->builder, widget_name)); + location_combo_box = GTK_COMBO_BOX ( + e_builder_get_widget (editor->builder, widget_name)); g_free (widget_name); store = GTK_LIST_STORE (gtk_combo_box_get_model (location_combo_box)); @@ -779,14 +809,25 @@ init_email_record_location (EContactEditor *editor, gint record) -1); } - g_signal_connect_swapped (location_combo_box, "changed", G_CALLBACK (gtk_widget_grab_focus), email_entry); - g_signal_connect (location_combo_box, "changed", G_CALLBACK (object_changed), editor); - g_signal_connect (email_entry, "changed", G_CALLBACK (object_changed), editor); - g_signal_connect_swapped (email_entry, "activate", G_CALLBACK (entry_activated), editor); + g_signal_connect_swapped ( + location_combo_box, "changed", + G_CALLBACK (gtk_widget_grab_focus), email_entry); + g_signal_connect ( + location_combo_box, "changed", + G_CALLBACK (object_changed), editor); + g_signal_connect ( + email_entry, "changed", + G_CALLBACK (object_changed), editor); + g_signal_connect_swapped ( + email_entry, "activate", + G_CALLBACK (entry_activated), editor); } static void -fill_in_email_record (EContactEditor *editor, gint record, const gchar *address, gint location) +fill_in_email_record (EContactEditor *editor, + gint record, + const gchar *address, + gint location) { GtkWidget *location_combo_box; GtkWidget *email_entry; @@ -807,7 +848,10 @@ fill_in_email_record (EContactEditor *editor, gint record, const gchar *address, } static void -extract_email_record (EContactEditor *editor, gint record, gchar **address, gint *location) +extract_email_record (EContactEditor *editor, + gint record, + gchar **address, + gint *location) { GtkWidget *location_combo_box; GtkWidget *email_entry; @@ -949,7 +993,10 @@ set_ui_slot (EVCardAttribute *attr, gint slot) } static gint -alloc_ui_slot (EContactEditor *editor, const gchar *widget_base, gint preferred_slot, gint num_slots) +alloc_ui_slot (EContactEditor *editor, + const gchar *widget_base, + gint preferred_slot, + gint num_slots) { gchar *widget_name; GtkWidget *widget; @@ -1006,20 +1053,25 @@ fill_in_email (EContactEditor *editor) /* Clear */ for (record_n = 1; record_n <= EMAIL_SLOTS; record_n++) { - fill_in_email_record (editor, record_n, NULL, email_default[record_n - 1]); + fill_in_email_record ( + editor, record_n, NULL, email_default[record_n - 1]); } /* Fill in */ - email_attr_list = e_contact_get_attributes (editor->contact, E_CONTACT_EMAIL); + email_attr_list = e_contact_get_attributes ( + editor->contact, E_CONTACT_EMAIL); - for (record_n = 1, l = email_attr_list; l && record_n <= EMAIL_SLOTS; l = g_list_next (l)) { + for (record_n = 1, l = email_attr_list; + l && record_n <= EMAIL_SLOTS; l = g_list_next (l)) { EVCardAttribute *attr = l->data; gchar *email_address; gint slot; email_address = e_vcard_attribute_get_value (attr); - slot = alloc_ui_slot (editor, "entry-email", get_ui_slot (attr), EMAIL_SLOTS); + slot = alloc_ui_slot ( + editor, "entry-email", + get_ui_slot (attr), EMAIL_SLOTS); if (slot < 1) break; @@ -1049,12 +1101,14 @@ extract_email (EContactEditor *editor) if (!STRING_IS_EMPTY (address)) { EVCardAttribute *attr; - attr = e_vcard_attribute_new ("", e_contact_vcard_attribute (E_CONTACT_EMAIL)); + attr = e_vcard_attribute_new ( + "", e_contact_vcard_attribute (E_CONTACT_EMAIL)); if (location >= 0) - e_vcard_attribute_add_param_with_value (attr, - e_vcard_attribute_param_new (EVC_TYPE), - email_index_to_location (location)); + e_vcard_attribute_add_param_with_value ( + attr, + e_vcard_attribute_param_new (EVC_TYPE), + email_index_to_location (location)); e_vcard_attribute_add_value (attr, address); set_ui_slot (attr, i); @@ -1143,9 +1197,11 @@ init_item_sensitiveable_combo_box (GtkComboBox *combo) "text", 0, "sensitive", 1, NULL); } -/* EContact can get attributes by field ID only, and there is none for TEL, so we need this */ +/* EContact can get attributes by field ID only, + * and there is none for TEL, so we need this */ static GList * -get_attributes_named (EVCard *vcard, const gchar *attr_name) +get_attributes_named (EVCard *vcard, + const gchar *attr_name) { GList *attr_list_in; GList *attr_list_out = NULL; @@ -1160,16 +1216,21 @@ get_attributes_named (EVCard *vcard, const gchar *attr_name) name = e_vcard_attribute_get_name (attr); if (!g_ascii_strcasecmp (attr_name, name)) { - attr_list_out = g_list_append (attr_list_out, e_vcard_attribute_copy (attr)); + attr_list_out = g_list_append ( + attr_list_out, + e_vcard_attribute_copy (attr)); } } return attr_list_out; } -/* EContact can set attributes by field ID only, and there is none for TEL, so we need this */ +/* EContact can set attributes by field ID only, + * and there is none for TEL, so we need this */ static void -set_attributes_named (EVCard *vcard, const gchar *attr_name, GList *attr_list) +set_attributes_named (EVCard *vcard, + const gchar *attr_name, + GList *attr_list) { GList *l; @@ -1191,9 +1252,11 @@ set_arrow_image (EContactEditor *editor, arrow = e_builder_get_widget (editor->builder, arrow_widget); if (expanded) - gtk_arrow_set (GTK_ARROW (arrow), GTK_ARROW_DOWN, GTK_SHADOW_NONE); + gtk_arrow_set ( + GTK_ARROW (arrow), GTK_ARROW_DOWN, GTK_SHADOW_NONE); else - gtk_arrow_set (GTK_ARROW (arrow), GTK_ARROW_RIGHT, GTK_SHADOW_NONE); + gtk_arrow_set ( + GTK_ARROW (arrow), GTK_ARROW_RIGHT, GTK_SHADOW_NONE); } static void @@ -1275,7 +1338,10 @@ init_email (EContactEditor *editor) } static void -fill_in_phone_record (EContactEditor *editor, gint record, const gchar *phone, gint phone_type) +fill_in_phone_record (EContactEditor *editor, + gint record, + const gchar *phone, + gint phone_type) { GtkWidget *phone_type_combo_box; GtkWidget *phone_entry; @@ -1299,7 +1365,10 @@ fill_in_phone_record (EContactEditor *editor, gint record, const gchar *phone, g } static void -extract_phone_record (EContactEditor *editor, gint record, gchar **phone, gint *phone_type) +extract_phone_record (EContactEditor *editor, + gint record, + gchar **phone, + gint *phone_type) { GtkWidget *phone_type_combo_box; GtkWidget *phone_entry; @@ -1334,7 +1403,8 @@ fill_in_phone (EContactEditor *editor) phone_attr_list = get_attributes_named (E_VCARD (editor->contact), "TEL"); - for (record_n = 1, l = phone_attr_list; l && record_n <= PHONE_SLOTS; l = g_list_next (l)) { + for (record_n = 1, l = phone_attr_list; + l && record_n <= PHONE_SLOTS; l = g_list_next (l)) { EVCardAttribute *attr = l->data; gchar *phone; gint slot; @@ -1433,7 +1503,10 @@ init_phone_record_type (EContactEditor *editor, gint record) init_item_sensitiveable_combo_box (GTK_COMBO_BOX (phone_type_combo_box)); - store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (phone_type_combo_box))); + store = GTK_LIST_STORE ( + gtk_combo_box_get_model ( + GTK_COMBO_BOX (phone_type_combo_box))); + for (i = 0; i < G_N_ELEMENTS (phones); i++) { GtkTreeIter iter; @@ -1445,10 +1518,18 @@ init_phone_record_type (EContactEditor *editor, gint record) -1); } - g_signal_connect_swapped (phone_type_combo_box, "changed", G_CALLBACK (gtk_widget_grab_focus), phone_entry); - g_signal_connect (phone_type_combo_box, "changed", G_CALLBACK (object_changed), editor); - g_signal_connect (phone_entry, "changed", G_CALLBACK (object_changed), editor); - g_signal_connect_swapped (phone_entry, "activate", G_CALLBACK (entry_activated), editor); + g_signal_connect_swapped ( + phone_type_combo_box, "changed", + G_CALLBACK (gtk_widget_grab_focus), phone_entry); + g_signal_connect ( + phone_type_combo_box, "changed", + G_CALLBACK (object_changed), editor); + g_signal_connect ( + phone_entry, "changed", + G_CALLBACK (object_changed), editor); + g_signal_connect_swapped ( + phone_entry, "activate", + G_CALLBACK (entry_activated), editor); } static void @@ -1540,7 +1621,10 @@ init_im_record_location (EContactEditor *editor, gint record) init_item_sensitiveable_combo_box (GTK_COMBO_BOX (location_combo_box)); - store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (location_combo_box))); + store = GTK_LIST_STORE ( + gtk_combo_box_get_model ( + GTK_COMBO_BOX (location_combo_box))); + for (i = 0; i < G_N_ELEMENTS (common_location); i++) { GtkTreeIter iter; @@ -1552,7 +1636,9 @@ init_im_record_location (EContactEditor *editor, gint record) -1); } - g_signal_connect (location_combo_box, "changed", G_CALLBACK (object_changed), editor); + g_signal_connect ( + location_combo_box, "changed", + G_CALLBACK (object_changed), editor); #endif } @@ -1580,7 +1666,10 @@ init_im_record_service (EContactEditor *editor, gint record) init_item_sensitiveable_combo_box (GTK_COMBO_BOX (service_combo_box)); - store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (service_combo_box))); + store = GTK_LIST_STORE ( + gtk_combo_box_get_model ( + GTK_COMBO_BOX (service_combo_box))); + for (i = 0; i < G_N_ELEMENTS (im_service); i++) { GtkTreeIter iter; @@ -1592,10 +1681,18 @@ init_im_record_service (EContactEditor *editor, gint record) -1); } - g_signal_connect_swapped (service_combo_box, "changed", G_CALLBACK (gtk_widget_grab_focus), name_entry); - g_signal_connect (service_combo_box, "changed", G_CALLBACK (object_changed), editor); - g_signal_connect (name_entry, "changed", G_CALLBACK (object_changed), editor); - g_signal_connect_swapped (name_entry, "activate", G_CALLBACK (entry_activated), editor); + g_signal_connect_swapped ( + service_combo_box, "changed", + G_CALLBACK (gtk_widget_grab_focus), name_entry); + g_signal_connect ( + service_combo_box, "changed", + G_CALLBACK (object_changed), editor); + g_signal_connect ( + name_entry, "changed", + G_CALLBACK (object_changed), editor); + g_signal_connect_swapped ( + name_entry, "activate", + G_CALLBACK (entry_activated), editor); } static void @@ -1610,7 +1707,11 @@ init_im (EContactEditor *editor) } static void -fill_in_im_record (EContactEditor *editor, gint record, gint service, const gchar *name, gint location) +fill_in_im_record (EContactEditor *editor, + gint record, + gint service, + const gchar *name, + gint location) { GtkWidget *service_combo_box; #ifdef ENABLE_IM_LOCATION @@ -1685,7 +1786,11 @@ fill_in_im (EContactEditor *editor) } static void -extract_im_record (EContactEditor *editor, gint record, gint *service, gchar **name, gint *location) +extract_im_record (EContactEditor *editor, + gint record, + gint *service, + gchar **name, + gint *location) { GtkWidget *service_combo_box; #ifdef ENABLE_IM_LOCATION @@ -1735,12 +1840,15 @@ extract_im (EContactEditor *editor) extract_im_record (editor, i, &service, &name, &location); if (!STRING_IS_EMPTY (name)) { - attr = e_vcard_attribute_new ("", e_contact_vcard_attribute (im_service [service].field)); + attr = e_vcard_attribute_new ( + "", e_contact_vcard_attribute ( + im_service[service].field)); if (location >= 0) - e_vcard_attribute_add_param_with_value (attr, - e_vcard_attribute_param_new (EVC_TYPE), - im_index_to_location (location)); + e_vcard_attribute_add_param_with_value ( + attr, + e_vcard_attribute_param_new (EVC_TYPE), + im_index_to_location (location)); e_vcard_attribute_add_value (attr, name); set_ui_slot (attr, i); @@ -1759,11 +1867,15 @@ extract_im (EContactEditor *editor) /* Splice in the old attributes, minus the filled_in_slots first */ - old_service_attr_list = e_contact_get_attributes (editor->contact, im_service[i].field); - filled_in_slots = MIN (remaining_slots, g_list_length (old_service_attr_list)); + old_service_attr_list = e_contact_get_attributes ( + editor->contact, im_service[i].field); + filled_in_slots = + MIN (remaining_slots, + g_list_length (old_service_attr_list)); remaining_slots -= filled_in_slots; - for (l = old_service_attr_list, j = 0; l && j < filled_in_slots; l = l_next, j++) { + for (l = old_service_attr_list, j = 0; + l && j < filled_in_slots; l = l_next, j++) { l_next = g_list_next (l); e_vcard_attribute_free (l->data); @@ -1771,7 +1883,8 @@ extract_im (EContactEditor *editor) } old_service_attr_list = l; - service_attr_list[i] = g_list_concat (service_attr_list[i], old_service_attr_list); + service_attr_list[i] = g_list_concat ( + service_attr_list[i], old_service_attr_list); e_contact_set_attributes ( editor->contact, @@ -1879,30 +1992,41 @@ init_personal (EContactEditor *editor) static void init_address_textview (EContactEditor *editor, gint record) { - gchar *textview_name; - GtkWidget *textview; + gchar *textview_name; + GtkWidget *textview; GtkTextBuffer *text_buffer; - textview_name = g_strdup_printf ("textview-%s-address", address_name [record]); + textview_name = g_strdup_printf ( + "textview-%s-address", address_name [record]); textview = e_builder_get_widget (editor->builder, textview_name); g_free (textview_name); text_buffer = gtk_text_view_get_buffer (GTK_TEXT_VIEW (textview)); - g_signal_connect (text_buffer, "changed", G_CALLBACK (object_changed), editor); + + g_signal_connect ( + text_buffer, "changed", + G_CALLBACK (object_changed), editor); } static void -init_address_field (EContactEditor *editor, gint record, const gchar *widget_field_name) +init_address_field (EContactEditor *editor, + gint record, + const gchar *widget_field_name) { - gchar *entry_name; + gchar *entry_name; GtkWidget *entry; - entry_name = g_strdup_printf ("entry-%s-%s", address_name [record], widget_field_name); + entry_name = g_strdup_printf ( + "entry-%s-%s", address_name [record], widget_field_name); entry = e_builder_get_widget (editor->builder, entry_name); g_free (entry_name); - g_signal_connect (entry, "changed", G_CALLBACK (object_changed), editor); - g_signal_connect_swapped (entry, "activate", G_CALLBACK (entry_activated), editor); + g_signal_connect ( + entry, "changed", + G_CALLBACK (object_changed), editor); + g_signal_connect_swapped ( + entry, "activate", + G_CALLBACK (entry_activated), editor); } static void @@ -1931,7 +2055,9 @@ init_address (EContactEditor *editor) } static void -fill_in_address_textview (EContactEditor *editor, gint record, EContactAddress *address) +fill_in_address_textview (EContactEditor *editor, + gint record, + EContactAddress *address) { gchar *textview_name; GtkWidget *textview; @@ -1957,7 +2083,9 @@ fill_in_address_textview (EContactEditor *editor, gint record, EContactAddress * } static void -fill_in_address_label_textview (EContactEditor *editor, gint record, const gchar *label) +fill_in_address_label_textview (EContactEditor *editor, + gint record, + const gchar *label) { gchar *textview_name; GtkWidget *textview; @@ -1980,7 +2108,8 @@ fill_in_address_field (EContactEditor *editor, gchar *entry_name; GtkWidget *entry; - entry_name = g_strdup_printf ("entry-%s-%s", address_name [record], widget_field_name); + entry_name = g_strdup_printf ( + "entry-%s-%s", address_name [record], widget_field_name); entry = e_builder_get_widget (editor->builder, entry_name); g_free (entry_name); @@ -1988,7 +2117,8 @@ fill_in_address_field (EContactEditor *editor, } static void -fill_in_address_record (EContactEditor *editor, gint record) +fill_in_address_record (EContactEditor *editor, + gint record) { EContactAddress *address; gchar *address_label; @@ -2029,7 +2159,9 @@ fill_in_address (EContactEditor *editor) } static void -extract_address_textview (EContactEditor *editor, gint record, EContactAddress *address) +extract_address_textview (EContactEditor *editor, + gint record, + EContactAddress *address) { gchar *textview_name; GtkWidget *textview; @@ -2070,12 +2202,15 @@ extract_address_textview (EContactEditor *editor, gint record, EContactAddress * } static gchar * -extract_address_field (EContactEditor *editor, gint record, const gchar *widget_field_name) +extract_address_field (EContactEditor *editor, + gint record, + const gchar *widget_field_name) { gchar *entry_name; GtkWidget *entry; - entry_name = g_strdup_printf ("entry-%s-%s", address_name [record], widget_field_name); + entry_name = g_strdup_printf ( + "entry-%s-%s", address_name [record], widget_field_name); entry = e_builder_get_widget (editor->builder, entry_name); g_free (entry_name); @@ -2083,7 +2218,9 @@ extract_address_field (EContactEditor *editor, gint record, const gchar *widget_ } static gchar * -append_to_address_label (gchar *address_label, const gchar *part, gboolean newline) +append_to_address_label (gchar *address_label, + const gchar *part, + gboolean newline) { gchar *new_address_label; @@ -2091,7 +2228,9 @@ append_to_address_label (gchar *address_label, const gchar *part, gboolean newli return address_label; if (address_label) - new_address_label = g_strjoin (newline ? "\n" : ", ", address_label, part, NULL); + new_address_label = g_strjoin ( + newline ? "\n" : ", ", + address_label, part, NULL); else new_address_label = g_strdup (part); @@ -2100,18 +2239,27 @@ append_to_address_label (gchar *address_label, const gchar *part, gboolean newli } static void -set_address_label (EContact *contact, EContactField field, EContactAddress *address) +set_address_label (EContact *contact, + EContactField field, + EContactAddress *address) { gchar *address_label = NULL; if (address) { - address_label = append_to_address_label (address_label, address->street, TRUE); - address_label = append_to_address_label (address_label, address->ext, TRUE); - address_label = append_to_address_label (address_label, address->locality, TRUE); - address_label = append_to_address_label (address_label, address->region, FALSE); - address_label = append_to_address_label (address_label, address->code, TRUE); - address_label = append_to_address_label (address_label, address->po, TRUE); - address_label = append_to_address_label (address_label, address->country, TRUE); + address_label = append_to_address_label ( + address_label, address->street, TRUE); + address_label = append_to_address_label ( + address_label, address->ext, TRUE); + address_label = append_to_address_label ( + address_label, address->locality, TRUE); + address_label = append_to_address_label ( + address_label, address->region, FALSE); + address_label = append_to_address_label ( + address_label, address->code, TRUE); + address_label = append_to_address_label ( + address_label, address->po, TRUE); + address_label = append_to_address_label ( + address_label, address->country, TRUE); } e_contact_set (contact, field, address_label); @@ -2160,7 +2308,9 @@ extract_address (EContactEditor *editor) } static void -sensitize_address_textview (EContactEditor *editor, gint record, gboolean enabled) +sensitize_address_textview (EContactEditor *editor, + gint record, + gboolean enabled) { gchar *widget_name; GtkWidget *textview; @@ -2188,11 +2338,13 @@ sensitize_address_field (EContactEditor *editor, GtkWidget *entry; GtkWidget *label; - widget_name = g_strdup_printf ("entry-%s-%s", address_name [record], widget_field_name); + widget_name = g_strdup_printf ( + "entry-%s-%s", address_name [record], widget_field_name); entry = e_builder_get_widget (editor->builder, widget_name); g_free (widget_name); - widget_name = g_strdup_printf ("label-%s-%s", address_name [record], widget_field_name); + widget_name = g_strdup_printf ( + "label-%s-%s", address_name [record], widget_field_name); label = e_builder_get_widget (editor->builder, widget_name); g_free (widget_name); @@ -2316,34 +2468,40 @@ init_simple_field (EContactEditor *editor, GtkWidget *widget) if (GTK_IS_ENTRY (widget)) { changed_object = G_OBJECT (widget); - g_signal_connect_swapped (widget, "activate", G_CALLBACK (entry_activated), editor); - } - else if (GTK_IS_COMBO_BOX (widget)) { - changed_object = G_OBJECT (/*gtk_bin_get_child (GTK_BIN*/ (widget)/*)*/); - g_signal_connect_swapped (gtk_bin_get_child (GTK_BIN (widget)), "activate", G_CALLBACK (entry_activated), editor); - } - else if (GTK_IS_TEXT_VIEW (widget)) { - changed_object = G_OBJECT (gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget))); - } - else if (E_IS_URL_ENTRY (widget)) { - changed_object = G_OBJECT (e_url_entry_get_entry (E_URL_ENTRY (widget))); + g_signal_connect_swapped ( + widget, "activate", + G_CALLBACK (entry_activated), editor); + } else if (GTK_IS_COMBO_BOX (widget)) { + changed_object = G_OBJECT (widget); + g_signal_connect_swapped ( + gtk_bin_get_child (GTK_BIN (widget)), "activate", + G_CALLBACK (entry_activated), editor); + } else if (GTK_IS_TEXT_VIEW (widget)) { + changed_object = G_OBJECT ( + gtk_text_view_get_buffer (GTK_TEXT_VIEW (widget))); + } else if (E_IS_URL_ENTRY (widget)) { + changed_object = G_OBJECT ( + e_url_entry_get_entry (E_URL_ENTRY (widget))); g_signal_connect_swapped ( changed_object, "activate", G_CALLBACK (entry_activated), editor); - } - else if (E_IS_DATE_EDIT (widget)) { + } else if (E_IS_DATE_EDIT (widget)) { changed_object = G_OBJECT (widget); - } - else if (E_IS_IMAGE_CHOOSER (widget)) { + } else if (E_IS_IMAGE_CHOOSER (widget)) { changed_object = G_OBJECT (widget); - g_signal_connect (widget, "changed", G_CALLBACK (image_chooser_changed), editor); - } - else if (GTK_IS_TOGGLE_BUTTON (widget)) { - g_signal_connect (widget, "toggled", G_CALLBACK (object_changed), editor); + g_signal_connect ( + widget, "changed", + G_CALLBACK (image_chooser_changed), editor); + } else if (GTK_IS_TOGGLE_BUTTON (widget)) { + g_signal_connect ( + widget, "toggled", + G_CALLBACK (object_changed), editor); } if (changed_object) - g_signal_connect (changed_object, "changed", G_CALLBACK (object_changed), editor); + g_signal_connect ( + changed_object, "changed", + G_CALLBACK (object_changed), editor); } static void @@ -2363,7 +2521,9 @@ fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) } else if (GTK_IS_COMBO_BOX (widget)) { gchar *text = e_contact_get (contact, field_id); - gtk_entry_set_text (GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))), STRING_MAKE_NON_NULL (text)); + gtk_entry_set_text ( + GTK_ENTRY (gtk_bin_get_child (GTK_BIN (widget))), + STRING_MAKE_NON_NULL (text)); g_free (text); } else if (GTK_IS_TEXT_VIEW (widget)) { @@ -2392,14 +2552,19 @@ fill_in_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) else if (E_IS_IMAGE_CHOOSER (widget)) { EContactPhoto *photo = e_contact_get (contact, field_id); if (photo && photo->type == E_CONTACT_PHOTO_TYPE_INLINED) { - e_image_chooser_set_image_data (E_IMAGE_CHOOSER (widget), - (gchar *) photo->data.inlined.data, - photo->data.inlined.length); + e_image_chooser_set_image_data ( + E_IMAGE_CHOOSER (widget), + (gchar *) photo->data.inlined.data, + photo->data.inlined.length); editor->image_set = TRUE; } else { - gchar *file_name = e_icon_factory_get_icon_filename ("avatar-default", GTK_ICON_SIZE_DIALOG); - e_image_chooser_set_from_file (E_IMAGE_CHOOSER (widget), file_name); + gchar *file_name; + + file_name = e_icon_factory_get_icon_filename ( + "avatar-default", GTK_ICON_SIZE_DIALOG); + e_image_chooser_set_from_file ( + E_IMAGE_CHOOSER (widget), file_name); editor->image_set = FALSE; g_free (file_name); } @@ -2442,7 +2607,11 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) gchar *text = NULL; if (gtk_combo_box_get_active_iter (GTK_COMBO_BOX (widget), &iter)) { - GtkListStore *store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (widget))); + GtkListStore *store; + + store = GTK_LIST_STORE ( + gtk_combo_box_get_model ( + GTK_COMBO_BOX (widget))); gtk_tree_model_get (GTK_TREE_MODEL (store), &iter, 0, &text, @@ -2496,7 +2665,10 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) photo.data.inlined.data = (guchar *) img_buff; img_buff = NULL; - gdk_pixbuf_loader_write (loader, photo.data.inlined.data, photo.data.inlined.length, NULL); + gdk_pixbuf_loader_write ( + loader, + photo.data.inlined.data, + photo.data.inlined.length, NULL); gdk_pixbuf_loader_close (loader, NULL); pixbuf = gdk_pixbuf_loader_get_pixbuf (loader); @@ -2526,12 +2698,15 @@ extract_simple_field (EContactEditor *editor, GtkWidget *widget, gint field_id) new = e_icon_factory_pixbuf_scale (pixbuf, width, height); if (new) { - GdkPixbufFormat *format = gdk_pixbuf_loader_get_format (loader); - gchar *format_name = gdk_pixbuf_format_get_name (format); + GdkPixbufFormat *format = + gdk_pixbuf_loader_get_format (loader); + gchar *format_name = + gdk_pixbuf_format_get_name (format); g_free (photo.data.inlined.data); - gdk_pixbuf_save_to_buffer (new, &img_buff, - &photo.data.inlined.length, - format_name, NULL, NULL); + gdk_pixbuf_save_to_buffer ( + new, &img_buff, + &photo.data.inlined.length, + format_name, NULL, NULL); photo.data.inlined.data = (guchar *) img_buff; img_buff = NULL; g_free (format_name); @@ -2987,7 +3162,8 @@ image_selected (EContactEditor *editor) gchar *file_name; GtkWidget *image_chooser; - file_name = gtk_file_chooser_get_filename (GTK_FILE_CHOOSER (editor->file_selector)); + file_name = gtk_file_chooser_get_filename ( + GTK_FILE_CHOOSER (editor->file_selector)); if (!file_name) return; @@ -3009,13 +3185,18 @@ image_cleared (EContactEditor *editor) GtkWidget *image_chooser; gchar *file_name; - image_chooser = e_builder_get_widget (editor->builder, "image-chooser"); + image_chooser = e_builder_get_widget ( + editor->builder, "image-chooser"); - file_name = e_icon_factory_get_icon_filename ("avatar-default", GTK_ICON_SIZE_DIALOG); + file_name = e_icon_factory_get_icon_filename ( + "avatar-default", GTK_ICON_SIZE_DIALOG); - g_signal_handlers_block_by_func (image_chooser, image_chooser_changed, editor); - e_image_chooser_set_from_file (E_IMAGE_CHOOSER (image_chooser), file_name); - g_signal_handlers_unblock_by_func (image_chooser, image_chooser_changed, editor); + g_signal_handlers_block_by_func ( + image_chooser, image_chooser_changed, editor); + e_image_chooser_set_from_file ( + E_IMAGE_CHOOSER (image_chooser), file_name); + g_signal_handlers_unblock_by_func ( + image_chooser, image_chooser_changed, editor); g_free (file_name); @@ -3058,9 +3239,11 @@ update_preview_cb (GtkFileChooser *file_chooser, gpointer data) pixbuf = gdk_pixbuf_new_from_file_at_size (filename, 128, 128, NULL); if (!pixbuf) { gchar *alternate_file; - alternate_file = e_icon_factory_get_icon_filename ("avatar-default", GTK_ICON_SIZE_DIALOG); + alternate_file = e_icon_factory_get_icon_filename ( + "avatar-default", GTK_ICON_SIZE_DIALOG); if (alternate_file) { - pixbuf = gdk_pixbuf_new_from_file_at_size (alternate_file, 128, 128, NULL); + pixbuf = gdk_pixbuf_new_from_file_at_size ( + alternate_file, 128, 128, NULL); g_free (alternate_file); } } @@ -3087,13 +3270,19 @@ image_clicked (GtkWidget *button, EContactEditor *editor) no_image, GTK_RESPONSE_NO, NULL); preview = GTK_IMAGE (gtk_image_new ()); - gtk_file_chooser_set_preview_widget ((GtkFileChooser *) editor->file_selector, GTK_WIDGET (preview)); + gtk_file_chooser_set_preview_widget ( + GTK_FILE_CHOOSER (editor->file_selector), + GTK_WIDGET (preview)); g_signal_connect ( editor->file_selector, "update-preview", G_CALLBACK (update_preview_cb), preview); - gtk_dialog_set_default_response (GTK_DIALOG (editor->file_selector), GTK_RESPONSE_ACCEPT); + gtk_dialog_set_default_response ( + GTK_DIALOG (editor->file_selector), + GTK_RESPONSE_ACCEPT); - gtk_file_chooser_set_current_folder (GTK_FILE_CHOOSER (editor->file_selector), g_get_home_dir ()); + gtk_file_chooser_set_current_folder ( + GTK_FILE_CHOOSER (editor->file_selector), + g_get_home_dir ()); g_signal_connect ( editor->file_selector, "response", @@ -3151,7 +3340,10 @@ contact_moved_cb (EBook *book, const GError *error, EditorCloseStruct *ecs) } static void -contact_added_cb (EBook *book, const GError *error, const gchar *id, EditorCloseStruct *ecs) +contact_added_cb (EBook *book, + const GError *error, + const gchar *id, + EditorCloseStruct *ecs) { EContactEditor *ce = ecs->ce; gboolean should_close = ecs->should_close; @@ -3264,7 +3456,8 @@ save_contact (EContactEditor *ce, gboolean should_close) } entry_fullname = e_builder_get_widget (ce->builder, "entry-fullname" ); - entry_file_as = gtk_bin_get_child (GTK_BIN (e_builder_get_widget (ce->builder, "combo-file-as"))); + entry_file_as = gtk_bin_get_child ( + GTK_BIN (e_builder_get_widget (ce->builder, "combo-file-as"))); company_name = e_builder_get_widget (ce->builder, "entry-company"); name_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_fullname)); file_as_entry_string = gtk_entry_get_text (GTK_ENTRY (entry_file_as)); @@ -3629,7 +3822,8 @@ e_contact_editor_init (EContactEditor *e_contact_editor) widget = e_contact_editor->app; gtk_widget_ensure_style (widget); - gtk_window_set_type_hint (GTK_WINDOW (widget), GDK_WINDOW_TYPE_HINT_NORMAL); + gtk_window_set_type_hint ( + GTK_WINDOW (widget), GDK_WINDOW_TYPE_HINT_NORMAL); container = gtk_dialog_get_action_area (GTK_DIALOG (widget)); gtk_container_set_border_width (GTK_CONTAINER (container), 12); container = gtk_dialog_get_content_area (GTK_DIALOG (widget)); @@ -3637,30 +3831,61 @@ e_contact_editor_init (EContactEditor *e_contact_editor) init_all (e_contact_editor); - widget = e_builder_get_widget (e_contact_editor->builder, "button-image"); - g_signal_connect (widget, "clicked", G_CALLBACK (image_clicked), e_contact_editor); - - widget = e_builder_get_widget(e_contact_editor->builder, "button-fullname"); - g_signal_connect (widget, "clicked", G_CALLBACK (full_name_clicked), e_contact_editor); - widget = e_builder_get_widget(e_contact_editor->builder, "button-categories"); - g_signal_connect (widget, "clicked", G_CALLBACK (categories_clicked), e_contact_editor); - widget = e_builder_get_widget (e_contact_editor->builder, "source-combo-box-source"); - e_util_set_source_combo_box_list (widget, "/apps/evolution/addressbook/sources"); - g_signal_connect (widget, "changed", G_CALLBACK (source_changed), e_contact_editor); - label = e_builder_get_widget (e_contact_editor->builder, "where-label"); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-image"); + g_signal_connect ( + widget, "clicked", + G_CALLBACK (image_clicked), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-fullname"); + g_signal_connect ( + widget, "clicked", + G_CALLBACK (full_name_clicked), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-categories"); + g_signal_connect ( + widget, "clicked", + G_CALLBACK (categories_clicked), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "source-combo-box-source"); + e_util_set_source_combo_box_list ( + widget, "/apps/evolution/addressbook/sources"); + g_signal_connect ( + widget, "changed", + G_CALLBACK (source_changed), e_contact_editor); + label = e_builder_get_widget ( + e_contact_editor->builder, "where-label"); gtk_label_set_mnemonic_widget (GTK_LABEL (label), widget); - widget = e_builder_get_widget (e_contact_editor->builder, "button-ok"); - g_signal_connect (widget, "clicked", G_CALLBACK (file_save_and_close_cb), e_contact_editor); - widget = e_builder_get_widget (e_contact_editor->builder, "button-cancel"); - g_signal_connect (widget, "clicked", G_CALLBACK (file_cancel_cb), e_contact_editor); - widget = e_builder_get_widget (e_contact_editor->builder, "button-help"); - g_signal_connect (widget, "clicked", G_CALLBACK (show_help_cb), e_contact_editor); - widget = e_builder_get_widget (e_contact_editor->builder, "button-web-expand"); - g_signal_connect_swapped (widget, "clicked", G_CALLBACK (expand_web_toggle), e_contact_editor); - widget = e_builder_get_widget (e_contact_editor->builder, "button-phone-expand"); - g_signal_connect_swapped (widget, "clicked", G_CALLBACK (expand_phone_toggle), e_contact_editor); - widget = e_builder_get_widget (e_contact_editor->builder, "button-mail-expand"); - g_signal_connect_swapped (widget, "clicked", G_CALLBACK (expand_mail_toggle), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-ok"); + g_signal_connect ( + widget, "clicked", + G_CALLBACK (file_save_and_close_cb), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-cancel"); + g_signal_connect ( + widget, "clicked", + G_CALLBACK (file_cancel_cb), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-help"); + g_signal_connect ( + widget, "clicked", + G_CALLBACK (show_help_cb), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-web-expand"); + g_signal_connect_swapped ( + widget, "clicked", + G_CALLBACK (expand_web_toggle), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-phone-expand"); + g_signal_connect_swapped ( + widget, "clicked", + G_CALLBACK (expand_phone_toggle), e_contact_editor); + widget = e_builder_get_widget ( + e_contact_editor->builder, "button-mail-expand"); + g_signal_connect_swapped ( + widget, "clicked", + G_CALLBACK (expand_mail_toggle), e_contact_editor); widget = e_builder_get_widget (e_contact_editor->builder, "entry-fullname"); if (widget) @@ -3715,7 +3940,9 @@ e_contact_editor_dispose (GObject *object) } if (e_contact_editor->target_book) { - g_signal_handler_disconnect (e_contact_editor->target_book, e_contact_editor->target_editable_id); + g_signal_handler_disconnect ( + e_contact_editor->target_book, + e_contact_editor->target_editable_id); g_object_unref (e_contact_editor->target_book); e_contact_editor->target_book = NULL; } @@ -3746,7 +3973,9 @@ supported_fields_cb (EBook *book, EContactEditor *ce) { if (!g_slist_find (eab_editor_get_all_editors (), ce)) { - g_warning ("supported_fields_cb called for book that's still around, but contact editor that's been destroyed."); + g_warning ( + "supported_fields_cb called for book that's still " + "around, but contact editor that's been destroyed."); return; } @@ -3765,7 +3994,9 @@ required_fields_cb (EBook *book, { if (!g_slist_find (eab_editor_get_all_editors (), ce)) { - g_warning ("supported_fields_cb called for book that's still around, but contact editor that's been destroyed."); + g_warning ( + "supported_fields_cb called for book that's still " + "around, but contact editor that's been destroyed."); return; } @@ -3798,7 +4029,8 @@ e_contact_editor_new (EShell *shell, if (book) e_book_get_supported_fields_async ( - book, (EBookEListAsyncCallback) supported_fields_cb, editor); + book, (EBookEListAsyncCallback) + supported_fields_cb, editor); return editor; } @@ -3821,7 +4053,10 @@ writable_changed (EBook *book, gboolean writable, EContactEditor *ce) } static void -e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_contact_editor_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { EContactEditor *editor; @@ -3930,11 +4165,11 @@ e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *val break; case PROP_IS_NEW_CONTACT: - editor->is_new_contact = g_value_get_boolean (value) ? TRUE : FALSE; + editor->is_new_contact = g_value_get_boolean (value); break; case PROP_EDITABLE: { - gboolean new_value = g_value_get_boolean (value) ? TRUE : FALSE; + gboolean new_value = g_value_get_boolean (value); gboolean changed = (editor->target_editable != new_value); editor->target_editable = new_value; @@ -3945,7 +4180,7 @@ e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *val } case PROP_CHANGED: { - gboolean new_value = g_value_get_boolean (value) ? TRUE : FALSE; + gboolean new_value = g_value_get_boolean (value); gboolean changed = (editor->changed != new_value); editor->changed = new_value; @@ -3982,7 +4217,10 @@ e_contact_editor_set_property (GObject *object, guint prop_id, const GValue *val } static void -e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_contact_editor_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { EContactEditor *e_contact_editor; @@ -4003,26 +4241,33 @@ e_contact_editor_get_property (GObject *object, guint prop_id, GValue *value, GP break; case PROP_IS_NEW_CONTACT: - g_value_set_boolean (value, e_contact_editor->is_new_contact ? TRUE : FALSE); + g_value_set_boolean ( + value, e_contact_editor->is_new_contact); break; case PROP_EDITABLE: - g_value_set_boolean (value, e_contact_editor->target_editable ? TRUE : FALSE); + g_value_set_boolean ( + value, e_contact_editor->target_editable); break; case PROP_CHANGED: - g_value_set_boolean (value, e_contact_editor->changed ? TRUE : FALSE); + g_value_set_boolean ( + value, e_contact_editor->changed); break; case PROP_WRITABLE_FIELDS: if (e_contact_editor->writable_fields) - g_value_set_object (value, e_list_duplicate (e_contact_editor->writable_fields)); + g_value_set_object ( + value, e_list_duplicate ( + e_contact_editor->writable_fields)); else g_value_set_object (value, NULL); break; case PROP_REQUIRED_FIELDS: if (e_contact_editor->required_fields) - g_value_set_object (value, e_list_duplicate (e_contact_editor->required_fields)); + g_value_set_object ( + value, e_list_duplicate ( + e_contact_editor->required_fields)); else g_value_set_object (value, NULL); break; diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index 76a7e5f0cb..cc74968509 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -201,14 +201,19 @@ editor_closed_cb (GtkWidget *w, gpointer closure) } static void -ce_have_contact (EBook *book, const GError *error, EContact *contact, gpointer closure) +ce_have_contact (EBook *book, + const GError *error, + EContact *contact, + gpointer closure) { QuickAdd *qa = (QuickAdd *) closure; if (error) { if (book) g_object_unref (book); - g_warning ("Failed to find contact, status %d (%s).", error->code, error->message); + g_warning ( + "Failed to find contact, status %d (%s).", + error->code, error->message); quick_add_unref (qa); } else { EShell *shell; @@ -304,20 +309,21 @@ clicked_cb (GtkWidget *w, gint button, gpointer closure) gchar *name = NULL; gchar *email = NULL; - if (qa->name_entry) { - gchar *tmp; - tmp = gtk_editable_get_chars (GTK_EDITABLE (qa->name_entry), 0, -1); - name = tmp; - } + if (qa->name_entry) + name = gtk_editable_get_chars ( + GTK_EDITABLE (qa->name_entry), 0, -1); - if (qa->email_entry) { - gchar *tmp; - tmp = gtk_editable_get_chars (GTK_EDITABLE (qa->email_entry), 0, -1); - email = tmp; - } + if (qa->email_entry) + email = gtk_editable_get_chars ( + GTK_EDITABLE (qa->email_entry), 0, -1); + + e_contact_set ( + qa->contact, E_CONTACT_FULL_NAME, + (gpointer) (name != NULL) ? name : ""); - e_contact_set (qa->contact, E_CONTACT_FULL_NAME, (gpointer) (name ? name : "")); - e_contact_set (qa->contact, E_CONTACT_EMAIL_1, (gpointer) (email ? email : "")); + e_contact_set ( + qa->contact, E_CONTACT_EMAIL_1, + (gpointer) (email != NULL) ? email : ""); g_free (name); g_free (email); diff --git a/addressbook/gui/contact-editor/test-editor.c b/addressbook/gui/contact-editor/test-editor.c index 3078aaaaec..857d6ff291 100644 --- a/addressbook/gui/contact-editor/test-editor.c +++ b/addressbook/gui/contact-editor/test-editor.c @@ -76,7 +76,8 @@ editor_closed_cb (EContactEditor *ce, gpointer data) exit (0); } -gint main ( gint argc, gchar *argv[] ) +gint +main (gint argc, gchar *argv[]) { gchar *cardstr; EContactEditor *ce; @@ -90,13 +91,19 @@ gint main ( gint argc, gchar *argv[] ) if (cardstr == NULL) cardstr = TEST_VCARD; - ce = e_contact_editor_new (NULL, e_card_new_with_default_charset (cardstr, "ISO-8859-1"), TRUE, FALSE); - g_signal_connect (ce, "editor_closed", - G_CALLBACK (editor_closed_cb), NULL); - - ce = e_contact_editor_new (NULL, e_card_new_with_default_charset (cardstr, "ISO-8859-1"), TRUE, FALSE); - g_signal_connect (ce, "editor_closed", - G_CALLBACK (editor_closed_cb), NULL); + ce = e_contact_editor_new ( + NULL, e_card_new_with_default_charset ( + cardstr, "ISO-8859-1"), TRUE, FALSE); + g_signal_connect ( + ce, "editor_closed", + G_CALLBACK (editor_closed_cb), NULL); + + ce = e_contact_editor_new ( + NULL, e_card_new_with_default_charset ( + cardstr, "ISO-8859-1"), TRUE, FALSE); + g_signal_connect ( + ce, "editor_closed", + G_CALLBACK (editor_closed_cb), NULL); gtk_main (); diff --git a/addressbook/gui/widgets/e-addressbook-model.c b/addressbook/gui/widgets/e-addressbook-model.c index 8e62e40d28..3be37f26f0 100644 --- a/addressbook/gui/widgets/e-addressbook-model.c +++ b/addressbook/gui/widgets/e-addressbook-model.c @@ -757,7 +757,8 @@ e_addressbook_model_stop (EAddressbookModel *model) g_signal_emit (model, signals[STATUS_MESSAGE], 0, message); if (!model->priv->remove_status_id) - model->priv->remove_status_id = g_timeout_add_seconds (3, remove_status_cb, model); + model->priv->remove_status_id = + g_timeout_add_seconds (3, remove_status_cb, model); } gboolean diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index 017b14ac19..48daaaaf6b 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -557,7 +557,8 @@ e_addressbook_reflow_adapter_get_type (void) (GInstanceInitFunc) e_addressbook_reflow_adapter_init, }; - type = g_type_register_static (PARENT_TYPE, "EAddressbookReflowAdapter", &info, 0); + type = g_type_register_static ( + PARENT_TYPE, "EAddressbookReflowAdapter", &info, 0); } return type; diff --git a/addressbook/gui/widgets/e-addressbook-table-adapter.c b/addressbook/gui/widgets/e-addressbook-table-adapter.c index 83f90a0573..e60ae924e7 100644 --- a/addressbook/gui/widgets/e-addressbook-table-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-table-adapter.c @@ -185,7 +185,8 @@ addressbook_set_value_at (ETableModel *etc, gint col, gint row, gconstpointer va g_object_unref (contact); - /* XXX do we need this? shouldn't the commit_contact generate a changed signal? */ + /* XXX Do we need this? Shouldn't the commit_contact + * generate a changed signal? */ e_table_model_cell_changed (etc, col, row); } } @@ -377,7 +378,8 @@ eab_table_adapter_get_type (void) (GInstanceInitFunc) eab_table_adapter_init, }; - type = g_type_register_static (PARENT_TYPE, "EAddressbookTableAdapter", &info, 0); + type = g_type_register_static ( + PARENT_TYPE, "EAddressbookTableAdapter", &info, 0); } return type; diff --git a/addressbook/gui/widgets/e-minicard-view-widget.c b/addressbook/gui/widgets/e-minicard-view-widget.c index 945639f70b..3f8dd1ff28 100644 --- a/addressbook/gui/widgets/e-minicard-view-widget.c +++ b/addressbook/gui/widgets/e-minicard-view-widget.c @@ -30,16 +30,31 @@ #include "e-util/e-util.h" #include "e-minicard-view-widget.h" -static void e_minicard_view_widget_init (EMinicardViewWidget *widget); -static void e_minicard_view_widget_class_init (EMinicardViewWidgetClass *class); -static void e_minicard_view_widget_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec); -static void e_minicard_view_widget_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec); -static void e_minicard_view_widget_dispose (GObject *object); -static void e_minicard_view_widget_reflow (ECanvas *canvas); -static void e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation); -static void e_minicard_view_widget_style_set (GtkWidget *widget, GtkStyle *previous_style); -static void e_minicard_view_widget_realize (GtkWidget *widget); -static gboolean e_minicard_view_widget_real_focus_in_event (GtkWidget *widget, GdkEventFocus *event); +static void e_minicard_view_widget_init (EMinicardViewWidget *widget); +static void e_minicard_view_widget_class_init + (EMinicardViewWidgetClass *class); +static void e_minicard_view_widget_set_property + (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec); +static void e_minicard_view_widget_get_property + (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec); +static void e_minicard_view_widget_dispose (GObject *object); +static void e_minicard_view_widget_reflow (ECanvas *canvas); +static void e_minicard_view_widget_size_allocate + (GtkWidget *widget, + GtkAllocation *allocation); +static void e_minicard_view_widget_style_set + (GtkWidget *widget, + GtkStyle *previous_style); +static void e_minicard_view_widget_realize (GtkWidget *widget); +static gboolean e_minicard_view_widget_real_focus_in_event + (GtkWidget *widget, + GdkEventFocus *event); static gpointer parent_class; @@ -81,7 +96,8 @@ e_minicard_view_widget_get_type (void) (GInstanceInitFunc) e_minicard_view_widget_init, }; - type = g_type_register_static (e_canvas_get_type (), "EMinicardViewWidget", &info, 0); + type = g_type_register_static ( + E_TYPE_CANVAS, "EMinicardViewWidget", &info, 0); } return type; @@ -202,10 +218,11 @@ e_minicard_view_widget_init (EMinicardViewWidget *view) GtkWidget * e_minicard_view_widget_new (EAddressbookReflowAdapter *adapter) { - EMinicardViewWidget *widget = E_MINICARD_VIEW_WIDGET (g_object_new (e_minicard_view_widget_get_type (), NULL)); + EMinicardViewWidget *widget; - widget->adapter = adapter; - g_object_ref (widget->adapter); + widget = g_object_new (E_TYPE_MINICARD_VIEW_WIDGET, NULL); + + widget->adapter = g_object_ref (adapter); return GTK_WIDGET (widget); } @@ -418,7 +435,8 @@ e_minicard_view_widget_realize (GtkWidget *widget) } static void -e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocation) +e_minicard_view_widget_size_allocate (GtkWidget *widget, + GtkAllocation *allocation) { if (GTK_WIDGET_CLASS (parent_class)->size_allocate) GTK_WIDGET_CLASS (parent_class)->size_allocate (widget, allocation); @@ -427,17 +445,17 @@ e_minicard_view_widget_size_allocate (GtkWidget *widget, GtkAllocation *allocati gdouble width; EMinicardViewWidget *view = E_MINICARD_VIEW_WIDGET (widget); - gnome_canvas_item_set ( view->emv, - "height", (double) allocation->height, - NULL ); - gnome_canvas_item_set ( view->emv, - "minimum_width", (double) allocation->width, - NULL ); - g_object_get (view->emv, - "width", &width, - NULL); + gnome_canvas_item_set ( + view->emv, "height", + (gdouble) allocation->height, NULL); + gnome_canvas_item_set ( + view->emv, "minimum_width", + (gdouble) allocation->width, NULL); + g_object_get (view->emv, "width", &width, NULL); width = MAX (width, allocation->width); - gnome_canvas_set_scroll_region (GNOME_CANVAS (view), 0, 0, width - 1, allocation->height - 1); + gnome_canvas_set_scroll_region ( + GNOME_CANVAS (view), 0, 0, + width - 1, allocation->height - 1); } } diff --git a/addressbook/gui/widgets/e-minicard-view.c b/addressbook/gui/widgets/e-minicard-view.c index 9be446d818..880bf92dcb 100644 --- a/addressbook/gui/widgets/e-minicard-view.c +++ b/addressbook/gui/widgets/e-minicard-view.c @@ -147,10 +147,9 @@ e_minicard_view_drag_begin (EAddressbookReflowAdapter *adapter, target_list, actions, 1/*XXX*/, event); if (!view->canvas_drag_data_get_id) - view->canvas_drag_data_get_id = g_signal_connect (GNOME_CANVAS_ITEM (view)->canvas, - "drag_data_get", - G_CALLBACK (e_minicard_view_drag_data_get), - view); + view->canvas_drag_data_get_id = g_signal_connect ( + GNOME_CANVAS_ITEM (view)->canvas, "drag_data_get", + G_CALLBACK (e_minicard_view_drag_data_get), view); gtk_drag_set_icon_default (context); diff --git a/addressbook/gui/widgets/e-minicard.h b/addressbook/gui/widgets/e-minicard.h index 0fffe444ea..7fa5519cbb 100644 --- a/addressbook/gui/widgets/e-minicard.h +++ b/addressbook/gui/widgets/e-minicard.h @@ -20,34 +20,37 @@ * */ -#ifndef __E_MINICARD_H__ -#define __E_MINICARD_H__ +#ifndef E_MINICARD_H +#define E_MINICARD_H #include <gtk/gtk.h> #include <libgnomecanvas/libgnomecanvas.h> #include <libebook/e-contact.h> -G_BEGIN_DECLS +/* Standard GObject macros */ +#define E_TYPE_MINICARD \ + (e_minicard_get_type ()) +#define E_MINICARD(obj) \ + (G_TYPE_CHECK_INSTANCE_CAST \ + ((obj), E_TYPE_MINICARD, EMinicard)) +#define E_MINICARD_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_CAST \ + ((cls), E_TYPE_MINICARD, EMinicardClass)) +#define E_IS_MINICARD(obj) \ + (G_TYPE_CHECK_INSTANCE_TYPE \ + ((obj), E_TYPE_MINICARD)) +#define E_IS_MINICARD_CLASS(cls) \ + (G_TYPE_CHECK_CLASS_TYPE \ + ((obj), E_TYPE_MINICARD)) +#define E_MINICARD_GET_CLASS(obj) \ + (G_TYPE_INSTANCE_GET_CLASS \ + ((obj), E_TYPE_MINICARD, EMinicardClass)) -/* EMinicard - A small card displaying information about a contact. - * - * The following arguments are available: - * - * name type read/write description - * -------------------------------------------------------------------------------- - * width double RW width of the card - * height double R height of the card - * card ECard* RW Pointer to the ECard - */ +G_BEGIN_DECLS -#define E_TYPE_MINICARD (e_minicard_get_type ()) -#define E_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), E_TYPE_MINICARD, EMinicard)) -#define E_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_CAST ((klass), E_TYPE_MINICARD, EMinicardClass)) -#define E_IS_MINICARD(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), E_TYPE_MINICARD)) -#define E_IS_MINICARD_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((obj), E_TYPE_MINICARD)) +typedef struct _EMinicard EMinicard; +typedef struct _EMinicardClass EMinicardClass; -typedef struct _EMinicard EMinicard; -typedef struct _EMinicardClass EMinicardClass; typedef enum _EMinicardFocusType EMinicardFocusType; enum _EMinicardFocusType { @@ -112,15 +115,14 @@ struct _EMinicardField { #define E_MINICARD_FIELD(field) ((EMinicardField *)(field)) -GType e_minicard_get_type (void); -const gchar *e_minicard_get_card_id (EMinicard *minicard); -gint e_minicard_compare (EMinicard *minicard1, - EMinicard *minicard2); - -gint e_minicard_selected (EMinicard *minicard, - GdkEvent *event); -void e_minicard_activate_editor (EMinicard *minicard); +GType e_minicard_get_type (void); +const gchar * e_minicard_get_card_id (EMinicard *minicard); +gint e_minicard_compare (EMinicard *minicard1, + EMinicard *minicard2); +gint e_minicard_selected (EMinicard *minicard, + GdkEvent *event); +void e_minicard_activate_editor (EMinicard *minicard); G_END_DECLS -#endif /* __E_MINICARD_H__ */ +#endif /* E_MINICARD_H */ diff --git a/addressbook/importers/evolution-ldif-importer.c b/addressbook/importers/evolution-ldif-importer.c index 4d5ddcc629..c76f0763bf 100644 --- a/addressbook/importers/evolution-ldif-importer.c +++ b/addressbook/importers/evolution-ldif-importer.c @@ -432,7 +432,8 @@ resolve_list_card (LDIFImporter *gci, EContact *contact) EDestination *dest; EVCardAttribute *attr = e_vcard_attribute_new (NULL, EVC_EMAIL); - /* Hard-wired for default e-mail, since netscape only exports 1 email address */ + /* Hard-wired for default e-mail, since + * netscape only exports 1 email address. */ dest = e_destination_new (); e_destination_set_contact (dest, dn_contact, 0); diff --git a/addressbook/importers/evolution-vcard-importer.c b/addressbook/importers/evolution-vcard-importer.c index 38a4a57574..97f2551c38 100644 --- a/addressbook/importers/evolution-vcard-importer.c +++ b/addressbook/importers/evolution-vcard-importer.c @@ -816,6 +816,9 @@ preview_contact (EWebViewPreview *preview, EContact *contact) field == E_CONTACT_EMAIL) { GList *attrs, *a; gboolean have = FALSE; + const gchar *pretty_name; + + pretty_name = e_contact_pretty_name (field); attrs = e_contact_get_attributes (contact, field); for (a = attrs; a; a = a->next) { @@ -825,35 +828,50 @@ preview_contact (EWebViewPreview *preview, EContact *contact) if (!attr) continue; - for (value = e_vcard_attribute_get_values (attr); value; value = value->next) { + value = e_vcard_attribute_get_values (attr); + + while (value != NULL) { const gchar *str = value->data; if (str && *str) { e_web_view_preview_add_section ( preview, have ? NULL : - e_contact_pretty_name (field), str); + pretty_name, str); have = TRUE; had_value = TRUE; } + + value = value->next; } + e_vcard_attribute_free (attr); } g_list_free (attrs); + } else if (field == E_CONTACT_CATEGORIES) { - gchar *value = e_contact_get (contact, field); + const gchar *pretty_name; + const gchar *value; + + pretty_name = e_contact_pretty_name (field); + value = e_contact_get_const (contact, field); - if (value && *value) { - e_web_view_preview_add_section (preview, e_contact_pretty_name (field), value); + if (value != NULL && *value != '\0') { + e_web_view_preview_add_section ( + preview, pretty_name, value); had_value = TRUE; } - g_free (value); } else { - const gchar *value = e_contact_get_const (contact, field); + const gchar *pretty_name; + const gchar *value; + + pretty_name = e_contact_pretty_name (field); + value = e_contact_get_const (contact, field); - if (value && *value) { - e_web_view_preview_add_section (preview, e_contact_pretty_name (field), value); + if (value != NULL && *value != '\0') { + e_web_view_preview_add_section ( + preview, pretty_name, value); had_value = TRUE; } } diff --git a/addressbook/printing/e-contact-print.c b/addressbook/printing/e-contact-print.c index 63508804d7..0ddda154fc 100644 --- a/addressbook/printing/e-contact-print.c +++ b/addressbook/printing/e-contact-print.c @@ -650,7 +650,8 @@ contact_draw (EContact *contact, if (!ctxt->first_contact) { if (ctxt->style->sections_start_new_page) e_contact_start_new_page (ctxt); - else if ((ctxt->y + e_contact_get_contact_height (contact, ctxt)) > page_height) + else if ((ctxt->y + e_contact_get_contact_height ( + contact, ctxt)) > page_height) e_contact_start_new_column (ctxt); } if (ctxt->style->letter_headings) diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.h b/calendar/gui/alarm-notify/alarm-notify-dialog.h index ae523cb1ad..ad7db99432 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.h +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.h @@ -27,8 +27,6 @@ #include <gtk/gtk.h> #include <libecal/e-cal-component.h> - - typedef enum { ALARM_NOTIFY_CLOSE, ALARM_NOTIFY_SNOOZE, @@ -37,24 +35,28 @@ typedef enum { } AlarmNotifyResult; typedef struct _AlarmNotificationsDialog AlarmNotificationsDialog; -struct _AlarmNotificationsDialog -{ + +struct _AlarmNotificationsDialog { GtkWidget *dialog; GtkWidget *treeview; }; -typedef void (* AlarmNotifyFunc) (AlarmNotifyResult result, gint snooze_mins, gpointer data); +typedef void (*AlarmNotifyFunc) (AlarmNotifyResult result, + gint snooze_mins, + gpointer data); AlarmNotificationsDialog * -notified_alarms_dialog_new (void); - -GtkTreeIter -add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, - time_t occur_start, time_t occur_end, - ECalComponentVType vtype, const gchar *summary, - const gchar *description, const gchar *location, - AlarmNotifyFunc func, gpointer func_data); - - - -#endif + notified_alarms_dialog_new (void); +GtkTreeIter add_alarm_to_notified_alarms_dialog + (AlarmNotificationsDialog *na, + time_t trigger, + time_t occur_start, + time_t occur_end, + ECalComponentVType vtype, + const gchar *summary, + const gchar *description, + const gchar *location, + AlarmNotifyFunc func, + gpointer func_data); + +#endif /* ALARM_NOTIFY_DIALOG_H */ diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index fd79d1f80c..816183dc4a 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -187,10 +187,11 @@ create_thread_pool (void) static void message_push (Message *msg) { - /* This used be pushed through the thread pool. This fix is made to work-around - the crashers in dbus due to threading. The threading is not completely removed as - its better to have alarm daemon running in a thread rather than blocking main thread. - This is the reason the creation of thread pool is commented out */ + /* This used be pushed through the thread pool. This fix is made to + * work-around the crashers in dbus due to threading. The threading + * is not completely removed as its better to have alarm daemon + * running in a thread rather than blocking main thread. This is + * the reason the creation of thread pool is commented out. */ msg->func (msg); } @@ -784,7 +785,8 @@ query_objects_changed_async (struct _query_msg *msg) * remove it after updating the cqa structure. */ if (alarms == NULL || alarms->alarms == NULL) { - /* update the cqa and its queued alarms for changes in summary and alarm_uid */ + /* Update the cqa and its queued alarms + * for changes in summary and alarm_uid. */ update_cqa (cqa, comp); if (alarms) @@ -805,16 +807,12 @@ query_objects_changed_async (struct _query_msg *msg) instance = sl->data; - if (!has_known_notification (cqa->alarms->comp, instance->auid)) { - g_debug ("Could not recognize alarm's notification type, discarding."); + if (!has_known_notification (cqa->alarms->comp, instance->auid)) continue; - } alarm_id = alarm_add (instance->trigger, alarm_trigger_cb, cqa, NULL); - if (!alarm_id) { - debug (("Unable to schedule trigger for %s", e_ctime (&(instance->trigger)))); + if (!alarm_id) continue; - } qa = g_new (QueuedAlarm, 1); qa->alarm_id = alarm_id; @@ -1149,7 +1147,9 @@ tray_list_remove_async (Message *msg) gboolean status; tray_icons_list = g_list_remove_link (tray_icons_list, list); - status = remove_queued_alarm (tray_data->cqa, tray_data->alarm_id, FALSE, TRUE); + status = remove_queued_alarm ( + tray_data->cqa, + tray_data->alarm_id, FALSE, TRUE); if (status) { g_hash_table_remove ( tray_data->cqa->parent_client->uid_alarms_hash, diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c index 2765c25183..a19f363460 100644 --- a/calendar/gui/alarm-notify/alarm.c +++ b/calendar/gui/alarm-notify/alarm.c @@ -104,7 +104,9 @@ alarm_ready_cb (gpointer data) ar_copy = *ar; ar = &ar_copy; - pop_alarm (); /* This will free the original AlarmRecord; that's why we copy it */ + /* This will free the original AlarmRecord; + * that's why we copy it. */ + pop_alarm (); (* ar->alarm_fn) (notify_id, ar->trigger, ar->data); @@ -260,7 +262,10 @@ alarm_remove (gpointer alarm) if (old_head == ar) { ar_copy = *ar; ar = &ar_copy; - pop_alarm (); /* This will free the original AlarmRecord; that's why we copy it */ + + /* This will free the original AlarmRecord; + * that's why we copy it. */ + pop_alarm (); } else { alarms = g_list_delete_link (alarms, l); } diff --git a/calendar/gui/alarm-notify/config-data.h b/calendar/gui/alarm-notify/config-data.h index 2a40950a00..3e09220102 100644 --- a/calendar/gui/alarm-notify/config-data.h +++ b/calendar/gui/alarm-notify/config-data.h @@ -32,21 +32,27 @@ #include <gconf/gconf-client.h> #include <libedataserver/e-source-list.h> -GConfClient *config_data_get_conf_client (void); +GConfClient * config_data_get_conf_client (void); +icaltimezone * config_data_get_timezone (void); +gboolean config_data_get_24_hour_format (void); +gboolean config_data_get_notify_with_tray + (void); +void config_data_set_last_notification_time + (ECal *cal, + time_t t); +time_t config_data_get_last_notification_time + (ECal *cal); +void config_data_save_blessed_program + (const gchar *program); +gboolean config_data_is_blessed_program (const gchar *program); +ESourceList * config_data_get_calendars (const gchar *); +void config_data_replace_string_list (const gchar *, + const gchar *, + const gchar *); -icaltimezone *config_data_get_timezone (void); -gboolean config_data_get_24_hour_format (void); -gboolean config_data_get_notify_with_tray (void); -void config_data_set_last_notification_time (ECal *cal, time_t t); -time_t config_data_get_last_notification_time (ECal *cal); -void config_data_save_blessed_program (const gchar *program); -gboolean config_data_is_blessed_program (const gchar *program); -ESourceList *config_data_get_calendars (const gchar *); -void config_data_replace_string_list (const gchar *, const gchar *, const gchar *); - -void config_data_init_debugging (void); -gboolean config_data_start_debugging (void); -void config_data_stop_debugging (void); +void config_data_init_debugging (void); +gboolean config_data_start_debugging (void); +void config_data_stop_debugging (void); #define debug(x) G_STMT_START { \ if (config_data_start_debugging ()) { \ diff --git a/calendar/gui/dialogs/alarm-list-dialog.c b/calendar/gui/dialogs/alarm-list-dialog.c index 4476bc4c62..1990e076df 100644 --- a/calendar/gui/dialogs/alarm-list-dialog.c +++ b/calendar/gui/dialogs/alarm-list-dialog.c @@ -177,6 +177,7 @@ delete_clicked_cb (GtkButton *button, gpointer data) { Dialog *dialog = data; GtkTreeSelection *selection; + GtkTreeModel *model; GtkTreeIter iter; GtkTreePath *path; gboolean valid_iter; @@ -187,14 +188,15 @@ delete_clicked_cb (GtkButton *button, gpointer data) return; } - path = gtk_tree_model_get_path (GTK_TREE_MODEL (dialog->list_store), &iter); + model = GTK_TREE_MODEL (dialog->list_store); + path = gtk_tree_model_get_path (model, &iter); e_alarm_list_remove (dialog->list_store, &iter); /* Select closest item after removal */ - valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store), &iter, path); + valid_iter = gtk_tree_model_get_iter (model, &iter, path); if (!valid_iter) { gtk_tree_path_prev (path); - valid_iter = gtk_tree_model_get_iter (GTK_TREE_MODEL (dialog->list_store), &iter, path); + valid_iter = gtk_tree_model_get_iter (model, &iter, path); } if (valid_iter) @@ -235,26 +237,33 @@ init_widgets (Dialog *dialog) GtkCellRenderer *cell_renderer; /* View */ - gtk_tree_view_set_model (GTK_TREE_VIEW (dialog->list), - GTK_TREE_MODEL (dialog->list_store)); + gtk_tree_view_set_model ( + GTK_TREE_VIEW (dialog->list), + GTK_TREE_MODEL (dialog->list_store)); column = gtk_tree_view_column_new (); gtk_tree_view_column_set_title (column, _("Action/Trigger")); cell_renderer = GTK_CELL_RENDERER (gtk_cell_renderer_text_new ()); gtk_tree_view_column_pack_start (column, cell_renderer, TRUE); - gtk_tree_view_column_add_attribute (column, cell_renderer, "text", E_ALARM_LIST_COLUMN_DESCRIPTION); + gtk_tree_view_column_add_attribute ( + column, cell_renderer, + "text", E_ALARM_LIST_COLUMN_DESCRIPTION); gtk_tree_view_append_column (GTK_TREE_VIEW (dialog->list), column); /* Reminder buttons */ - g_signal_connect (dialog->add, "clicked", - G_CALLBACK (add_clicked_cb), dialog); - g_signal_connect (dialog->delete, "clicked", - G_CALLBACK (delete_clicked_cb), dialog); - g_signal_connect (dialog->edit, "clicked", - G_CALLBACK (edit_clicked_cb), dialog); - - g_signal_connect (gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list)), "changed", - G_CALLBACK (selection_changed_cb), dialog); + g_signal_connect ( + dialog->add, "clicked", + G_CALLBACK (add_clicked_cb), dialog); + g_signal_connect ( + dialog->delete, "clicked", + G_CALLBACK (delete_clicked_cb), dialog); + g_signal_connect ( + dialog->edit, "clicked", + G_CALLBACK (edit_clicked_cb), dialog); + + g_signal_connect ( + gtk_tree_view_get_selection (GTK_TREE_VIEW (dialog->list)), + "changed", G_CALLBACK (selection_changed_cb), dialog); } gboolean @@ -327,8 +336,13 @@ alarm_list_dialog_peek (ECal *ecal, EAlarmList *list_store) g_object_unref (dialog->builder); /* Free the other stuff when the parent really gets destroyed. */ - g_object_set_data_full (G_OBJECT (dialog->box), "toplevel", dialog->toplevel, (GDestroyNotify) gtk_widget_destroy); - g_object_set_data_full (G_OBJECT (dialog->box), "dialog", dialog, g_free); + g_object_set_data_full ( + G_OBJECT (dialog->box), + "toplevel", dialog->toplevel, + (GDestroyNotify) gtk_widget_destroy); + g_object_set_data_full ( + G_OBJECT (dialog->box), "dialog", + dialog, (GDestroyNotify) g_free); return dialog->box; } diff --git a/calendar/gui/dialogs/cancel-comp.c b/calendar/gui/dialogs/cancel-comp.c index fe85119dae..4482d4d7ab 100644 --- a/calendar/gui/dialogs/cancel-comp.c +++ b/calendar/gui/dialogs/cancel-comp.c @@ -47,9 +47,10 @@ is_past_event (ECalComponent *comp) if (!comp) return TRUE; e_cal_component_get_dtend (comp, &end_date); - res = icaltime_compare_date_only (*end_date.value, - icaltime_current_time_with_zone (icaltime_get_timezone (*end_date.value)) - ) == -1; + res = icaltime_compare_date_only ( + *end_date.value, + icaltime_current_time_with_zone ( + icaltime_get_timezone (*end_date.value))) == -1; e_cal_component_free_datetime (&end_date); return res; diff --git a/calendar/gui/dialogs/comp-editor.c b/calendar/gui/dialogs/comp-editor.c index 983b42cdee..c8640b608a 100644 --- a/calendar/gui/dialogs/comp-editor.c +++ b/calendar/gui/dialogs/comp-editor.c @@ -3461,6 +3461,7 @@ obj_removed_cb (ECal *client, { CompEditorPrivate *priv = editor->priv; - if (changed_component_dialog ((GtkWindow *) editor, priv->comp, TRUE, priv->changed)) + if (changed_component_dialog ( + GTK_WINDOW (editor), priv->comp, TRUE, priv->changed)) close_dialog (editor); } diff --git a/calendar/gui/dialogs/task-details-page.c b/calendar/gui/dialogs/task-details-page.c index 55d44a7694..7f72dd3e38 100644 --- a/calendar/gui/dialogs/task-details-page.c +++ b/calendar/gui/dialogs/task-details-page.c @@ -404,11 +404,14 @@ task_details_page_fill_timezones (CompEditorPage *page, { icaltimezone *zone; - /* add UTC timezone, which is the one used for the DATE-COMPLETED property */ + /* Add UTC timezone, which is the one + * used for the DATE-COMPLETED property. */ zone = icaltimezone_get_utc_timezone (); - if (zone) { - if (!g_hash_table_lookup (timezones, icaltimezone_get_tzid (zone))) - g_hash_table_insert (timezones, (gpointer) icaltimezone_get_tzid (zone), zone); + if (zone != NULL) { + gconstpointer tzid = icaltimezone_get_tzid (zone); + + if (!g_hash_table_lookup (timezones, tzid)) + g_hash_table_insert (timezones, (gpointer) tzid, zone); } return TRUE; diff --git a/calendar/gui/e-cal-config.c b/calendar/gui/e-cal-config.c index e1204f39b7..804af17e91 100644 --- a/calendar/gui/e-cal-config.c +++ b/calendar/gui/e-cal-config.c @@ -51,7 +51,8 @@ ecp_target_free (EConfig *ec, EConfigTarget *t) ECalConfigTargetSource *s = (ECalConfigTargetSource *) t; if (p->source_changed_id) { - g_signal_handler_disconnect (s->source, p->source_changed_id); + g_signal_handler_disconnect ( + s->source, p->source_changed_id); p->source_changed_id = 0; } break; } @@ -94,7 +95,9 @@ ecp_set_target (EConfig *ec, EConfigTarget *t) case EC_CONFIG_TARGET_SOURCE: { ECalConfigTargetSource *s = (ECalConfigTargetSource *) t; - p->source_changed_id = g_signal_connect (s->source, "changed", G_CALLBACK (ecp_source_changed), ec); + p->source_changed_id = g_signal_connect ( + s->source, "changed", + G_CALLBACK (ecp_source_changed), ec); break; } case EC_CONFIG_TARGET_PREFS: { /* ECalConfigTargetPrefs *s = (ECalConfigTargetPrefs *)t; */ @@ -128,7 +131,8 @@ e_cal_config_get_type (void) }; ecp_parent_class = g_type_class_ref (e_config_get_type ()); - type = g_type_register_static (e_config_get_type (), "ECalConfig", &info, 0); + type = g_type_register_static ( + e_config_get_type (), "ECalConfig", &info, 0); } return type; @@ -143,12 +147,14 @@ e_cal_config_new (gint type, const gchar *menuid) } ECalConfigTargetSource * -e_cal_config_target_new_source (ECalConfig *ecp, struct _ESource *source) +e_cal_config_target_new_source (ECalConfig *ecp, ESource *source) { - ECalConfigTargetSource *t = e_config_target_new (&ecp->config, EC_CONFIG_TARGET_SOURCE, sizeof (*t)); + ECalConfigTargetSource *t; - t->source = source; - g_object_ref (source); + t = e_config_target_new ( + &ecp->config, EC_CONFIG_TARGET_SOURCE, sizeof (*t)); + + t->source = g_object_ref (source); return t; } @@ -156,7 +162,10 @@ e_cal_config_target_new_source (ECalConfig *ecp, struct _ESource *source) ECalConfigTargetPrefs * e_cal_config_target_new_prefs (ECalConfig *ecp) { - ECalConfigTargetPrefs *t = e_config_target_new (&ecp->config, EC_CONFIG_TARGET_PREFS, sizeof (*t)); + ECalConfigTargetPrefs *t; + + t = e_config_target_new ( + &ecp->config, EC_CONFIG_TARGET_PREFS, sizeof (*t)); t->gconf = gconf_client_get_default (); diff --git a/calendar/gui/e-cal-event.c b/calendar/gui/e-cal-event.c index 813b0b799f..af84e9e865 100644 --- a/calendar/gui/e-cal-event.c +++ b/calendar/gui/e-cal-event.c @@ -77,7 +77,8 @@ e_cal_event_get_type (void) (GInstanceInitFunc) ece_init }; ece_parent = g_type_class_ref (e_event_get_type ()); - type = g_type_register_static (e_event_get_type (), "ECalEvent", &info, 0); + type = g_type_register_static ( + e_event_get_type (), "ECalEvent", &info, 0); } return type; @@ -89,15 +90,23 @@ e_cal_event_peek (void) static ECalEvent *e_cal_event = NULL; if (!e_cal_event) { e_cal_event = g_object_new (e_cal_event_get_type (), NULL); - e_event_construct (&e_cal_event->event, "org.gnome.evolution.calendar.events"); + e_event_construct ( + &e_cal_event->event, + "org.gnome.evolution.calendar.events"); } return e_cal_event; } ECalEventTargetBackend * -e_cal_event_target_new_module (ECalEvent *ece, EShellBackend *shell_backend, ESourceList *source_list, guint32 flags) +e_cal_event_target_new_module (ECalEvent *ece, + EShellBackend *shell_backend, + ESourceList *source_list, + guint32 flags) { - ECalEventTargetBackend *t = e_event_target_new (&ece->event, E_CAL_EVENT_TARGET_BACKEND, sizeof (*t)); + ECalEventTargetBackend *t; + + t = e_event_target_new ( + &ece->event, E_CAL_EVENT_TARGET_BACKEND, sizeof (*t)); t->shell_backend = g_object_ref (shell_backend); t->source_list = g_object_ref (source_list); diff --git a/calendar/gui/e-cal-event.h b/calendar/gui/e-cal-event.h index 8d72a93fa5..ada03b7bca 100644 --- a/calendar/gui/e-cal-event.h +++ b/calendar/gui/e-cal-event.h @@ -62,9 +62,13 @@ struct _ECalEventClass { EEventClass event_class; }; -GType e_cal_event_get_type (void); -ECalEvent* e_cal_event_peek (void); -ECalEventTargetBackend* e_cal_event_target_new_module (ECalEvent *ece, EShellBackend *shell_backend, ESourceList *source_list, guint32 flags); +GType e_cal_event_get_type (void); +ECalEvent * e_cal_event_peek (void); +ECalEventTargetBackend * + e_cal_event_target_new_module (ECalEvent *ece, + EShellBackend *shell_backend, + ESourceList *source_list, + guint32 flags); G_END_DECLS diff --git a/calendar/gui/e-calendar-view.h b/calendar/gui/e-calendar-view.h index e0087da61f..88ebbeea66 100644 --- a/calendar/gui/e-calendar-view.h +++ b/calendar/gui/e-calendar-view.h @@ -87,13 +87,20 @@ typedef struct { E_CALENDAR_VIEW_EVENT_FIELDS } ECalendarViewEvent; -/* checks if event->comp_data is not NULL, returns FALSE when it is and prints a warning on a console */ -gboolean is_comp_data_valid_func (ECalendarViewEvent *event, const gchar *location); -#define is_comp_data_valid(_event) is_comp_data_valid_func ((ECalendarViewEvent *) (_event), G_STRFUNC) +/* checks if event->comp_data is not NULL, returns FALSE + * when it is and prints a warning on a console */ +gboolean is_comp_data_valid_func (ECalendarViewEvent *event, + const gchar *location); +#define is_comp_data_valid(_event) \ + is_comp_data_valid_func ((ECalendarViewEvent *) (_event), G_STRFUNC) -/* checks if index is within bounds for the array; returns FALSE when not, and prints a warning on a console */ -gboolean is_array_index_in_bounds_func (GArray *array, gint index, const gchar *location); -#define is_array_index_in_bounds(_array, _index) is_array_index_in_bounds_func (_array, _index, G_STRFUNC) +/* checks if index is within bounds for the array; returns + * FALSE when not, and prints a warning on a console */ +gboolean is_array_index_in_bounds_func (GArray *array, + gint index, + const gchar *location); +#define is_array_index_in_bounds(_array, _index) \ + is_array_index_in_bounds_func (_array, _index, G_STRFUNC) typedef struct _ECalendarView ECalendarView; typedef struct _ECalendarViewClass ECalendarViewClass; diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index 30efc13e74..7d87f6a02d 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -69,35 +69,50 @@ struct _EDayViewTimeItemPrivate { icaltimezone *second_zone; }; -static void e_day_view_time_item_update (GnomeCanvasItem *item, - const cairo_matrix_t *i2c, - gint flags); -static void e_day_view_time_item_draw (GnomeCanvasItem *item, - cairo_t *cr, - gint x, gint y, - gint width, gint height); -static GnomeCanvasItem *e_day_view_time_item_point (GnomeCanvasItem *item, - double x, double y, - gint cx, gint cy); -static gint e_day_view_time_item_event (GnomeCanvasItem *item, - GdkEvent *event); -static void e_day_view_time_item_increment_time (gint *hour, - gint *minute, - gint time_divisions); -static void e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, - GdkEvent *event); -static void e_day_view_time_item_on_set_divisions (GtkWidget *item, - EDayViewTimeItem *time_item); -static void e_day_view_time_item_on_button_press (EDayViewTimeItem *time_item, - GdkEvent *event); -static void e_day_view_time_item_on_button_release (EDayViewTimeItem *time_item, - GdkEvent *event); -static void e_day_view_time_item_on_motion_notify (EDayViewTimeItem *time_item, - GdkEvent *event); -static gint e_day_view_time_item_convert_position_to_row (EDayViewTimeItem *time_item, - gint y); - -static void edvti_second_zone_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data); +static void e_day_view_time_item_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags); +static void e_day_view_time_item_draw (GnomeCanvasItem *item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height); +static GnomeCanvasItem * + e_day_view_time_item_point (GnomeCanvasItem *item, + gdouble x, + gdouble y, + gint cx, + gint cy); +static gint e_day_view_time_item_event (GnomeCanvasItem *item, + GdkEvent *event); +static void e_day_view_time_item_increment_time + (gint *hour, + gint *minute, + gint time_divisions); +static void e_day_view_time_item_show_popup_menu + (EDayViewTimeItem *time_item, + GdkEvent *event); +static void e_day_view_time_item_on_set_divisions + (GtkWidget *item, + EDayViewTimeItem *time_item); +static void e_day_view_time_item_on_button_press + (EDayViewTimeItem *time_item, + GdkEvent *event); +static void e_day_view_time_item_on_button_release + (EDayViewTimeItem *time_item, + GdkEvent *event); +static void e_day_view_time_item_on_motion_notify + (EDayViewTimeItem *time_item, + GdkEvent *event); +static gint e_day_view_time_item_convert_position_to_row + (EDayViewTimeItem *time_item, + gint y); + +static void edvti_second_zone_changed_cb (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data); enum { PROP_0, @@ -218,11 +233,14 @@ day_view_time_item_init (EDayViewTimeItem *time_item) if (last) { if (*last) - time_item->priv->second_zone = icaltimezone_get_builtin_timezone (last); + time_item->priv->second_zone = + icaltimezone_get_builtin_timezone (last); g_free (last); } - time_item->priv->second_zone_changed_id = calendar_config_add_notification_day_second_zone (edvti_second_zone_changed_cb, time_item); + time_item->priv->second_zone_changed_id = + calendar_config_add_notification_day_second_zone ( + edvti_second_zone_changed_cb, time_item); } GType @@ -323,7 +341,10 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, /* The start and end of the long horizontal line between hours. */ long_line_x1 = (use_zone ? 0 : E_DVTMI_TIME_GRID_X_PAD) - x + x_offset; - long_line_x2 = time_item->priv->column_width - E_DVTMI_TIME_GRID_X_PAD - x - (use_zone ? E_DVTMI_TIME_GRID_X_PAD : 0) + x_offset; + long_line_x2 = + time_item->priv->column_width - + E_DVTMI_TIME_GRID_X_PAD - x - + (use_zone ? E_DVTMI_TIME_GRID_X_PAD : 0) + x_offset; if (time_divisions == 60) { /* The right edge of the complete time string in 60-min @@ -358,13 +379,17 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, minute = day_view->first_minute_shown; if (use_zone) { - /* shift time with a difference between local time and the other timezone */ - icaltimezone *cal_zone = e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view)); + /* shift time with a difference between + * local time and the other timezone */ + icaltimezone *cal_zone; struct icaltimetype tt; gint diff; struct tm mn; - tt = icaltime_from_timet_with_zone (day_view->day_starts[0], 0, cal_zone); + cal_zone = e_calendar_view_get_timezone ( + E_CALENDAR_VIEW (day_view)); + tt = icaltime_from_timet_with_zone ( + day_view->day_starts[0], 0, cal_zone); /* diff is number of minutes */ diff = (icaltimezone_get_utc_offset (use_zone, &tt, NULL) - @@ -422,25 +447,38 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, gint marcus_bains_y; cairo_save (cr); - gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); - - if (day_view->marcus_bains_time_bar_color && gdk_color_parse (day_view->marcus_bains_time_bar_color, &mb_color)) { + gdk_cairo_set_source_color ( + cr, &day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]); + if (day_view->marcus_bains_time_bar_color && + gdk_color_parse ( + day_view->marcus_bains_time_bar_color, + &mb_color)) { gdk_cairo_set_source_color (cr, &mb_color); } else mb_color = day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]; - time_now = icaltime_current_time_with_zone (e_calendar_view_get_timezone (E_CALENDAR_VIEW (day_view))); - marcus_bains_y = (time_now.hour * 60 + time_now.minute) * day_view->row_height / time_divisions - y; + time_now = icaltime_current_time_with_zone ( + e_calendar_view_get_timezone ( + E_CALENDAR_VIEW (day_view))); + marcus_bains_y = + (time_now.hour * 60 + time_now.minute) * + day_view->row_height / time_divisions - y; cairo_set_line_width (cr, 1.5); - cairo_move_to (cr, long_line_x1 - (use_zone ? E_DVTMI_TIME_GRID_X_PAD : 0), marcus_bains_y); + cairo_move_to ( + cr, long_line_x1 - + (use_zone ? E_DVTMI_TIME_GRID_X_PAD : 0), + marcus_bains_y); cairo_line_to (cr, long_line_x2, marcus_bains_y); cairo_stroke (cr); cairo_restore (cr); } else { mb_color = day_view->colors[E_DAY_VIEW_COLOR_MARCUS_BAINS_LINE]; - if (day_view->marcus_bains_time_bar_color && gdk_color_parse (day_view->marcus_bains_time_bar_color, &mb_color)) { + if (day_view->marcus_bains_time_bar_color && + gdk_color_parse ( + day_view->marcus_bains_time_bar_color, + &mb_color)) { gdk_cairo_set_source_color (cr, &mb_color); } } @@ -450,13 +488,18 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, for (row = 0, row_y = 0 - y; row < day_view->rows && row_y < height; row++, row_y += day_view->row_height) { - gboolean show_midnight_date = use_zone && hour == 0 && (minute == 0 || time_divisions == 60) && midnight_day && midnight_month; + gboolean show_midnight_date; + + show_midnight_date = + use_zone && hour == 0 && + (minute == 0 || time_divisions == 60) && + midnight_day && midnight_month; /* If the row is above the first row we want to draw just increment the time and skip to the next row. */ if (row_y < start_y) { - e_day_view_time_item_increment_time (&hour, &minute, - time_divisions); + e_day_view_time_item_increment_time ( + &hour, &minute, time_divisions); continue; } @@ -536,7 +579,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, pango_layout_set_text (layout, buffer, -1); pango_layout_set_font_description (layout, day_view->large_font_desc); pango_layout_get_pixel_size (layout, &hour_width, NULL); - cairo_translate (cr, large_hour_x2 - hour_width, row_y + large_hour_y_offset); + cairo_translate ( + cr, large_hour_x2 - hour_width, + row_y + large_hour_y_offset); pango_cairo_update_layout (cr, layout); pango_cairo_show_layout (cr, layout); cairo_restore (cr); @@ -579,7 +624,9 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, pango_layout_set_text (layout, buffer, -1); pango_layout_set_font_description (layout, day_view->small_font_desc); 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); @@ -615,7 +662,10 @@ e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, edvti_draw_zone (canvas_item, cr, x, y, width, height, 0, NULL); if (time_item->priv->second_zone) - edvti_draw_zone (canvas_item, cr, x, y, width, height, time_item->priv->column_width, time_item->priv->second_zone); + edvti_draw_zone ( + canvas_item, cr, x, y, width, height, + time_item->priv->column_width, + time_item->priv->second_zone); } /* Increment the time by the 5/10/15/30/60 minute interval. @@ -677,7 +727,10 @@ e_day_view_time_item_event (GnomeCanvasItem *item, } static void -edvti_second_zone_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *entry, gpointer user_data) +edvti_second_zone_changed_cb (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) { EDayViewTimeItem *time_item = user_data; EDayView *day_view; @@ -687,32 +740,38 @@ edvti_second_zone_changed_cb (GConfClient *client, guint cnxn_id, GConfEntry *en g_return_if_fail (E_IS_DAY_VIEW_TIME_ITEM (time_item)); location = calendar_config_get_day_second_zone (); - time_item->priv->second_zone = location ? icaltimezone_get_builtin_timezone (location) : NULL; + time_item->priv->second_zone = + location ? icaltimezone_get_builtin_timezone (location) : NULL; g_free (location); day_view = e_day_view_time_item_get_day_view (time_item); - gtk_widget_set_size_request (day_view->time_canvas, e_day_view_time_item_get_column_width (time_item), -1); + gtk_widget_set_size_request ( + day_view->time_canvas, + e_day_view_time_item_get_column_width (time_item), -1); gtk_widget_queue_draw (day_view->time_canvas); } static void -edvti_on_select_zone (GtkWidget *item, EDayViewTimeItem *time_item) +edvti_on_select_zone (GtkWidget *item, + EDayViewTimeItem *time_item) { calendar_config_select_day_second_zone (); } static void -edvti_on_set_zone (GtkWidget *item, EDayViewTimeItem *time_item) +edvti_on_set_zone (GtkWidget *item, + EDayViewTimeItem *time_item) { if (!gtk_check_menu_item_get_active (GTK_CHECK_MENU_ITEM (item))) return; - calendar_config_set_day_second_zone (g_object_get_data (G_OBJECT (item), "timezone")); + calendar_config_set_day_second_zone ( + g_object_get_data (G_OBJECT (item), "timezone")); } static void e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, - GdkEvent *event) + GdkEvent *event) { static gint divisions[] = { 60, 30, 15, 10, 5 }; EDayView *day_view; @@ -793,7 +852,8 @@ e_day_view_time_item_show_popup_menu (EDayViewTimeItem *time_item, if (!zone) continue; - item = gtk_radio_menu_item_new_with_label (group, icaltimezone_get_display_name (zone)); + item = gtk_radio_menu_item_new_with_label ( + group, icaltimezone_get_display_name (zone)); group = gtk_radio_menu_item_get_group (GTK_RADIO_MENU_ITEM (item)); /* both comes from builtin, thus no problem to compare pointers */ if (zone == time_item->priv->second_zone) diff --git a/calendar/gui/e-day-view-top-item.c b/calendar/gui/e-day-view-top-item.c index c3a3a07c4d..5193267411 100644 --- a/calendar/gui/e-day-view-top-item.c +++ b/calendar/gui/e-day-view-top-item.c @@ -621,7 +621,8 @@ day_view_top_item_draw (GnomeCanvasItem *canvas_item, if (!show_dates) { /* Clear the main area background. */ cairo_save (cr); - gdk_cairo_set_source_color (cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS]); + gdk_cairo_set_source_color ( + cr, &day_view->colors[E_DAY_VIEW_COLOR_BG_TOP_CANVAS]); cairo_rectangle (cr, left_edge - x, - y, canvas_width - left_edge, canvas_height); diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index 9054f92f77..1ac83c8e0e 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -1474,8 +1474,9 @@ freebusy_async (gpointer data) EMeetingStorePrivate *priv = fbd->store->priv; if (fbd->client) { - /* FIXME this a work around for getting all th free busy information for the users - we should be able to get free busy asynchronously */ + /* FIXME This a workaround for getting all the free busy + * information for the users. We should be able to + * get free busy asynchronously. */ g_static_mutex_lock (&mutex); priv->num_queries++; e_cal_get_free_busy ( diff --git a/calendar/gui/e-week-view-main-item.c b/calendar/gui/e-week-view-main-item.c index 0bffb6cef9..5084aa0c62 100644 --- a/calendar/gui/e-week-view-main-item.c +++ b/calendar/gui/e-week-view-main-item.c @@ -160,9 +160,11 @@ week_view_main_item_draw_day (EWeekViewMainItem *main_item, selected = FALSE; if (selected) { if (gtk_widget_has_focus (GTK_WIDGET (week_view))) { - gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]); + gdk_cairo_set_source_color ( + cr, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]); } else { - gdk_cairo_set_source_color (cr, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]); + gdk_cairo_set_source_color ( + cr, &week_view->colors[E_WEEK_VIEW_COLOR_SELECTED]); } if (week_view->multi_week_view) { diff --git a/calendar/gui/ea-calendar.c b/calendar/gui/ea-calendar.c index 44b63a9c0b..577a2230fc 100644 --- a/calendar/gui/ea-calendar.c +++ b/calendar/gui/ea-calendar.c @@ -66,8 +66,10 @@ gnome_calendar_a11y_init (void) pixbuf_type = g_type_class_ref (GNOME_TYPE_CANVAS_PIXBUF); e_day_view_type = g_type_class_ref (e_day_view_get_type ()); e_week_view_type = g_type_class_ref (E_TYPE_WEEK_VIEW); - e_day_view_main_item_type = g_type_class_ref (e_day_view_main_item_get_type ()); - e_week_view_main_item_type = g_type_class_ref (e_week_view_main_item_get_type ()); + e_day_view_main_item_type = g_type_class_ref ( + e_day_view_main_item_get_type ()); + 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, diff --git a/calendar/gui/ea-jump-button.c b/calendar/gui/ea-jump-button.c index 61fff7b4f9..3b7d6e714d 100644 --- a/calendar/gui/ea-jump-button.c +++ b/calendar/gui/ea-jump-button.c @@ -129,9 +129,8 @@ ea_jump_button_new (GObject *obj) atk_obj->role = event_role; } - /* the registered factory for GNOME_TYPE_CANVAS_ITEM is cannot create a EaJumpbutton, - * we should save the EaJumpbutton object in it. - */ + /* The registered factory for GNOME_TYPE_CANVAS_ITEM cannot create + * an EaJumpbutton, we should save the EaJumpbutton object in it. */ g_object_set_data (obj, "accessible-object", atk_obj); return atk_obj; diff --git a/calendar/gui/ea-week-view-main-item.c b/calendar/gui/ea-week-view-main-item.c index 433d1aa30d..2be13ee010 100644 --- a/calendar/gui/ea-week-view-main-item.c +++ b/calendar/gui/ea-week-view-main-item.c @@ -1142,7 +1142,8 @@ table_interface_get_row_description (AtkTable *table, description = ea_cell_table_get_row_label (cell_data, row); if (!description) { gchar buffer[128]; - ea_week_view_main_item_get_row_label (ea_main_item, row, buffer, sizeof (buffer)); + ea_week_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 3a4adad829..ce7734ddcc 100644 --- a/calendar/gui/gnome-cal.c +++ b/calendar/gui/gnome-cal.c @@ -767,9 +767,9 @@ dn_e_cal_view_objects_added_cb (ECalView *query, GList *objects, gpointer data) ensure_dates_are_in_default_zone (gcal, l->data); comp = e_cal_component_new (); - if (!e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (l->data))) { + if (!e_cal_component_set_icalcomponent ( + comp, icalcomponent_new_clone (l->data))) { g_object_unref (comp); - continue; } @@ -841,6 +841,8 @@ get_times_for_views (GnomeCalendar *gcal, { GnomeCalendarPrivate *priv; ECalModel *model; + EDayView *day_view; + EWeekView *week_view; gint shown, display_start; GDate date; gint week_start_day; @@ -861,12 +863,14 @@ get_times_for_views (GnomeCalendar *gcal, switch (view_type) { case GNOME_CAL_DAY_VIEW: - shown = e_day_view_get_days_shown (E_DAY_VIEW (priv->views[view_type])); + day_view = E_DAY_VIEW (priv->views[view_type]); + shown = e_day_view_get_days_shown (day_view); *start_time = time_day_begin_with_zone (*start_time, timezone); *end_time = time_add_day_with_zone (*start_time, shown, timezone); break; case GNOME_CAL_WORK_WEEK_VIEW: /* FIXME Kind of gross, but it works */ + day_view = E_DAY_VIEW (priv->views[view_type]); time_to_gdate_with_zone (&date, *start_time, timezone); /* The start of the work-week is the first working day after the @@ -878,7 +882,7 @@ get_times_for_views (GnomeCalendar *gcal, /* Find the first working day in the week, 0 (Sun) to 6 (Sat). */ first_day = (week_start_day + 1) % 7; for (i = 0; i < 7; i++) { - if (E_DAY_VIEW (priv->views[view_type])->working_days & (1 << first_day)) { + if (day_view->working_days & (1 << first_day)) { has_working_days = TRUE; break; } @@ -889,7 +893,7 @@ get_times_for_views (GnomeCalendar *gcal, /* Now find the last working day of the week, backwards. */ last_day = week_start_day % 7; for (i = 0; i < 7; i++) { - if (E_DAY_VIEW (priv->views[view_type])->working_days & (1 << last_day)) + if (day_view->working_days & (1 << last_day)) break; last_day = (last_day + 6) % 7; } @@ -917,32 +921,41 @@ get_times_for_views (GnomeCalendar *gcal, *start_time = icaltime_as_timet_with_zone (tt, timezone); *end_time = time_add_day_with_zone (*start_time, days_shown, timezone); - if (select_time && E_DAY_VIEW (priv->views[view_type])->selection_start_day == -1) + if (select_time && day_view->selection_start_day == -1) time (select_time); break; case GNOME_CAL_WEEK_VIEW: - /* FIXME We should be using the same day of the week enum every where */ - display_start = (E_WEEK_VIEW (priv->views[view_type])->display_start_day + 1) % 7; + /* FIXME We should be using the same day + * of the week enum everywhere. */ + week_view = E_WEEK_VIEW (priv->views[view_type]); + display_start = (week_view->display_start_day + 1) % 7; - *start_time = time_week_begin_with_zone (*start_time, display_start, timezone); - *end_time = time_add_week_with_zone (*start_time, 1, timezone); + *start_time = time_week_begin_with_zone ( + *start_time, display_start, timezone); + *end_time = time_add_week_with_zone ( + *start_time, 1, timezone); - if (select_time && E_WEEK_VIEW (priv->views[view_type])->selection_start_day == -1) + if (select_time && week_view->selection_start_day == -1) time (select_time); break; case GNOME_CAL_MONTH_VIEW: - shown = e_week_view_get_weeks_shown (E_WEEK_VIEW (priv->views[view_type])); - /* FIXME We should be using the same day of the week enum every where */ - display_start = (E_WEEK_VIEW (priv->views[view_type])->display_start_day + 1) % 7; + /* FIXME We should be using the same day + * of the week enum everywhere. */ + week_view = E_WEEK_VIEW (priv->views[view_type]); + shown = e_week_view_get_weeks_shown (week_view); + display_start = (week_view->display_start_day + 1) % 7; if (!range_selected && ( - !E_WEEK_VIEW (priv->views[view_type])->multi_week_view || - !E_WEEK_VIEW (priv->views[view_type])->month_scroll_by_week)) - *start_time = time_month_begin_with_zone (*start_time, timezone); - *start_time = time_week_begin_with_zone (*start_time, display_start, timezone); - *end_time = time_add_week_with_zone (*start_time, shown, timezone); - - if (select_time && E_WEEK_VIEW (priv->views[view_type])->selection_start_day == -1) + !week_view->multi_week_view || + !week_view->month_scroll_by_week)) + *start_time = time_month_begin_with_zone ( + *start_time, timezone); + *start_time = time_week_begin_with_zone ( + *start_time, display_start, timezone); + *end_time = time_add_week_with_zone ( + *start_time, shown, timezone); + + if (select_time && week_view->selection_start_day == -1) time (select_time); break; case GNOME_CAL_LIST_VIEW: diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index cfc177c07d..2bc566b771 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -615,7 +615,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; else if (only_attendees && !comp_editor_have_in_new_attendees_lst ( @@ -1426,7 +1427,9 @@ setup_from (ECalComponentItipMethod method, e_cal_component_get_organizer (comp, &organizer); if (organizer.value != NULL) { - account = find_enabled_account (accounts, itip_strip_mailto (organizer.value)); + account = find_enabled_account ( + accounts, + itip_strip_mailto (organizer.value)); } } diff --git a/calendar/gui/print.c b/calendar/gui/print.c index a63285465a..ed0d235af4 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -1789,7 +1789,8 @@ print_week_event (GtkPrintContext *context, PangoFontDescription *font, pixbuf = gdk_pixbuf_new_from_xpm_data (xpm); } - x1 = left + (start_x + 1) * cell_width - 6 - gdk_pixbuf_get_width (pixbuf) * 0.5; + x1 = left + (start_x + 1) * cell_width - 6 - + gdk_pixbuf_get_width (pixbuf) * 0.5; cairo_save (cr); cairo_scale (cr, 0.5, 0.5); diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index 7183d79071..a9cd687169 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -228,7 +228,8 @@ weekday_picker_get_preferred_width (GtkWidget *widget, wp = WEEKDAY_PICKER (widget); priv = wp->priv; - *minimum_width = *natural_width = (priv->max_letter_width + 2 * PADDING + 1) * 7 + 1; + *minimum_width = *natural_width = + (priv->max_letter_width + 2 * PADDING + 1) * 7 + 1; } static void diff --git a/capplet/settings/mail-guess-servers.c b/capplet/settings/mail-guess-servers.c index 2d9197dc0c..307aeeec1c 100644 --- a/capplet/settings/mail-guess-servers.c +++ b/capplet/settings/mail-guess-servers.c @@ -113,23 +113,30 @@ get_url (SoupSession *session, const gchar *url) } static void -handle_incoming (xmlNodePtr head, EmailProvider *provider) +handle_incoming (xmlNodePtr head, + EmailProvider *provider) { xmlNodePtr node = head->children; - provider->recv_type = xml_to_gchar(xmlGetProp(head, (xmlChar *) "type"), provider); + provider->recv_type = xml_to_gchar ( + xmlGetProp (head, (xmlChar *) "type"), provider); - while (node) { + while (node != NULL) { if (strcmp ((gchar *)node->name, "hostname") == 0) { - provider->recv_hostname = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->recv_hostname = xml_to_gchar ( + xmlNodeGetContent (node), provider); } else if (strcmp ((gchar *)node->name, "port") == 0) { - provider->recv_port = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->recv_port = xml_to_gchar ( + xmlNodeGetContent (node), provider); } else if (strcmp ((gchar *)node->name, "socketType") == 0) { - provider->recv_socket_type = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->recv_socket_type = xml_to_gchar ( + xmlNodeGetContent (node), provider); } else if (strcmp ((gchar *)node->name, "username") == 0) { - provider->recv_username = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->recv_username = xml_to_gchar ( + xmlNodeGetContent (node), provider); } else if (strcmp ((gchar *)node->name, "authentication") == 0) { - provider->recv_auth = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->recv_auth = xml_to_gchar ( + xmlNodeGetContent (node), provider); } node = node->next; @@ -137,23 +144,30 @@ handle_incoming (xmlNodePtr head, EmailProvider *provider) } static void -handle_outgoing (xmlNodePtr head, EmailProvider *provider) +handle_outgoing (xmlNodePtr head, + EmailProvider *provider) { xmlNodePtr node = head->children; - provider->send_type = xml_to_gchar(xmlGetProp(head, (xmlChar *) "type"), provider); + provider->send_type = xml_to_gchar ( + xmlGetProp (head, (xmlChar *) "type"), provider); - while (node) { + while (node != NULL) { if (strcmp ((gchar *)node->name, "hostname") == 0) { - provider->send_hostname = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->send_hostname = xml_to_gchar ( + xmlNodeGetContent (node), provider); } else if (strcmp ((gchar *)node->name, "port") == 0) { - provider->send_port = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->send_port = xml_to_gchar ( + xmlNodeGetContent (node), provider); } else if (strcmp ((gchar *)node->name, "socketType") == 0) { - provider->send_socket_type = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->send_socket_type = xml_to_gchar ( + xmlNodeGetContent (node), provider); } else if (strcmp ((gchar *)node->name, "username") == 0) { - provider->send_username = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->send_username = xml_to_gchar ( + xmlNodeGetContent (node), provider); } else if (strcmp ((gchar *)node->name, "authentication") == 0) { - provider->send_auth = xml_to_gchar (xmlNodeGetContent (node), provider); + provider->send_auth = xml_to_gchar ( + xmlNodeGetContent (node), provider); } node = node->next; diff --git a/composer/e-msg-composer.c b/composer/e-msg-composer.c index e4eb1ced71..e332cc73a9 100644 --- a/composer/e-msg-composer.c +++ b/composer/e-msg-composer.c @@ -336,7 +336,7 @@ best_charset (GByteArray *buf, const gchar *default_charset, CamelTransferEncoding *encoding) { - gchar *charset; + const gchar *charset; /* First try US-ASCII */ *encoding = best_encoding (buf, "US-ASCII"); @@ -352,10 +352,12 @@ best_charset (GByteArray *buf, charset = e_composer_get_default_charset (); *encoding = best_encoding (buf, charset); if (*encoding != -1) - return charset; + return g_strdup (charset); /* Try to find something that will work */ - if (!(charset = (gchar *) camel_charset_best ((const gchar *) buf->data, buf->len))) { + charset = camel_charset_best ( + (const gchar *) buf->data, buf->len); + if (charset == NULL) { *encoding = CAMEL_TRANSFER_ENCODING_7BIT; return NULL; } @@ -1502,7 +1504,8 @@ add_signature_delim (EMsgComposer *composer) shell = e_msg_composer_get_shell (composer); shell_settings = e_shell_get_shell_settings (shell); - return !e_shell_settings_get_boolean (shell_settings, "composer-no-signature-delim"); + return !e_shell_settings_get_boolean ( + shell_settings, "composer-no-signature-delim"); } #define CONVERT_SPACES CAMEL_MIME_FILTER_TOHTML_CONVERT_SPACES @@ -1546,20 +1549,24 @@ get_signature_html (EMsgComposer *composer) } else { EAccount *account; EAccountIdentity *id; - gchar *organization; - gchar *address; - gchar *name; + gchar *organization = NULL; + gchar *address = NULL; + gchar *name = NULL; account = e_composer_header_table_get_account (table); if (!account) return NULL; id = account->id; - address = id->address ? camel_text_to_html (id->address, CONVERT_SPACES, 0) : NULL; - name = id->name ? camel_text_to_html (id->name, CONVERT_SPACES, 0) : NULL; - organization = - id->organization ? camel_text_to_html ( - id->organization, CONVERT_SPACES, 0) : NULL; + if (id->address != NULL) + address = camel_text_to_html ( + id->address, CONVERT_SPACES, 0); + if (id->name != NULL) + name = camel_text_to_html ( + id->name, CONVERT_SPACES, 0); + if (id->organization != NULL) + organization = camel_text_to_html ( + id->organization, CONVERT_SPACES, 0); text = g_strdup_printf ("%s%s%s%s%s%s%s%s%s", add_delim ? "-- \n<BR>" : "", @@ -3201,7 +3208,10 @@ e_msg_composer_new_with_message (EShell *shell, if (!camel_internet_address_get (iaddr, i, &name, &addr)) continue; - g_hash_table_insert (auto_cc, g_strdup (addr), GINT_TO_POINTER (TRUE)); + g_hash_table_insert ( + auto_cc, + g_strdup (addr), + GINT_TO_POINTER (TRUE)); } } g_object_unref (iaddr); @@ -3216,7 +3226,10 @@ e_msg_composer_new_with_message (EShell *shell, if (!camel_internet_address_get (iaddr, i, &name, &addr)) continue; - g_hash_table_insert (auto_bcc, g_strdup (addr), GINT_TO_POINTER (TRUE)); + g_hash_table_insert ( + auto_bcc, + g_strdup (addr), + GINT_TO_POINTER (TRUE)); } } g_object_unref (iaddr); @@ -3301,8 +3314,9 @@ e_msg_composer_new_with_message (EShell *shell, e_destination_freev (Bccv); /* Restore the format editing preference */ - format = camel_medium_get_header (CAMEL_MEDIUM (message), "X-Evolution-Format"); - if (format) { + format = camel_medium_get_header ( + CAMEL_MEDIUM (message), "X-Evolution-Format"); + if (format != NULL) { gchar **flags; while (*format && camel_mime_is_lwsp (*format)) @@ -3369,10 +3383,12 @@ e_msg_composer_new_with_message (EShell *shell, /* Restore the attachments and body text */ content = camel_medium_get_content (CAMEL_MEDIUM (message)); if (CAMEL_IS_MULTIPART (content)) { + CamelMimePart *mime_part; CamelMultipart *multipart; multipart = CAMEL_MULTIPART (content); - content_type = camel_mime_part_get_content_type (CAMEL_MIME_PART (message)); + mime_part = CAMEL_MIME_PART (message); + content_type = camel_mime_part_get_content_type (mime_part); if (CAMEL_IS_MULTIPART_SIGNED (content)) { /* Handle the signed content and configure the @@ -3384,10 +3400,10 @@ e_msg_composer_new_with_message (EShell *shell, /* Decrypt the encrypted content and configure the * composer to encrypt outgoing messages. */ handle_multipart_encrypted ( - composer, CAMEL_MIME_PART (message), - cancellable, 0); + composer, mime_part, cancellable, 0); - } else if (camel_content_type_is (content_type, "multipart", "alternative")) { + } else if (camel_content_type_is ( + content_type, "multipart", "alternative")) { /* This contains the text/plain and text/html * versions of the message body. */ handle_multipart_alternative ( @@ -3399,18 +3415,25 @@ e_msg_composer_new_with_message (EShell *shell, composer, multipart, cancellable, 0); } } else { + CamelMimePart *mime_part; gchar *html; gssize length; - content_type = camel_mime_part_get_content_type (CAMEL_MIME_PART (message)); + mime_part = CAMEL_MIME_PART (message); + content_type = camel_mime_part_get_content_type (mime_part); - if (content_type && ( - camel_content_type_is (content_type, "application", "x-pkcs7-mime") - || camel_content_type_is (content_type, "application", "pkcs7-mime"))) - gtk_toggle_action_set_active (GTK_TOGGLE_ACTION (ACTION (SMIME_ENCRYPT)), TRUE); + if (content_type != NULL && ( + camel_content_type_is ( + content_type, "application", "x-pkcs7-mime") || + camel_content_type_is ( + content_type, "application", "pkcs7-mime"))) + gtk_toggle_action_set_active ( + GTK_TOGGLE_ACTION ( + ACTION (SMIME_ENCRYPT)), TRUE); html = emcu_part_to_html ( - CAMEL_MIME_PART (message), &length, NULL, cancellable); + CAMEL_MIME_PART (message), + &length, NULL, cancellable); e_msg_composer_set_pending_body (composer, html, length); } diff --git a/doc/reference/shell/tmpl/e-util.sgml b/doc/reference/shell/tmpl/e-util.sgml index 2db95ebccd..2cddc59a1c 100644 --- a/doc/reference/shell/tmpl/e-util.sgml +++ b/doc/reference/shell/tmpl/e-util.sgml @@ -272,15 +272,6 @@ Miscellaneous Utilities @Returns: -<!-- ##### FUNCTION get_font_options ##### --> -<para> - -</para> - -@void: -@Returns: - - <!-- ##### FUNCTION e_file_lock_create ##### --> <para> diff --git a/doc/reference/shell/tmpl/eshell-unused.sgml b/doc/reference/shell/tmpl/eshell-unused.sgml index b2beae78bf..cd8b4d5bd4 100644 --- a/doc/reference/shell/tmpl/eshell-unused.sgml +++ b/doc/reference/shell/tmpl/eshell-unused.sgml @@ -575,3 +575,11 @@ e-shell-window.sgml @key: @Returns: +<!-- ##### FUNCTION get_font_options ##### --> +<para> + +</para> + +@void: +@Returns: + diff --git a/e-util/e-alert.c b/e-util/e-alert.c index 1858e338f8..3554fd2709 100644 --- a/e-util/e-alert.c +++ b/e-util/e-alert.c @@ -235,12 +235,16 @@ e_alert_load (const gchar *path) for (scan = error->children;scan;scan=scan->next) { if (!strcmp((gchar *)scan->name, "primary")) { if ((tmp = (gchar *) xmlNodeGetContent (scan))) { - e->primary_text = g_strdup (dgettext (table->translation_domain, tmp)); + e->primary_text = g_strdup ( + dgettext (table-> + translation_domain, tmp)); xmlFree (tmp); } } else if (!strcmp((gchar *)scan->name, "secondary")) { if ((tmp = (gchar *) xmlNodeGetContent (scan))) { - e->secondary_text = g_strdup (dgettext (table->translation_domain, tmp)); + e->secondary_text = g_strdup ( + dgettext (table-> + translation_domain, tmp)); xmlFree (tmp); } } else if (!strcmp((gchar *)scan->name, "button")) { diff --git a/e-util/e-text-event-processor-emacs-like.c b/e-util/e-text-event-processor-emacs-like.c index d69c53aa8d..554ea5fb1d 100644 --- a/e-util/e-text-event-processor-emacs-like.c +++ b/e-util/e-text-event-processor-emacs-like.c @@ -463,7 +463,8 @@ e_text_event_processor_emacs_like_event (ETextEventProcessor *tep, } break; - } else if ((key.state & GDK_MOD1_MASK) && !(key.state & GDK_CONTROL_MASK)) { + } else if ((key.state & GDK_MOD1_MASK) && + !(key.state & GDK_CONTROL_MASK)) { if ((key.keyval >= 'A') && (key.keyval <= 'Z')) key.keyval -= 'A' - 'a'; diff --git a/em-format/em-format.c b/em-format/em-format.c index 680d32b900..13b1febd84 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -2068,7 +2068,8 @@ emf_application_mbox (EMFormat *emf, message = camel_mime_message_new (); mime_part = CAMEL_MIME_PART (message); - if (!camel_mime_part_construct_from_parser_sync (mime_part, parser, NULL, NULL)) { + if (!camel_mime_part_construct_from_parser_sync ( + mime_part, parser, NULL, NULL)) { g_object_unref (message); break; } diff --git a/filter/e-filter-option.c b/filter/e-filter-option.c index 25a979794b..0cea021666 100644 --- a/filter/e-filter-option.c +++ b/filter/e-filter-option.c @@ -206,13 +206,20 @@ filter_option_xml_create (EFilterElement *element, option->dynamic_func = g_strdup ((const gchar *) fn); - /* get options now, to have them available when reading saved rules */ + /* Get options now, to have them + * available when reading saved + * rules. */ items = filter_option_get_dynamic_options (option); for (i = items; i; i = i->next) { op = i->data; if (op) { - e_filter_option_add (option, op->value, op->title, op->code, TRUE); + e_filter_option_add ( + option, + op->value, + op->title, + op->code, + TRUE); free_option (op); } } diff --git a/filter/e-rule-context.c b/filter/e-rule-context.c index 99378242ee..e03501ce62 100644 --- a/filter/e-rule-context.c +++ b/filter/e-rule-context.c @@ -365,7 +365,9 @@ rule_context_revert (ERuleContext *context, /* clear out anythign we have? */ return 0; - source_hash = g_hash_table_new ((GHashFunc) source_hashf, (GCompareFunc) source_eqf); + source_hash = g_hash_table_new ( + (GHashFunc) source_hashf, + (GCompareFunc) source_eqf); /* setup stuff we have now */ /* Note that we assume there is only 1 set of rules in a given rule context, @@ -395,7 +397,9 @@ rule_context_revert (ERuleContext *context, rule_map->type, NULL, NULL)); if (e_filter_rule_xml_decode (part, rule, context) == 0) { - /* use the revert data to keep track of the right rank of this rule part */ + /* Use the revert data to keep + * track of the right rank of + * this rule part. */ rest_data = g_hash_table_lookup (source_hash, part->source); if (rest_data == NULL) { rest_data = g_malloc0 (sizeof (*rest_data)); @@ -415,7 +419,11 @@ rule_context_revert (ERuleContext *context, g_hash_table_remove (rest_data->rules, frule->name); } else { e_rule_context_add_rule (context, part); - e_rule_context_rank_rule (context, part, part->source, rest_data->rank); + e_rule_context_rank_rule ( + context, + part, + part->source, + rest_data->rank); } rest_data->rank++; } else { diff --git a/libgnomecanvas/gailcanvaswidget.c b/libgnomecanvas/gailcanvaswidget.c index 7b49563322..3e61924b03 100644 --- a/libgnomecanvas/gailcanvaswidget.c +++ b/libgnomecanvas/gailcanvaswidget.c @@ -22,9 +22,11 @@ #include <libgnomecanvas/gnome-canvas-widget.h> #include "gailcanvaswidget.h" -static gint gail_canvas_widget_get_n_children (AtkObject *obj); -static AtkObject* gail_canvas_widget_ref_child (AtkObject *obj, - gint i); +static gint gail_canvas_widget_get_n_children + (AtkObject *obj); +static AtkObject * + gail_canvas_widget_ref_child (AtkObject *obj, + gint i); G_DEFINE_TYPE (GailCanvasWidget, gail_canvas_widget, diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c index 81176df6e8..35a109b937 100644 --- a/libgnomecanvas/gnome-canvas-text.c +++ b/libgnomecanvas/gnome-canvas-text.c @@ -935,9 +935,9 @@ gnome_canvas_text_get_property (GObject *object, switch (param_id) { case PROP_FONT: { - /* FIXME GValue imposes a totally gratuitous string copy - * here, we could just hand off string ownership - */ + /* FIXME GValue imposes a totally gratuitous string + * copy here, we could just hand off string + * ownership. */ gchar *str; str = pango_font_description_to_string (text->font_desc); @@ -952,34 +952,52 @@ gnome_canvas_text_get_property (GObject *object, break; case PROP_FAMILY: - g_value_set_string (value, pango_font_description_get_family (text->font_desc)); + g_value_set_string ( + value, + pango_font_description_get_family ( + text->font_desc)); break; case PROP_STYLE: - g_value_set_enum (value, pango_font_description_get_style (text->font_desc)); + g_value_set_enum ( + value, + pango_font_description_get_style ( + text->font_desc)); break; case PROP_VARIANT: - g_value_set_enum (value, pango_font_description_get_variant (text->font_desc)); + g_value_set_enum ( + value, + pango_font_description_get_variant ( + text->font_desc)); break; case PROP_WEIGHT: - g_value_set_int (value, pango_font_description_get_weight (text->font_desc)); + g_value_set_int ( + value, + pango_font_description_get_weight ( + text->font_desc)); break; case PROP_STRETCH: - g_value_set_enum (value, pango_font_description_get_stretch (text->font_desc)); + g_value_set_enum ( + value, + pango_font_description_get_stretch ( + text->font_desc)); break; case PROP_SIZE: - g_value_set_int (value, pango_font_description_get_size (text->font_desc)); + g_value_set_int ( + value, + pango_font_description_get_size ( + text->font_desc)); break; case PROP_SIZE_POINTS: g_value_set_double ( value, ((gdouble) - pango_font_description_get_size (text->font_desc)) / - (gdouble) PANGO_SCALE); + pango_font_description_get_size ( + text->font_desc)) / (gdouble) PANGO_SCALE); break; } break; diff --git a/libgnomecanvas/gnome-canvas-widget.c b/libgnomecanvas/gnome-canvas-widget.c index 5fe04ba12b..8d34911dff 100644 --- a/libgnomecanvas/gnome-canvas-widget.c +++ b/libgnomecanvas/gnome-canvas-widget.c @@ -100,8 +100,9 @@ gnome_canvas_widget_get_type (void) NULL /* value_table */ }; - widget_type = g_type_register_static (GNOME_TYPE_CANVAS_ITEM, "GnomeCanvasWidget", - &object_info, 0); + widget_type = g_type_register_static ( + GNOME_TYPE_CANVAS_ITEM, + "GnomeCanvasWidget", &object_info, 0); } return widget_type; diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index 38a6757a78..0ea1e30198 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -2183,12 +2183,16 @@ scroll_to (GnomeCanvas *canvas, gint cx, gint cy) } else canvas->zoom_yofs = 0; - if ((canvas->zoom_xofs != old_zoom_xofs) || (canvas->zoom_yofs != old_zoom_yofs)) { - /* This can only occur, if either canvas size or widget size changes */ - /* So I think we can request full redraw here */ - /* The reason is, that coverage UTA will be invalidated by offset change */ - /* fixme: Strictly this is not correct - we have to remove our own idle (Lauris) */ - /* More stuff - we have to mark root as needing fresh affine (Lauris) */ + if ((canvas->zoom_xofs != old_zoom_xofs) || + (canvas->zoom_yofs != old_zoom_yofs)) { + /* This can only occur, if either canvas size or widget + * size changes. So I think we can request full redraw + * here. The reason is, that coverage UTA will be + * invalidated by offset change. */ + /* FIXME Strictly this is not correct - we have to remove + * our own idle (Lauris) */ + /* More stuff - we have to mark root as needing fresh affine + * (Lauris) */ if (!(canvas->root->flags & GNOME_CANVAS_ITEM_NEED_AFFINE)) { canvas->root->flags |= GNOME_CANVAS_ITEM_NEED_AFFINE; gnome_canvas_request_update (canvas); @@ -2526,7 +2530,8 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) } else canvas->new_current_item = NULL; - if ((canvas->new_current_item == canvas->current_item) && !canvas->left_grabbed_item) + if ((canvas->new_current_item == canvas->current_item) + && !canvas->left_grabbed_item) return retval; /* current item did not change */ /* Synthesize events for old and new current items */ diff --git a/mail/e-mail-browser.c b/mail/e-mail-browser.c index 63bfb4d5b5..2179522c60 100644 --- a/mail/e-mail-browser.c +++ b/mail/e-mail-browser.c @@ -313,8 +313,9 @@ mail_browser_popup_event_cb (EMailBrowser *browser, GdkEventButton *event, const gchar *uri) { - EMFormatHTML *html_formatter; + EMFormatHTML *formatter; EMailReader *reader; + EWebView *web_view; GtkMenu *menu; guint32 state; @@ -322,9 +323,10 @@ mail_browser_popup_event_cb (EMailBrowser *browser, return FALSE; reader = E_MAIL_READER (browser); - html_formatter = e_mail_reader_get_formatter (reader); + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); - if (html_formatter && e_web_view_get_cursor_image (em_format_html_get_web_view (html_formatter)) != NULL) + if (e_web_view_get_cursor_image (web_view) != NULL) return FALSE; menu = e_mail_reader_get_popup_menu (reader); diff --git a/mail/e-mail-folder-utils.c b/mail/e-mail-folder-utils.c index e0b4471041..f621d7464d 100644 --- a/mail/e-mail-folder-utils.c +++ b/mail/e-mail-folder-utils.c @@ -1419,10 +1419,11 @@ e_mail_folder_uri_parse (CamelSession *session, if (url->host != NULL) { gchar *uid; - if (!url->user || !*url->user) + if (url->user == NULL || *url->user == '\0') uid = g_strdup (url->host); else - uid = g_strconcat (url->user, "@", url->host, NULL); + uid = g_strconcat ( + url->user, "@", url->host, NULL); service = camel_session_get_service (session, uid); g_free (uid); diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c index 3866148a22..de74f8175e 100644 --- a/mail/e-mail-migrate.c +++ b/mail/e-mail-migrate.c @@ -158,7 +158,10 @@ em_migrate_setup_progress_dialog (const gchar *title, const gchar *desc) w = gtk_label_new (NULL); gtk_misc_set_alignment (GTK_MISC (w), 0.0, 0.0); - markup = g_strconcat ("<big><b>", title ? title : _("Migration"), "</b></big>", NULL); + markup = g_strconcat ( + "<big><b>", + title ? title : _("Migration"), + "</b></big>", NULL); gtk_label_set_markup (GTK_LABEL (w), markup); gtk_box_pack_start (GTK_BOX (vbox), w, TRUE, TRUE, 0); g_free (markup); @@ -419,8 +422,8 @@ is_in_plugs_list (GSList *list, const gchar *value) /* * em_update_message_notify_settings_2_21 - * DBus plugin and sound email notification was merged to mail-notification plugin, - * so move these options to new locations. + * DBus plugin and sound email notification was merged to + * mail-notification plugin, so move the options to new locations. */ static void em_update_message_notify_settings_2_21 (void) @@ -434,7 +437,9 @@ em_update_message_notify_settings_2_21 (void) client = gconf_client_get_default (); - is_key = gconf_client_get (client, "/apps/evolution/eplugin/mail-notification/dbus-enabled", NULL); + is_key = gconf_client_get ( + client, + "/apps/evolution/eplugin/mail-notification/dbus-enabled", NULL); if (is_key) { /* already migrated, so do not migrate again */ gconf_value_free (is_key); @@ -443,20 +448,38 @@ em_update_message_notify_settings_2_21 (void) return; } - gconf_client_set_bool (client, "/apps/evolution/eplugin/mail-notification/status-blink-icon", - gconf_client_get_bool (client, "/apps/evolution/mail/notification/blink-status-icon", NULL), NULL); - gconf_client_set_bool (client, "/apps/evolution/eplugin/mail-notification/status-notification", - gconf_client_get_bool (client, "/apps/evolution/mail/notification/notification", NULL), NULL); - - list = gconf_client_get_list (client, "/apps/evolution/eplugin/disabled", GCONF_VALUE_STRING, NULL); + gconf_client_set_bool ( + client, + "/apps/evolution/eplugin/mail-notification/status-blink-icon", + gconf_client_get_bool ( + client, + "/apps/evolution/mail/notification/blink-status-icon", + NULL), NULL); + gconf_client_set_bool ( + client, + "/apps/evolution/eplugin/mail-notification/status-notification", + gconf_client_get_bool ( + client, + "/apps/evolution/mail/notification/notification", + NULL), NULL); + + list = gconf_client_get_list ( + client, "/apps/evolution/eplugin/disabled", + GCONF_VALUE_STRING, NULL); dbus = !is_in_plugs_list (list, "org.gnome.evolution.new_mail_notify"); - status = !is_in_plugs_list (list, "org.gnome.evolution.mail_notification"); - - gconf_client_set_bool (client, "/apps/evolution/eplugin/mail-notification/dbus-enabled", dbus, NULL); - gconf_client_set_bool (client, "/apps/evolution/eplugin/mail-notification/status-enabled", status, NULL); + status = !is_in_plugs_list ( + list, "org.gnome.evolution.mail_notification"); + + gconf_client_set_bool ( + client, + "/apps/evolution/eplugin/mail-notification/dbus-enabled", + dbus, NULL); + gconf_client_set_bool ( + client, + "/apps/evolution/eplugin/mail-notification/status-enabled", + status, NULL); if (!status) { - /* enable this plugin, because it holds all those other things */ GSList *plugins, *l; plugins = e_plugin_list_plugins (); @@ -464,7 +487,8 @@ em_update_message_notify_settings_2_21 (void) for (l = plugins; l; l = l->next) { EPlugin *p = l->data; - if (p && p->id && !strcmp (p->id, "org.gnome.evolution.mail_notification")) { + if (p && p->id && !strcmp (p->id, + "org.gnome.evolution.mail_notification")) { e_plugin_enable (p, 1); break; } @@ -477,12 +501,23 @@ em_update_message_notify_settings_2_21 (void) g_slist_foreach (list, (GFunc) g_free, NULL); g_slist_free (list); - val = gconf_client_get_int (client, "/apps/evolution/mail/notify/type", NULL); - gconf_client_set_bool (client, "/apps/evolution/eplugin/mail-notification/sound-enabled", val == 1 || val == 2, NULL); - gconf_client_set_bool (client, "/apps/evolution/eplugin/mail-notification/sound-beep", val == 0 || val == 1, NULL); - - str = gconf_client_get_string (client, "/apps/evolution/mail/notify/sound", NULL); - gconf_client_set_string (client, "/apps/evolution/eplugin/mail-notification/sound-file", str ? str : "", NULL); + val = gconf_client_get_int ( + client, "/apps/evolution/mail/notify/type", NULL); + gconf_client_set_bool ( + client, + "/apps/evolution/eplugin/mail-notification/sound-enabled", + val == 1 || val == 2, NULL); + gconf_client_set_bool ( + client, + "/apps/evolution/eplugin/mail-notification/sound-beep", + val == 0 || val == 1, NULL); + + str = gconf_client_get_string ( + client, "/apps/evolution/mail/notify/sound", NULL); + gconf_client_set_string ( + client, + "/apps/evolution/eplugin/mail-notification/sound-file", + str ? str : "", NULL); g_free (str); g_object_unref (client); @@ -497,12 +532,16 @@ em_update_sa_junk_setting_2_23 (void) client = gconf_client_get_default (); - key = gconf_client_get (client, "/apps/evolution/mail/junk/default_plugin", NULL); + key = gconf_client_get ( + client, "/apps/evolution/mail/junk/default_plugin", NULL); if (key) { const gchar *str = gconf_value_get_string (key); if (str && strcmp (str, "Spamassasin") == 0) - gconf_client_set_string (client, "/apps/evolution/mail/junk/default_plugin", "SpamAssassin", NULL); + gconf_client_set_string ( + client, + "/apps/evolution/mail/junk/default_plugin", + "SpamAssassin", NULL); gconf_value_free (key); g_object_unref (client); @@ -574,7 +613,9 @@ migrate_folders (CamelStore *store, if (folder != NULL) camel_folder_summary_migrate_infos (folder->summary); - migrate_folders (store, is_local, fi->child, acc, done, nth_folder, total_folders); + migrate_folders ( + store, is_local, fi->child, + acc, done, nth_folder, total_folders); fi = fi->next; } @@ -732,7 +773,10 @@ migrate_to_db (EShellBackend *shell_backend) migrate_dbs.store = store; migrate_dbs.done = FALSE; - g_thread_create ((GThreadFunc) migrate_folders_to_db_thread, &migrate_dbs, TRUE, NULL); + g_thread_create ( + (GThreadFunc) + migrate_folders_to_db_thread, + &migrate_dbs, TRUE, NULL); while (!migrate_dbs.done) g_main_context_iteration (NULL, TRUE); } else @@ -794,7 +838,10 @@ sanitize_maildir_folder_name (gchar *folder_name) } static void -copy_folder (CamelStore *mbox_store, CamelStore *maildir_store, const gchar *mbox_fname, const gchar *maildir_fname) +copy_folder (CamelStore *mbox_store, + CamelStore *maildir_store, + const gchar *mbox_fname, + const gchar *maildir_fname) { CamelFolder *fromfolder, *tofolder; GPtrArray *uids; @@ -828,7 +875,10 @@ copy_folder (CamelStore *mbox_store, CamelStore *maildir_store, const gchar *mbo } static void -copy_folders (CamelStore *mbox_store, CamelStore *maildir_store, CamelFolderInfo *fi, EMMigrateSession *session) +copy_folders (CamelStore *mbox_store, + CamelStore *maildir_store, + CamelFolderInfo *fi, + EMMigrateSession *session) { if (fi) { if (!g_str_has_prefix (fi->full_name, ".#evolution")) { @@ -1070,7 +1120,8 @@ em_ensure_proxy_ignore_hosts_being_list (void) GConfClient *client; GConfValue *key_value; - /* makes sure the 'key' is a list of strings, not a string, as set by previous versions */ + /* Makes sure the 'key' is a list of strings, not a string, + * as set by previous versions. */ client = gconf_client_get_default (); key_value = gconf_client_get (client, key, NULL); @@ -1110,7 +1161,9 @@ em_ensure_proxy_ignore_hosts_being_list (void) g_free (value); if (error) { - fprintf (stderr, "%s: Failed to set a list values with error: %s\n", G_STRFUNC, error->message); + fprintf ( + stderr, "%s: Failed to set a list values " + "with error: %s\n", G_STRFUNC, error->message); g_error_free (error); } } @@ -1160,7 +1213,9 @@ e_mail_migrate (EShellBackend *shell_backend, } #else if (major < 2 || (major == 2 && minor < 24)) - g_debug ("Upgrading from ancient versions %d.%d not supported on Windows", major, minor); + g_debug ( + "Upgrading from ancient versions %d.%d " + "not supported on Windows", major, minor); #endif if (major < 2 || (major == 2 && minor < 32)) { diff --git a/mail/e-mail-session-utils.c b/mail/e-mail-session-utils.c index ae9bd96a39..2baf2632a0 100644 --- a/mail/e-mail-session-utils.c +++ b/mail/e-mail-session-utils.c @@ -408,8 +408,10 @@ mail_session_send_to_thread (GSimpleAsyncResult *simple, if (!CAMEL_IS_TRANSPORT (service)) { g_simple_async_result_set_error (simple, - CAMEL_SERVICE_ERROR, CAMEL_SERVICE_ERROR_URL_INVALID, - _("Cannot get transport service for account '%s'"), context->transport_uid); + CAMEL_SERVICE_ERROR, + CAMEL_SERVICE_ERROR_URL_INVALID, + _("Cannot get transport for account '%s'"), + context->transport_uid); return; } diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c index d61f8521dc..17ff7652ba 100644 --- a/mail/e-mail-store.c +++ b/mail/e-mail-store.c @@ -329,7 +329,9 @@ e_mail_store_add_by_account (EMailSession *session, g_free (transport_uid); if (transport_error) { - g_warning ("%s: Failed to add transport service: %s", G_STRFUNC, transport_error->message); + g_warning ( + "%s: Failed to add transport service: %s", + G_STRFUNC, transport_error->message); g_error_free (transport_error); } } diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index e72e5db257..bc836a890d 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1139,9 +1139,10 @@ static struct { } conf_messages[] = { [QUOTING_ATTRIBUTION] = { "/apps/evolution/mail/composer/message_attribution", - /* Note to translators: this is the attribution string used when quoting messages. - * each ${Variable} gets replaced with a value. To see a full list of available - * variables, see mail/em-composer-utils.c:attribvars array */ + /* Note to translators: this is the attribution string used + * when quoting messages. Each ${Variable} gets replaced + * with a value. To see a full list of available variables, + * see mail/em-composer-utils.c:attribvars array. */ N_("On ${AbbrevWeekdayName}, ${Year}-${Month}-${Day} at " "${24Hour}:${Minute} ${TimeZone}, ${Sender} wrote:") }, diff --git a/mail/em-folder-properties.c b/mail/em-folder-properties.c index d61212f317..090dcd75c4 100644 --- a/mail/em-folder-properties.c +++ b/mail/em-folder-properties.c @@ -228,9 +228,12 @@ emfp_get_folder_item (EConfig *ec, static EMConfigItem emfp_items[] = { { E_CONFIG_BOOK, (gchar *) "", NULL }, - { E_CONFIG_PAGE, (gchar *) "00.general", (gchar *) N_("General") }, - { E_CONFIG_SECTION, (gchar *) "00.general/00.folder", NULL /* set by code */ }, - { E_CONFIG_ITEM, (gchar *) "00.general/00.folder/00.info", NULL, emfp_get_folder_item }, + { E_CONFIG_PAGE, (gchar *) "00.general", + (gchar *) N_("General") }, + { E_CONFIG_SECTION, (gchar *) "00.general/00.folder", + NULL /* set by code */ }, + { E_CONFIG_ITEM, (gchar *) "00.general/00.folder/00.info", + NULL, emfp_get_folder_item }, }; static gboolean emfp_items_translated = FALSE; diff --git a/mail/em-folder-selector.c b/mail/em-folder-selector.c index 5bf3b3f1c6..0f2bbc79f2 100644 --- a/mail/em-folder-selector.c +++ b/mail/em-folder-selector.c @@ -164,7 +164,12 @@ folder_activated_cb (EMFolderTree *emft, } void -em_folder_selector_construct (EMFolderSelector *emfs, EMFolderTree *emft, guint32 flags, const gchar *title, const gchar *text, const gchar *oklabel) +em_folder_selector_construct (EMFolderSelector *emfs, + EMFolderTree *emft, + guint32 flags, + const gchar *title, + const gchar *text, + const gchar *oklabel) { GtkWidget *container; GtkWidget *widget; @@ -179,15 +184,23 @@ em_folder_selector_construct (EMFolderSelector *emfs, EMFolderTree *emft, guint3 emfs->flags = flags; if (flags & EM_FOLDER_SELECTOR_CAN_CREATE) { - gtk_dialog_add_button (GTK_DIALOG (emfs), GTK_STOCK_NEW, EM_FOLDER_SELECTOR_RESPONSE_NEW); - g_signal_connect (emfs, "response", G_CALLBACK (emfs_response), emfs); + gtk_dialog_add_button ( + GTK_DIALOG (emfs), GTK_STOCK_NEW, + EM_FOLDER_SELECTOR_RESPONSE_NEW); + g_signal_connect ( + emfs, "response", + G_CALLBACK (emfs_response), emfs); } - gtk_dialog_add_buttons (GTK_DIALOG (emfs), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, - oklabel?oklabel:GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); + gtk_dialog_add_buttons ( + GTK_DIALOG (emfs), + GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL, + oklabel ? oklabel : GTK_STOCK_OK, GTK_RESPONSE_OK, NULL); - gtk_dialog_set_response_sensitive (GTK_DIALOG (emfs), GTK_RESPONSE_OK, FALSE); - gtk_dialog_set_default_response (GTK_DIALOG (emfs), GTK_RESPONSE_OK); + gtk_dialog_set_response_sensitive ( + GTK_DIALOG (emfs), GTK_RESPONSE_OK, FALSE); + gtk_dialog_set_default_response ( + GTK_DIALOG (emfs), GTK_RESPONSE_OK); widget = gtk_scrolled_window_new (NULL, NULL); gtk_scrolled_window_set_policy ( @@ -202,8 +215,12 @@ em_folder_selector_construct (EMFolderSelector *emfs, EMFolderTree *emft, guint3 gtk_container_add (GTK_CONTAINER (widget), GTK_WIDGET (emft)); gtk_widget_show (GTK_WIDGET (emft)); - g_signal_connect (emfs->emft, "folder-selected", G_CALLBACK (folder_selected_cb), emfs); - g_signal_connect (emfs->emft, "folder-activated", G_CALLBACK (folder_activated_cb), emfs); + g_signal_connect ( + emfs->emft, "folder-selected", + G_CALLBACK (folder_selected_cb), emfs); + g_signal_connect ( + emfs->emft, "folder-activated", + G_CALLBACK (folder_activated_cb), emfs); if (text != NULL) { widget = gtk_label_new (text); @@ -275,10 +292,17 @@ em_folder_selector_create_new (GtkWindow *parent, w = gtk_label_new_with_mnemonic (_("Folder _name:")); gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, FALSE, 6); emfs->name_entry = (GtkEntry *) gtk_entry_new (); - gtk_label_set_mnemonic_widget (GTK_LABEL (w), (GtkWidget *) emfs->name_entry); - g_signal_connect (emfs->name_entry, "changed", G_CALLBACK (emfs_create_name_changed), emfs); - g_signal_connect (emfs->name_entry, "activate", G_CALLBACK (emfs_create_name_activate), emfs); - gtk_box_pack_start ((GtkBox *) hbox, (GtkWidget *) emfs->name_entry, TRUE, FALSE, 6); + gtk_label_set_mnemonic_widget ( + GTK_LABEL (w), (GtkWidget *) emfs->name_entry); + g_signal_connect ( + emfs->name_entry, "changed", + G_CALLBACK (emfs_create_name_changed), emfs); + g_signal_connect ( + emfs->name_entry, "activate", + G_CALLBACK (emfs_create_name_activate), emfs); + gtk_box_pack_start ( + (GtkBox *) hbox, (GtkWidget *) emfs->name_entry, + TRUE, FALSE, 6); gtk_widget_show_all (hbox); container = gtk_dialog_get_content_area (GTK_DIALOG (emfs)); @@ -332,7 +356,10 @@ em_folder_selector_get_selected_uri (EMFolderSelector *emfs) } else { gchar *path; - path = g_strdup_printf("%s/%s", (url->path == NULL || strcmp(url->path, "/") == 0) ? "":url->path, name); + path = g_strdup_printf ( + "%s/%s", (url->path == NULL || + strcmp (url->path, "/") == 0) ? "": + url->path, name); camel_url_set_path (url, path); if (path[0] == '/') { newpath = g_strdup (path+1); diff --git a/mail/em-folder-tree.c b/mail/em-folder-tree.c index b9b1173011..e24b7d329b 100644 --- a/mail/em-folder-tree.c +++ b/mail/em-folder-tree.c @@ -315,7 +315,10 @@ folder_tree_get_folder_info__done (struct _EMFolderTreeGetFolderInfo *m) return; } } else { - gint fully_loaded = (m->flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) ? TRUE : FALSE; + gint fully_loaded; + + fully_loaded = + ((m->flags & CAMEL_STORE_FOLDER_INFO_RECURSIVE) != 0); do { if (g_hash_table_lookup (si->full_hash, fi->full_name) == NULL) { @@ -1787,7 +1790,11 @@ tree_drag_data_delete (GtkWidget *widget, CamelStore *store; GtkTreeIter iter; - if (!priv->drag_row || (src_path = gtk_tree_row_reference_get_path (priv->drag_row))) + if (!priv->drag_row) + return; + + src_path = gtk_tree_row_reference_get_path (priv->drag_row); + if (src_path == NULL) return; model = gtk_tree_view_get_model (GTK_TREE_VIEW (folder_tree)); @@ -2190,7 +2197,8 @@ folder_tree_drop_target (EMFolderTree *folder_tree, if (gtk_tree_path_compare (path, src_path) == 0 || gtk_tree_path_is_descendant (path, src_path) || (gtk_tree_path_is_ancestor (path, src_path) - && gtk_tree_path_get_depth (path) == gtk_tree_path_get_depth (src_path)-1)) { + && gtk_tree_path_get_depth (path) == + gtk_tree_path_get_depth (src_path) - 1)) { gtk_tree_path_free (src_path); goto done; } diff --git a/mail/em-folder-utils.c b/mail/em-folder-utils.c index 60f03002f0..8ea58365f0 100644 --- a/mail/em-folder-utils.c +++ b/mail/em-folder-utils.c @@ -344,11 +344,14 @@ emfu_copy_folder_selected (EMailBackend *backend, goto fail; } - if (!e_mail_folder_uri_parse (CAMEL_SESSION (session), uri, &tostore, &tobase, &local_error)) + if (!e_mail_folder_uri_parse ( + CAMEL_SESSION (session), uri, + &tostore, &tobase, &local_error)) tostore = NULL; if (tostore != NULL) - camel_service_connect_sync (CAMEL_SERVICE (tostore), &local_error); + camel_service_connect_sync ( + CAMEL_SERVICE (tostore), &local_error); if (local_error != NULL) { e_mail_backend_submit_alert ( @@ -631,10 +634,14 @@ emfu_popup_new_folder_response (EMFolderSelector *emfs, session = em_folder_tree_get_session (folder_tree); - if (!e_mail_folder_uri_parse (CAMEL_SESSION (session), uri, &store, NULL, &error)) { - g_warning ("%s: Failed to parse folder uri: %s", G_STRFUNC, error ? error->message : "Unknown error"); - if (error) - g_error_free (error); + e_mail_folder_uri_parse ( + CAMEL_SESSION (session), uri, &store, NULL, &error); + + if (error != NULL) { + g_warning ( + "%s: Failed to parse folder uri: %s", + G_STRFUNC, error->message); + g_error_free (error); return; } diff --git a/mail/em-format-html-print.h b/mail/em-format-html-print.h index 446f93fd78..c33669651d 100644 --- a/mail/em-format-html-print.h +++ b/mail/em-format-html-print.h @@ -49,8 +49,11 @@ typedef struct _EMFormatHTMLPrintClass EMFormatHTMLPrintClass; struct _EMFormatHTMLPrint { EMFormatHTML parent; - GtkWidget *window; /* used to realise the gtkhtml in a toplevel, i dont know why */ - EMFormatHTML *source; /* used for print_message */ + /* Used to realize the gtkhtml in a toplevel. */ + GtkWidget *window; + + /* Used for print_message. */ + EMFormatHTML *source; GtkPrintOperationAction action; }; diff --git a/mail/em-utils.c b/mail/em-utils.c index a9027e0fa2..c832c898c6 100644 --- a/mail/em-utils.c +++ b/mail/em-utils.c @@ -941,7 +941,9 @@ em_utils_selection_set_urilist (GtkSelectionData *data, GdkAtom target; target = gtk_selection_data_get_target (data); - gtk_selection_data_set (data, target, 8, (guchar *) uri_crlf, strlen (uri_crlf)); + gtk_selection_data_set ( + data, target, 8, (guchar *) + uri_crlf, strlen (uri_crlf)); g_free (uri_crlf); } @@ -2107,15 +2109,17 @@ em_utils_generate_account_hash (void) if (account->id->address) { EAccount *acnt; - /* Accounts with identical email addresses that are enabled - * take precedence over the accounts that aren't. If all - * accounts with matching email addresses are disabled, then - * the first one in the list takes precedence. The default - * account always takes precedence no matter what. - */ - acnt = g_hash_table_lookup (account_hash, account->id->address); + /* Accounts with identical email addresses that are + * enabled take precedence over the accounts that + * aren't. If all accounts with matching email + * addresses are disabled, then the first one in + * the list takes precedence. The default account + * always takes precedence no matter what. */ + acnt = g_hash_table_lookup ( + account_hash, account->id->address); if (acnt && acnt != def && !acnt->enabled && account->enabled) { - g_hash_table_remove (account_hash, acnt->id->address); + g_hash_table_remove ( + account_hash, acnt->id->address); acnt = NULL; } @@ -2131,9 +2135,13 @@ em_utils_generate_account_hash (void) g_object_unref (iterator); - /* The default account has to be there if none of the enabled accounts are present */ + /* The default account has to be there if none + * of the enabled accounts are present. */ if (g_hash_table_size (account_hash) == 0 && def && def->id->address) - g_hash_table_insert (account_hash, (gchar *) def->id->address, (gpointer) def); + g_hash_table_insert ( + account_hash, (gchar *) + def->id->address, + (gpointer) def); return account_hash; } diff --git a/mail/importers/evolution-mbox-importer.c b/mail/importers/evolution-mbox-importer.c index 803165b4ee..9c251027e3 100644 --- a/mail/importers/evolution-mbox-importer.c +++ b/mail/importers/evolution-mbox-importer.c @@ -133,8 +133,10 @@ mbox_getwidget (EImport *ei, EImportTarget *target, EImportImporter *im) session, _("Select folder"), _("Select folder to import into")); gtk_label_set_mnemonic_widget (label, w); - em_folder_selection_button_set_selection ((EMFolderSelectionButton *) w, select_uri); - folder_selected (EM_FOLDER_SELECTION_BUTTON (w), (EImportTargetURI *) target); + em_folder_selection_button_set_selection ( + EM_FOLDER_SELECTION_BUTTON (w), select_uri); + folder_selected ( + EM_FOLDER_SELECTION_BUTTON (w), (EImportTargetURI *) target); g_signal_connect (w, "selected", G_CALLBACK(folder_selected), target); gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, TRUE, 6); diff --git a/mail/importers/pine-importer.c b/mail/importers/pine-importer.c index e229978e33..fea9218e2e 100644 --- a/mail/importers/pine-importer.c +++ b/mail/importers/pine-importer.c @@ -268,9 +268,13 @@ pine_import_done (struct _pine_import_msg *m) gconf = gconf_client_get_default (); if (GPOINTER_TO_INT(g_datalist_get_data(&m->target->data, "pine-do-addr"))) - gconf_client_set_bool(gconf, "/apps/evolution/importer/pine/addr", TRUE, NULL); + gconf_client_set_bool ( + gconf, "/apps/evolution/importer/pine/addr", + TRUE, NULL); if (GPOINTER_TO_INT(g_datalist_get_data(&m->target->data, "pine-do-mail"))) - gconf_client_set_bool(gconf, "/apps/evolution/importer/pine/mail", TRUE, NULL); + gconf_client_set_bool ( + gconf, "/apps/evolution/importer/pine/mail", + TRUE, NULL); g_object_unref (gconf); } diff --git a/mail/mail-ops.c b/mail/mail-ops.c index 67906957bd..988c9fadcb 100644 --- a/mail/mail-ops.c +++ b/mail/mail-ops.c @@ -128,8 +128,8 @@ em_filter_folder_element_exec (struct _filter_mail_msg *m, if (m->destination) camel_folder_thaw (m->destination); - /* this may thaw/unref source folders, do it here so we dont do it in the main thread - see also fetch_mail_fetch () below */ + /* this may thaw/unref source folders, do it here so we dont do + * it in the main thread see also fetch_mail_fetch () below */ g_object_unref (m->driver); m->driver = NULL; } @@ -162,7 +162,7 @@ em_filter_folder_element_free (struct _filter_mail_msg *m) static MailMsgInfo em_filter_folder_element_info = { sizeof (struct _filter_mail_msg), - (MailMsgDescFunc) em_filter_folder_element_desc, /* we do our own progress reporting? */ + (MailMsgDescFunc) em_filter_folder_element_desc, (MailMsgExecFunc) em_filter_folder_element_exec, (MailMsgDoneFunc) em_filter_folder_element_done, (MailMsgFreeFunc) em_filter_folder_element_free @@ -270,10 +270,11 @@ fetch_mail_exec (struct _fetch_mail_msg *m, } if (fm->delete && (!error || !*error)) { - /* not keep on server - just delete all the actual messages on the server */ + /* not keep on server - just delete all + * the actual messages on the server */ for (i=0;i<folder_uids->len;i++) { - d(printf("force delete uid '%s'\n", (gchar *)folder_uids->pdata[i])); - camel_folder_delete_message (folder, folder_uids->pdata[i]); + camel_folder_delete_message ( + folder, folder_uids->pdata[i]); } } @@ -429,7 +430,11 @@ struct _send_queue_msg { gpointer data; }; -static void report_status (struct _send_queue_msg *m, enum camel_filter_status_t status, gint pc, const gchar *desc, ...); +static void report_status (struct _send_queue_msg *m, + enum camel_filter_status_t status, + gint pc, + const gchar *desc, + ...); /* send 1 message to a specific transport */ static void @@ -612,7 +617,10 @@ mail_send_message (struct _send_queue_msg *m, g_string_append_printf ( err, _("Failed to append to %s: %s\n" "Appending to local 'Sent' folder instead."), - sent_folder_uri, local_error ? local_error->message : _("Unknown error")); + sent_folder_uri, + local_error ? + local_error->message : + _("Unknown error")); if (local_error) g_clear_error (&local_error); } @@ -709,7 +717,11 @@ exit: /* ** SEND MAIL QUEUE ***************************************************** */ static void -report_status (struct _send_queue_msg *m, enum camel_filter_status_t status, gint pc, const gchar *desc, ...) +report_status (struct _send_queue_msg *m, + enum camel_filter_status_t status, + gint pc, + const gchar *desc, + ...) { va_list ap; gchar *str; @@ -817,8 +829,12 @@ send_queue_exec (struct _send_queue_msg *m, j += (send_uids->len - i); if (j > 0) - report_status (m, CAMEL_FILTER_STATUS_END, 100, _("Failed to send %d of %d messages"), j, send_uids->len); - else if (g_error_matches (m->base.error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) + report_status ( + m, CAMEL_FILTER_STATUS_END, 100, + _("Failed to send %d of %d messages"), + j, send_uids->len); + else if (g_error_matches ( + m->base.error, G_IO_ERROR, G_IO_ERROR_CANCELLED)) report_status (m, CAMEL_FILTER_STATUS_END, 100, _("Canceled.")); else report_status (m, CAMEL_FILTER_STATUS_END, 100, _("Complete.")); @@ -875,7 +891,8 @@ static MailMsgInfo send_queue_info = { (MailMsgFreeFunc) send_queue_free }; -/* same interface as fetch_mail, just 'cause i'm lazy today (and we need to run it from the same spot?) */ +/* same interface as fetch_mail, just 'cause i'm lazy today + * (and we need to run it from the same spot?) */ void mail_send_queue (EMailSession *session, CamelFolder *queue, @@ -928,8 +945,11 @@ struct _transfer_msg { static gchar * transfer_messages_desc (struct _transfer_msg *m) { - return g_strdup_printf (m->delete ? _("Moving messages to '%s'") : _("Copying messages to '%s'"), - m->dest_uri); + return g_strdup_printf ( + m->delete ? + _("Moving messages to '%s'") : + _("Copying messages to '%s'"), + m->dest_uri); } @@ -1083,7 +1103,9 @@ static MailMsgInfo sync_folder_info = { }; void -mail_sync_folder (CamelFolder *folder, void (*done) (CamelFolder *folder, gpointer data), gpointer data) +mail_sync_folder (CamelFolder *folder, + void (*done) (CamelFolder *folder, gpointer data), + gpointer data) { struct _sync_folder_msg *m; @@ -1157,7 +1179,10 @@ static MailMsgInfo sync_store_info = { }; void -mail_sync_store (CamelStore *store, gint expunge, void (*done) (CamelStore *store, gpointer data), gpointer data) +mail_sync_store (CamelStore *store, + gint expunge, + void (*done) (CamelStore *store, gpointer data), + gpointer data) { struct _sync_store_msg *m; @@ -1176,7 +1201,9 @@ mail_sync_store (CamelStore *store, gint expunge, void (*done) (CamelStore *stor static gchar * refresh_folder_desc (struct _sync_folder_msg *m) { - return g_strdup_printf (_("Refreshing folder '%s'"), camel_folder_get_full_name (m->folder)); + return g_strdup_printf ( + _("Refreshing folder '%s'"), + camel_folder_get_full_name (m->folder)); } static void @@ -1198,7 +1225,9 @@ static MailMsgInfo refresh_folder_info = { }; void -mail_refresh_folder (CamelFolder *folder, void (*done) (CamelFolder *folder, gpointer data), gpointer data) +mail_refresh_folder (CamelFolder *folder, + void (*done) (CamelFolder *folder, gpointer data), + gpointer data) { struct _sync_folder_msg *m; @@ -1226,10 +1255,14 @@ folder_is_from_source_uid (CamelFolder *folder, return (g_strcmp0 (uid, source_uid) == 0); } -/* This is because pop3 accounts are hidden under local Inbox, thus whenever an expunge - is done on a local trash or Inbox, then also all active pop3 accounts should be expunged. */ +/* This is because pop3 accounts are hidden under local Inbox, + * thus whenever an expunge is done on a local trash or Inbox, + * then also all active pop3 accounts should be expunged. */ static void -expunge_pop3_stores (CamelFolder *expunging, EMailSession *session, GCancellable *cancellable, GError **error) +expunge_pop3_stores (CamelFolder *expunging, + EMailSession *session, + GCancellable *cancellable, + GError **error) { GPtrArray *uids; CamelFolder *folder; @@ -1243,7 +1276,10 @@ expunge_pop3_stores (CamelFolder *expunging, EMailSession *session, GCancellable return; for (i = 0; i < uids->len; i++) { - CamelMessageInfo *info = camel_folder_get_message_info (expunging, uids->pdata[i]); + CamelMessageInfo *info; + + info = camel_folder_get_message_info ( + expunging, uids->pdata[i]); if (!info) continue; @@ -1252,19 +1288,31 @@ expunge_pop3_stores (CamelFolder *expunging, EMailSession *session, GCancellable CamelMimeMessage *msg; GError *local_error = NULL; - /* because the UID in the local store doesn't match with the UID in the pop3 store */ - msg = camel_folder_get_message_sync (expunging, uids->pdata[i], cancellable, &local_error); + /* because the UID in the local store doesn't + * match with the UID in the pop3 store */ + msg = camel_folder_get_message_sync ( + expunging, uids->pdata[i], + cancellable, &local_error); if (msg) { const gchar *pop3_uid; - pop3_uid = camel_medium_get_header (CAMEL_MEDIUM (msg), "X-Evolution-POP3-UID"); + pop3_uid = camel_medium_get_header ( + CAMEL_MEDIUM (msg), + "X-Evolution-POP3-UID"); if (pop3_uid) { - gchar *duped = g_strstrip (g_strdup (pop3_uid)); + gchar *duped; + + duped = g_strstrip (g_strdup (pop3_uid)); if (!expunging_uids) - expunging_uids = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, g_free); + expunging_uids = g_hash_table_new_full ( + g_str_hash, g_str_equal, + + g_free, g_free); - g_hash_table_insert (expunging_uids, duped, g_strdup (camel_mime_message_get_source (msg))); + g_hash_table_insert ( + expunging_uids, duped, + g_strdup (camel_mime_message_get_source (msg))); } g_object_unref (msg); @@ -1288,7 +1336,9 @@ expunge_pop3_stores (CamelFolder *expunging, EMailSession *session, GCancellable e_iterator_next (iter)) { account = (EAccount *) e_iterator_get (iter); - if (account->enabled && account->source && account->source->url && g_str_has_prefix (account->source->url, "pop://")) { + if (account->enabled && + account->source && account->source->url && + g_str_has_prefix (account->source->url, "pop://")) { gboolean any_found = FALSE; folder = e_mail_session_get_inbox_sync ( @@ -1299,7 +1349,8 @@ expunge_pop3_stores (CamelFolder *expunging, EMailSession *session, GCancellable uids = camel_folder_get_uids (folder); if (uids) { for (i = 0; i < uids->len; i++) { - /* ensure the ID is from this account, as it's generated by evolution */ + /* ensure the ID is from this account, + * as it's generated by evolution */ const gchar *source_uid; source_uid = g_hash_table_lookup ( @@ -1328,7 +1379,9 @@ expunge_pop3_stores (CamelFolder *expunging, EMailSession *session, GCancellable static gchar * expunge_folder_desc (struct _sync_folder_msg *m) { - return g_strdup_printf (_("Expunging folder '%s'"), camel_folder_get_full_name (m->folder)); + return g_strdup_printf ( + _("Expunging folder '%s'"), + camel_folder_get_full_name (m->folder)); } static void @@ -1336,9 +1389,11 @@ expunge_folder_exec (struct _sync_folder_msg *m, GCancellable *cancellable, GError **error) { - gboolean is_local_inbox_or_trash = m->folder == e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_INBOX); + gboolean is_local_inbox_or_trash = + m->folder == e_mail_local_get_folder (E_MAIL_LOCAL_FOLDER_INBOX); - if (!is_local_inbox_or_trash && e_mail_local_get_store () == camel_folder_get_parent_store (m->folder)) { + if (!is_local_inbox_or_trash && e_mail_local_get_store () == + camel_folder_get_parent_store (m->folder)) { CamelFolder *trash; trash = e_mail_session_get_trash_sync ( @@ -1367,7 +1422,10 @@ static MailMsgInfo expunge_folder_info = { }; void -mail_expunge_folder (EMailSession *session, CamelFolder *folder, void (*done) (CamelFolder *folder, gpointer data), gpointer data) +mail_expunge_folder (EMailSession *session, + CamelFolder *folder, + void (*done) (CamelFolder *folder, gpointer data), + gpointer data) { struct _sync_folder_msg *m; @@ -1466,10 +1524,13 @@ mail_empty_trash (EMailSession *session, mail_msg_slow_ordered_push (m); } -/* ** Execute Shell Command ***************************************************** */ +/* ** Execute Shell Command ************************************************ */ void -mail_execute_shell_command (CamelFilterDriver *driver, gint argc, gchar **argv, gpointer data) +mail_execute_shell_command (CamelFilterDriver *driver, + gint argc, + gchar **argv, + gpointer data) { if (argc <= 0) return; @@ -1477,7 +1538,7 @@ mail_execute_shell_command (CamelFilterDriver *driver, gint argc, gchar **argv, g_spawn_async (NULL, argv, NULL, 0, NULL, data, NULL, NULL); } -/* ---------------------------------------------------------------------------------- */ +/* ------------------------------------------------------------------------- */ struct _disconnect_msg { MailMsg base; diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index a6eb037520..dc3c9ed7ee 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -954,7 +954,9 @@ refresh_folders_exec (struct _refresh_folders_msg *m, gulong handler_id = 0; if (cancellable) - handler_id = g_signal_connect (m->info->cancellable, "cancelled", G_CALLBACK (main_op_cancelled_cb), cancellable); + handler_id = g_signal_connect ( + m->info->cancellable, "cancelled", + G_CALLBACK (main_op_cancelled_cb), cancellable); get_folders (m->store, m->folders, m->finfo); @@ -978,7 +980,9 @@ refresh_folders_exec (struct _refresh_folders_msg *m, break; if (m->info->state != SEND_CANCELLED) - g_signal_emit_by_name (m->info->cancellable, "status", _("Updating..."), 100 * i / m->folders->len); + g_signal_emit_by_name ( + m->info->cancellable, "status", + _("Updating..."), 100 * i / m->folders->len); } if (cancellable) diff --git a/mail/mail-tools.c b/mail/mail-tools.c index 107a3ac9ed..7e4441a8de 100644 --- a/mail/mail-tools.c +++ b/mail/mail-tools.c @@ -150,9 +150,9 @@ mail_tool_generate_forward_subject (CamelMimeMessage *msg) if (strlen (subject) < max_subject_length) { fwd_subj = g_strdup_printf ("[Fwd: %s]", subject); } else { - /* We can't use %.*s because it depends on the locale being C/POSIX - or UTF-8 to work correctly in glibc */ - /*fwd_subj = g_strdup_printf ("[Fwd: %.*s...]", max_subject_length, subject);*/ + /* We can't use %.*s because it depends on the + * locale being C/POSIX or UTF-8 to work correctly + * in glibc. */ fwd_subj = g_malloc (max_subject_length + 11); memcpy (fwd_subj, "[Fwd: ", 6); memcpy (fwd_subj + 6, subject, max_subject_length); diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index de39ca53cd..e726433897 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -467,22 +467,26 @@ mail_vfolder_add_folder (EMailSession *session, if (remote) { if ((link = mv_find_folder (source_folders_remote, session, uri)) != NULL) { g_free (link->data); - source_folders_remote = g_list_remove_link (source_folders_remote, link); + source_folders_remote = g_list_remove_link ( + source_folders_remote, link); } } else { if ((link = mv_find_folder (source_folders_local, session, uri)) != NULL) { g_free (link->data); - source_folders_local = g_list_remove_link (source_folders_local, link); + source_folders_local = g_list_remove_link ( + source_folders_local, link); } } } else if (!is_ignore) { /* we ignore drafts/sent/outbox here */ if (remote) { if (mv_find_folder (source_folders_remote, session, uri) == NULL) - source_folders_remote = g_list_prepend (source_folders_remote, g_strdup (uri)); + source_folders_remote = g_list_prepend ( + source_folders_remote, g_strdup (uri)); } else { if (mv_find_folder (source_folders_local, session, uri) == NULL) - source_folders_local = g_list_prepend (source_folders_local, g_strdup (uri)); + source_folders_local = g_list_prepend ( + source_folders_local, g_strdup (uri)); } } @@ -1115,8 +1119,12 @@ vfolder_load_storage (EMailBackend *backend) g_free (xmlfile); g_free (user); - g_signal_connect(context, "rule_added", G_CALLBACK(context_rule_added), context); - g_signal_connect(context, "rule_removed", G_CALLBACK(context_rule_removed), context); + g_signal_connect ( + context, "rule_added", + G_CALLBACK (context_rule_added), context); + g_signal_connect ( + context, "rule_removed", + G_CALLBACK (context_rule_removed), context); /* load store to mail component */ e_mail_store_add (session, vfolder_store, _("Search Folders")); @@ -1299,7 +1307,8 @@ new_rule_clicked (GtkWidget *w, gint button, gpointer data) return; } - if (e_rule_context_find_rule ((ERuleContext *) context, rule->name, rule->source)) { + if (e_rule_context_find_rule ( + (ERuleContext *) context, rule->name, rule->source)) { e_alert_run_dialog_for_args ( GTK_WINDOW (w), "mail:vfolder-notunique", rule->name, NULL); @@ -1323,7 +1332,8 @@ new_rule_changed_cb (EFilterRule *rule, GtkDialog *dialog) g_return_if_fail (rule != NULL); g_return_if_fail (dialog != NULL); - gtk_dialog_set_response_sensitive (dialog, GTK_RESPONSE_OK, rule->parts != NULL); + gtk_dialog_set_response_sensitive ( + dialog, GTK_RESPONSE_OK, rule->parts != NULL); } EFilterPart * diff --git a/modules/calendar/e-cal-shell-view.c b/modules/calendar/e-cal-shell-view.c index 20f30c12c4..b325160ded 100644 --- a/modules/calendar/e-cal-shell-view.c +++ b/modules/calendar/e-cal-shell-view.c @@ -252,27 +252,31 @@ is_delegated (icalcomponent *icalcomp, const gchar *user_email) prop = get_attendee_prop (icalcomp, user_email); - if (prop) { - param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDTO_PARAMETER); - if (param) + if (prop != NULL) { + param = icalproperty_get_first_parameter ( + prop, ICAL_DELEGATEDTO_PARAMETER); + if (param != NULL) delto = icalparameter_get_delegatedto (param); } else return FALSE; prop = get_attendee_prop (icalcomp, itip_strip_mailto (delto)); - if (prop) { + if (prop != NULL) { const gchar *delfrom = NULL; icalparameter_partstat status = ICAL_PARTSTAT_NONE; - param = icalproperty_get_first_parameter (prop, ICAL_DELEGATEDFROM_PARAMETER); - if (param) + param = icalproperty_get_first_parameter ( + prop, ICAL_DELEGATEDFROM_PARAMETER); + if (param != NULL) delfrom = icalparameter_get_delegatedfrom (param); - param = icalproperty_get_first_parameter (prop, ICAL_PARTSTAT_PARAMETER); - if (param) + param = icalproperty_get_first_parameter ( + prop, ICAL_PARTSTAT_PARAMETER); + if (param != NULL) status = icalparameter_get_partstat (param); - if ((delfrom && *delfrom) && g_str_equal (itip_strip_mailto (delfrom), user_email) - && status != ICAL_PARTSTAT_DECLINED) + if ((delfrom != NULL && *delfrom != '\0') && + g_str_equal (itip_strip_mailto (delfrom), + user_email) && status != ICAL_PARTSTAT_DECLINED) return TRUE; } diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 01ceca277e..32f8058c2e 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -326,10 +326,11 @@ mail_shell_view_popup_event_cb (EMailShellView *mail_shell_view, const gchar *uri) { EMailShellContent *mail_shell_content; - EMFormatHTML *html_formatter; + EMFormatHTML *formatter; EShellView *shell_view; EMailReader *reader; EMailView *mail_view; + EWebView *web_view; GtkMenu *menu; if (uri != NULL) @@ -339,9 +340,10 @@ mail_shell_view_popup_event_cb (EMailShellView *mail_shell_view, mail_view = e_mail_shell_content_get_mail_view (mail_shell_content); reader = E_MAIL_READER (mail_view); - html_formatter = e_mail_reader_get_formatter (reader); + formatter = e_mail_reader_get_formatter (reader); + web_view = em_format_html_get_web_view (formatter); - if (html_formatter && e_web_view_get_cursor_image (em_format_html_get_web_view (html_formatter)) != NULL) + if (e_web_view_get_cursor_image (web_view) != NULL) return FALSE; menu = e_mail_reader_get_popup_menu (reader); diff --git a/modules/offline-alert/evolution-offline-alert.error b/modules/offline-alert/evolution-offline-alert.error deleted file mode 100644 index 13ba4ff238..0000000000 --- a/modules/offline-alert/evolution-offline-alert.error +++ /dev/null @@ -1,13 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<error-list domain="offline-alert"> - <error type="info" id="offline"> - <primary>Evolution is currently offline.</primary> - <secondary>Click 'Work Online' to return to online mode.</secondary> - <button response="GTK_RESPONSE_OK" label="_Dismiss"></button> - </error> - <error type="info" id="no-network"> - <primary>Evolution is currently offline due to a network outage.</primary> - <secondary>Evolution will return to online mode once a network connection is established.</secondary> - <button response="GTK_RESPONSE_OK" label="_Dismiss"></button> - </error> -</error-list>
\ No newline at end of file diff --git a/modules/plugin-lib/e-plugin-lib.c b/modules/plugin-lib/e-plugin-lib.c index 33ba699258..1bd7190a68 100644 --- a/modules/plugin-lib/e-plugin-lib.c +++ b/modules/plugin-lib/e-plugin-lib.c @@ -46,6 +46,7 @@ plugin_lib_loadmodule (EPlugin *plugin) { EPluginLib *plugin_lib = E_PLUGIN_LIB (plugin); EPluginLibEnableFunc enable; + gboolean found_symbol; if (plugin_lib->module != NULL) return 0; @@ -56,9 +57,13 @@ plugin_lib_loadmodule (EPlugin *plugin) return -1; } - if ((plugin_lib->module = g_module_open (plugin_lib->location, 0)) == NULL) { + plugin_lib->module = g_module_open (plugin_lib->location, 0); + + if (plugin_lib->module == NULL) { plugin->enabled = FALSE; - g_warning ("can't load plugin '%s': %s", plugin_lib->location, g_module_error ()); + g_warning ( + "can't load plugin '%s': %s", + plugin_lib->location, g_module_error ()); return -1; } @@ -66,7 +71,12 @@ plugin_lib_loadmodule (EPlugin *plugin) if (!plugin->enabled) return 0; - if (g_module_symbol (plugin_lib->module, "e_plugin_lib_enable", (gpointer)&enable)) { + found_symbol = g_module_symbol ( + plugin_lib->module, + "e_plugin_lib_enable", + (gpointer) &enable); + + if (found_symbol) { if (enable (plugin, TRUE) != 0) { plugin->enabled = FALSE; g_module_close (plugin_lib->module); diff --git a/modules/plugin-mono/e-plugin-mono.c b/modules/plugin-mono/e-plugin-mono.c index e2d6756af4..20a6dcff56 100644 --- a/modules/plugin-mono/e-plugin-mono.c +++ b/modules/plugin-mono/e-plugin-mono.c @@ -161,7 +161,9 @@ plugin_mono_invoke (EPlugin *plugin, }*/ while ((mono_method = mono_class_get_methods (priv->class, &iter))) { - g_print ("\n\a Method name is : <%s>\n\a", mono_method_get_name (mono_method)); + g_print ( + "\n\a Method name is : <%s>\n\a", + mono_method_get_name (mono_method)); } //mono_class_get_method_from_name m = mono_class_get_method_from_name (priv->class, name, -1); diff --git a/plugins/bbdb/gaimbuddies.c b/plugins/bbdb/gaimbuddies.c index 3e6f344ed0..4056793963 100644 --- a/plugins/bbdb/gaimbuddies.c +++ b/plugins/bbdb/gaimbuddies.c @@ -117,7 +117,8 @@ bbdb_sync_buddy_list_check (void) /* Reprocess the buddy list if it's been updated. */ gconf = gconf_client_get_default (); - last_sync_str = gconf_client_get_string (gconf, GCONF_KEY_GAIM_LAST_SYNC_TIME, NULL); + 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, "")) last_sync_time = (time_t) 0; else @@ -162,8 +163,10 @@ store_last_sync_idle_cb (gpointer data) md5 = get_md5_as_string (blist_path); gconf = gconf_client_get_default (); - gconf_client_set_string (gconf, GCONF_KEY_GAIM_LAST_SYNC_TIME, last_sync_time, NULL); - gconf_client_set_string (gconf, GCONF_KEY_GAIM_LAST_SYNC_MD5, md5, NULL); + gconf_client_set_string ( + gconf, GCONF_KEY_GAIM_LAST_SYNC_TIME, last_sync_time, NULL); + gconf_client_set_string ( + gconf, GCONF_KEY_GAIM_LAST_SYNC_MD5, md5, NULL); g_object_unref (G_OBJECT (gconf)); diff --git a/plugins/dbx-import/dbx-importer.c b/plugins/dbx-import/dbx-importer.c index c2ca34cdb7..c9ecca9127 100644 --- a/plugins/dbx-import/dbx-importer.c +++ b/plugins/dbx-import/dbx-importer.c @@ -253,8 +253,10 @@ org_gnome_evolution_readdbx_getwidget (EImport *ei, _("Select folder to import into")); gtk_label_set_mnemonic_widget (label, w); - em_folder_selection_button_set_selection ((EMFolderSelectionButton *) w, select_uri); - folder_selected ((EMFolderSelectionButton *) w, (EImportTargetURI *) target); + em_folder_selection_button_set_selection ( + EM_FOLDER_SELECTION_BUTTON (w), select_uri); + folder_selected ( + EM_FOLDER_SELECTION_BUTTON (w), (EImportTargetURI *) target); g_signal_connect (w, "selected", G_CALLBACK(folder_selected), target); gtk_box_pack_start ((GtkBox *) hbox, w, FALSE, TRUE, 6); diff --git a/plugins/external-editor/external-editor.c b/plugins/external-editor/external-editor.c index 5ca435a0e6..48fd243873 100644 --- a/plugins/external-editor/external-editor.c +++ b/plugins/external-editor/external-editor.c @@ -49,16 +49,24 @@ #define d(x) -#define EDITOR_GCONF_KEY_COMMAND "/apps/evolution/eplugin/external-editor/editor-command" -#define EDITOR_GCONF_KEY_IMMEDIATE "/apps/evolution/eplugin/external-editor/launch-on-key-press" - -gboolean e_plugin_ui_init (GtkUIManager *manager, EMsgComposer *composer); -GtkWidget * e_plugin_lib_get_configure_widget (EPlugin *epl); -static void ee_editor_command_changed (GtkWidget *textbox); -static void ee_editor_immediate_launch_changed (GtkWidget *checkbox); -static void async_external_editor (EMsgComposer *composer); -static gboolean editor_running (void); -static gboolean key_press_cb (GtkWidget * widget, GdkEventKey * event, EMsgComposer *composer); +#define EDITOR_GCONF_KEY_COMMAND \ + "/apps/evolution/eplugin/external-editor/editor-command" +#define EDITOR_GCONF_KEY_IMMEDIATE \ + "/apps/evolution/eplugin/external-editor/launch-on-key-press" + +gboolean e_plugin_ui_init (GtkUIManager *manager, + EMsgComposer *composer); +GtkWidget * e_plugin_lib_get_configure_widget + (EPlugin *epl); +static void ee_editor_command_changed + (GtkWidget *textbox); +static void ee_editor_immediate_launch_changed + (GtkWidget *checkbox); +static void async_external_editor (EMsgComposer *composer); +static gboolean editor_running (void); +static gboolean key_press_cb (GtkWidget *widget, + GdkEventKey *event, + EMsgComposer *composer); /* used to track when the external editor is active */ static GThread *editor_thread; @@ -133,12 +141,16 @@ e_plugin_lib_get_configure_widget (EPlugin *epl) gtk_box_pack_start (GTK_BOX (vbox), help, FALSE, FALSE, 0); gtk_box_pack_start (GTK_BOX (vbox), checkbox, FALSE, FALSE, 0); - g_signal_connect (textbox, "changed", G_CALLBACK(ee_editor_command_changed), textbox); + g_signal_connect ( + textbox, "changed", + G_CALLBACK (ee_editor_command_changed), textbox); - g_signal_connect (checkbox, "toggled", - G_CALLBACK (ee_editor_immediate_launch_changed), checkbox); + g_signal_connect ( + checkbox, "toggled", + G_CALLBACK (ee_editor_immediate_launch_changed), checkbox); gtk_widget_show_all (vbox); + return vbox; } @@ -277,7 +289,8 @@ async_external_editor (EMsgComposer *composer) } gconf = gconf_client_get_default (); - editor_cmd = gconf_client_get_string (gconf, EDITOR_GCONF_KEY_COMMAND, NULL); + editor_cmd = gconf_client_get_string ( + gconf, EDITOR_GCONF_KEY_COMMAND, NULL); if (!editor_cmd) { if (!(editor_cmd = g_strdup (g_getenv ("EDITOR"))) ) /* Make gedit the default external editor, @@ -288,21 +301,27 @@ async_external_editor (EMsgComposer *composer) g_object_unref (gconf); if (g_strrstr (editor_cmd, "vim") != NULL - && gtk_html_get_cursor_pos (gtkhtml_editor_get_html (GTKHTML_EDITOR (composer)), &position, &offset) + && gtk_html_get_cursor_pos ( + gtkhtml_editor_get_html ( + GTKHTML_EDITOR (composer)), &position, &offset) && position >= 0 && offset >= 0) { gchar *tmp = editor_cmd; gint lineno; gboolean set_nofork; set_nofork = g_strrstr (editor_cmd, "gvim") != NULL; - /* increment 1 so that entering vim insert mode places you in the same - * entry position you were at in the html */ + /* Increment 1 so that entering vim insert mode places you + * in the same entry position you were at in the html. */ offset++; /* calculate the line number that the cursor is in */ lineno = numlines (content, position); - editor_cmd = g_strdup_printf ("%s \"+call cursor(%d,%d)\"%s%s", tmp, lineno, offset, set_nofork ? " " : "", set_nofork ? "--nofork" : ""); + editor_cmd = g_strdup_printf ( + "%s \"+call cursor(%d,%d)\"%s%s", + tmp, lineno, offset, + set_nofork ? " " : "", + set_nofork ? "--nofork" : ""); g_free (tmp); } @@ -372,7 +391,8 @@ static void launch_editor (GtkAction *action, EMsgComposer *composer) disable_composer (composer); - editor_thread = g_thread_create ((GThreadFunc) async_external_editor, composer, FALSE, NULL); + editor_thread = g_thread_create ( + (GThreadFunc) async_external_editor, composer, FALSE, NULL); } static GtkActionEntry entries[] = { @@ -436,7 +456,9 @@ static gboolean delete_cb (GtkWidget *widget, EMsgComposer *composer) { if (editor_running ()) { - e_alert_run_dialog_for_args (NULL, "org.gnome.evolution.plugins.external-editor:editor-still-running", NULL); + e_alert_run_dialog_for_args ( + NULL, "org.gnome.evolution.plugins." + "external-editor:editor-still-running", NULL); return TRUE; } diff --git a/plugins/save-calendar/format-handler.h b/plugins/save-calendar/format-handler.h index 7b5bf286a7..7c697725cd 100644 --- a/plugins/save-calendar/format-handler.h +++ b/plugins/save-calendar/format-handler.h @@ -42,7 +42,10 @@ struct _FormatHandler gpointer data; - void (*save) (FormatHandler *handler, ESourceSelector *selector, ECalSourceType type, gchar *dest_uri); + void (*save) (FormatHandler *handler, + ESourceSelector *selector, + ECalSourceType type, + gchar *dest_uri); }; FormatHandler *csv_format_handler_new (void); diff --git a/plugins/save-calendar/save-calendar.c b/plugins/save-calendar/save-calendar.c index facb915566..8bf0067b79 100644 --- a/plugins/save-calendar/save-calendar.c +++ b/plugins/save-calendar/save-calendar.c @@ -81,8 +81,10 @@ on_type_combobox_changed (GtkComboBox *combobox, gpointer data) GtkTreeIter iter; GtkTreeModel *model = gtk_combo_box_get_model (combobox); - gtk_container_foreach (GTK_CONTAINER (extra_widget), - extra_widget_foreach_hide, g_object_get_data (G_OBJECT (combobox), "format-box")); + gtk_container_foreach ( + GTK_CONTAINER (extra_widget), + extra_widget_foreach_hide, + g_object_get_data (G_OBJECT (combobox), "format-box")); gtk_combo_box_get_active_iter (combobox, &iter); diff --git a/shell/main.c b/shell/main.c index 62d19259aa..e6ba19a3e4 100644 --- a/shell/main.c +++ b/shell/main.c @@ -393,7 +393,8 @@ static GOptionEntry entries[] = { N_("Import URIs or file names given as rest of arguments."), NULL }, { "quit", 'q', 0, G_OPTION_ARG_NONE, &quit, N_("Request a running Evolution process to quit"), NULL }, - { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, &remaining_args, NULL, NULL }, + { G_OPTION_REMAINING, 0, 0, G_OPTION_ARG_STRING_ARRAY, + &remaining_args, NULL, NULL }, { NULL } }; diff --git a/smclient/eggsmclient-xsmp.c b/smclient/eggsmclient-xsmp.c index c246e17081..fd6f83d6d2 100644 --- a/smclient/eggsmclient-xsmp.c +++ b/smclient/eggsmclient-xsmp.c @@ -287,9 +287,9 @@ sm_client_xsmp_set_initial_properties (gpointer user_data) if (desktop_file) { - set_properties (xsmp, - string_prop ("_GSM_DesktopFile", egg_desktop_file_get_source (desktop_file)), - NULL); + set_properties ( + xsmp, string_prop ("_GSM_DesktopFile", + egg_desktop_file_get_source (desktop_file)), NULL); } update_pending_events (xsmp); diff --git a/smime/lib/e-asn1-object.c b/smime/lib/e-asn1-object.c index eb8863f46e..144f53db9b 100644 --- a/smime/lib/e-asn1-object.c +++ b/smime/lib/e-asn1-object.c @@ -238,7 +238,9 @@ build_from_der (EASN1Object *parent, gchar *data, gchar *end) return FALSE; } data++; - len = get_der_item_length ((guchar *) data, (guchar *) end, &bytesUsed, &indefinite); + len = get_der_item_length ( + (guchar *) data, (guchar *) end, + &bytesUsed, &indefinite); data += bytesUsed; if ((len < 0) || ((data+len) > end)) return FALSE; diff --git a/smime/lib/e-cert.c b/smime/lib/e-cert.c index e4e32d4948..6d00ffb20c 100644 --- a/smime/lib/e-cert.c +++ b/smime/lib/e-cert.c @@ -1036,12 +1036,14 @@ process_name (CERTName *name, gchar **value) SECITEM_FreeItem (decodeItem, PR_TRUE); - /* Translators: This string is used in Certificate details for fields like Issuer - or Subject, which shows the field name on the left and its respective value - on the right, both as stored in the certificate itself. You probably do not - need to change this string, unless changing the order of name and value. - As a result example: "OU = VeriSign Trust Network" - */ + /* Translators: This string is used in Certificate + * details for fields like Issuer or Subject, which + * shows the field name on the left and its respective + * value on the right, both as stored in the + * certificate itself. You probably do not need to + * change this string, unless changing the order of + * name and value. As a result example: + * "OU = VeriSign Trust Network" */ temp = g_strdup_printf (_("%s = %s"), type, avavalue->str); g_string_append (final_string, temp); diff --git a/widgets/menus/gal-view-instance-save-as-dialog.h b/widgets/menus/gal-view-instance-save-as-dialog.h index a316c9acfb..b5f9ac56e8 100644 --- a/widgets/menus/gal-view-instance-save-as-dialog.h +++ b/widgets/menus/gal-view-instance-save-as-dialog.h @@ -77,9 +77,11 @@ struct _GalViewInstanceSaveAsDialogClass { GtkDialogClass parent_class; }; -GType gal_view_instance_save_as_dialog_get_type (void); -GtkWidget * gal_view_instance_save_as_dialog_new (GalViewInstance *instance); -void gal_view_instance_save_as_dialog_save (GalViewInstanceSaveAsDialog *dialog); +GType gal_view_instance_save_as_dialog_get_type (void); +GtkWidget * gal_view_instance_save_as_dialog_new + (GalViewInstance *instance); +void gal_view_instance_save_as_dialog_save + (GalViewInstanceSaveAsDialog *dialog); G_END_DECLS diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c index f58259bdd8..ad7b95bfd4 100644 --- a/widgets/misc/e-calendar-item.c +++ b/widgets/misc/e-calendar-item.c @@ -2124,7 +2124,12 @@ e_calendar_item_button_press (ECalendarItem *calitem, day += calitem->selection_start_day - tmp_start_day; /* keep same count of days selected */ - add_days = e_calendar_item_get_inclusive_days (calitem, calitem->selection_start_month_offset, calitem->selection_start_day, calitem->selection_end_month_offset, calitem->selection_end_day) - 1; + add_days = e_calendar_item_get_inclusive_days ( + calitem, + calitem->selection_start_month_offset, + calitem->selection_start_day, + calitem->selection_end_month_offset, + calitem->selection_end_day) - 1; } calitem->selection_set = TRUE; @@ -2153,8 +2158,10 @@ e_calendar_item_button_press (ECalendarItem *calitem, round_up_end = TRUE; } - /* Don't round up or down if we can't select a week or more. Or when keeping week days */ - if (calitem->max_days_selected < 7 || (all_week && calitem->keep_wdays_on_weeknum_click)) { + /* Don't round up or down if we can't select a week or more, + * or when keeping week days. */ + if (calitem->max_days_selected < 7 || + (all_week && calitem->keep_wdays_on_weeknum_click)) { round_down_start = FALSE; round_up_end = FALSE; } @@ -2655,7 +2662,8 @@ e_calendar_item_set_first_month (ECalendarItem *calitem, /* Make sure the selection will be displayed. */ if (calitem->selection_start_month_offset < 0 || calitem->selection_start_month_offset >= num_months) { - calitem->selection_end_month_offset -= calitem->selection_start_month_offset; + calitem->selection_end_month_offset -= + calitem->selection_start_month_offset; calitem->selection_start_month_offset = 0; } diff --git a/widgets/misc/e-calendar.c b/widgets/misc/e-calendar.c index 9332345875..b0e8cbe12f 100644 --- a/widgets/misc/e-calendar.c +++ b/widgets/misc/e-calendar.c @@ -658,7 +658,8 @@ e_calendar_set_focusable (ECalendar *cal, gboolean focusable) gtk_widget_set_can_focus (next_widget, TRUE); } else { - if (gtk_widget_has_focus (GTK_WIDGET (cal)) || e_calendar_button_has_focus (cal)) { + if (gtk_widget_has_focus (GTK_WIDGET (cal)) || + e_calendar_button_has_focus (cal)) { toplevel = gtk_widget_get_toplevel (widget); if (toplevel) gtk_widget_grab_focus (toplevel); diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 05832f74af..e2d0fe7bbf 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -286,7 +286,8 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) } else canvas->new_current_item = NULL; - if ((canvas->new_current_item == canvas->current_item) && !canvas->left_grabbed_item) + if ((canvas->new_current_item == canvas->current_item) && + !canvas->left_grabbed_item) return retval; /* current item did not change */ /* Synthesize events for old and new current items */ diff --git a/widgets/misc/e-canvas.h b/widgets/misc/e-canvas.h index 97055ab5ff..72a2e47f54 100644 --- a/widgets/misc/e-canvas.h +++ b/widgets/misc/e-canvas.h @@ -72,12 +72,6 @@ enum { E_CANVAS_ITEM_DESCENDENT_NEEDS_REFLOW = 1 << 14 }; -enum { - E_CANVAS_ITEM_SELECTION_SELECT = 1 << 0, /* TRUE = select. FALSE = unselect. */ - E_CANVAS_ITEM_SELECTION_CURSOR = 1 << 1, /* TRUE = has become cursor. FALSE = not cursor. */ - E_CANVAS_ITEM_SELECTION_DELETE_DATA = 1 << 2 -}; - typedef struct { GnomeCanvasItem *item; gpointer id; diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 881f1f332c..7fb0f8cd79 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -1944,23 +1944,26 @@ e_date_edit_update_date_entry (EDateEdit *dedit) /* This sets the text in the time entry according to the current settings. */ static void -e_date_edit_update_time_entry (EDateEdit *dedit) +e_date_edit_update_time_entry (EDateEdit *dedit) { EDateEditPrivate *priv; + GtkComboBox *combo_box; GtkWidget *child; gchar buffer[40]; struct tm tmp_tm = { 0 }; priv = dedit->priv; + combo_box = GTK_COMBO_BOX (priv->time_combo); child = gtk_bin_get_child (GTK_BIN (priv->time_combo)); if (priv->time_set_to_none || !priv->time_is_valid) { - gtk_combo_box_set_active (GTK_COMBO_BOX (priv->time_combo), -1); + gtk_combo_box_set_active (combo_box, -1); gtk_entry_set_text (GTK_ENTRY (child), ""); } else { GtkTreeModel *model; GtkTreeIter iter; + gboolean valid; gchar *b; /* Set these to reasonable values just in case. */ @@ -1975,15 +1978,19 @@ e_date_edit_update_time_entry (EDateEdit *dedit) tmp_tm.tm_isdst = -1; if (priv->use_24_hour_format) - /* This is a strftime() format. %H = hour (0-23), %M = minute. */ - e_time_format_time (&tmp_tm, 1, 0, buffer, sizeof (buffer)); + /* This is a strftime() format. + * %H = hour (0-23), %M = minute. */ + e_time_format_time ( + &tmp_tm, 1, 0, buffer, sizeof (buffer)); else - /* This is a strftime() format. %I = hour (1-12), - * %M = minute, %p = am/pm string. */ - e_time_format_time (&tmp_tm, 0, 0, buffer, sizeof (buffer)); - - /* For 12-hour am/pm format, we want space padding, not zero padding. This - * can be done with strftime's %l, but it's a potentially unportable extension. */ + /* This is a strftime() format. + * %I = hour (1-12), %M = minute, %p = am/pm. */ + e_time_format_time ( + &tmp_tm, 0, 0, buffer, sizeof (buffer)); + + /* For 12-hour am/pm format, we want space padding, not + * zero padding. This can be done with strftime's %l, + * but it's a potentially unportable extension. */ if (!priv->use_24_hour_format && buffer[0] == '0') buffer[0] = ' '; @@ -1994,28 +2001,31 @@ e_date_edit_update_time_entry (EDateEdit *dedit) while (*b == ' ') b++; - model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->time_combo)); - if (gtk_tree_model_get_iter_first (model, &iter)) { - do { - gchar *text = NULL; + model = gtk_combo_box_get_model (combo_box); + valid = gtk_tree_model_get_iter_first (model, &iter); + + while (valid) { + gchar *text = NULL; - gtk_tree_model_get (model, &iter, 0, &text, -1); - if (text) { - gchar *t = text; + gtk_tree_model_get (model, &iter, 0, &text, -1); + if (text) { + gchar *t = text; - /* truncate left spaces */ - while (*t == ' ') - t++; + /* truncate left spaces */ + while (*t == ' ') + t++; - if (strcmp (b, t) == 0) { - gtk_combo_box_set_active_iter (GTK_COMBO_BOX (priv->time_combo), &iter); - g_free (text); - break; - } + if (strcmp (b, t) == 0) { + gtk_combo_box_set_active_iter ( + combo_box, &iter); + g_free (text); + break; } + } + + g_free (text); - g_free (text); - } while (gtk_tree_model_iter_next (model, &iter)); + valid = gtk_tree_model_iter_next (model, &iter); } } diff --git a/widgets/misc/e-import-assistant.c b/widgets/misc/e-import-assistant.c index a87f7ce040..521e8fb76b 100644 --- a/widgets/misc/e-import-assistant.c +++ b/widgets/misc/e-import-assistant.c @@ -1027,7 +1027,8 @@ set_import_uris (EImportAssistant *assistant, gchar **uris) furi = g_filename_to_uri (filename, NULL, NULL); target = e_import_target_new_uri (priv->import, furi, NULL); - importers = e_import_get_importers (priv->import, (EImportTarget *) target); + importers = e_import_get_importers ( + priv->import, (EImportTarget *) target); if (importers != NULL) { /* there is at least one importer which can be used, @@ -1291,38 +1292,48 @@ import_assistant_construct (EImportAssistant *import_assistant) gtk_widget_show (page); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Evolution Import Assistant")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_INTRO); + gtk_assistant_set_page_title ( + assistant, page, _("Evolution Import Assistant")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_INTRO); gtk_assistant_set_page_complete (assistant, page, TRUE); /* Intelligent or direct import page */ page = import_assistant_type_page_init (import_assistant); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Importer Type")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_title ( + assistant, page, _("Importer Type")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_CONTENT); gtk_assistant_set_page_complete (assistant, page, TRUE); /* Intelligent importer source page */ page = import_assistant_selection_page_init (import_assistant); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Select Information to Import")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_title ( + assistant, page, _("Select Information to Import")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* File selection and file type page */ page = import_assistant_file_page_init (import_assistant); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Select a File")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_title ( + assistant, page, _("Select a File")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* File destination page */ page = import_assistant_destination_page_init (import_assistant); gtk_assistant_append_page (assistant, page); - gtk_assistant_set_page_title (assistant, page, _("Import Location")); - gtk_assistant_set_page_type (assistant, page, GTK_ASSISTANT_PAGE_CONTENT); + gtk_assistant_set_page_title ( + assistant, page, _("Import Location")); + gtk_assistant_set_page_type ( + assistant, page, GTK_ASSISTANT_PAGE_CONTENT); /* Finish page */ page = gtk_label_new (""); diff --git a/widgets/misc/e-popup-menu.h b/widgets/misc/e-popup-menu.h index 2af3183933..24a8fa6022 100644 --- a/widgets/misc/e-popup-menu.h +++ b/widgets/misc/e-popup-menu.h @@ -32,7 +32,9 @@ G_BEGIN_DECLS #define E_POPUP_SEPARATOR { (gchar *) "", NULL, (NULL), NULL, 0 } #define E_POPUP_TERMINATOR { NULL, NULL, (NULL), NULL, 0 } -#define E_POPUP_ITEM(name,fn,disable_mask) { (gchar *) (name), NULL, (fn), NULL, (disable_mask), NULL, NULL, 0, 0, 0, 0 } +#define E_POPUP_ITEM(name,fn,disable_mask) \ + { (gchar *) (name), NULL, (fn), NULL, \ + (disable_mask), NULL, NULL, 0, 0, 0, 0 } typedef struct _EPopupMenu EPopupMenu; @@ -55,15 +57,15 @@ struct _EPopupMenu { guint use_custom_closure : 1; }; -GtkMenu *e_popup_menu_create (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - void *default_closure); -GtkMenu *e_popup_menu_create_with_domain (EPopupMenu *menu_list, - guint32 disable_mask, - guint32 hide_mask, - void *default_closure, - const gchar *domain); +GtkMenu * e_popup_menu_create (EPopupMenu *menu_list, + guint32 disable_mask, + guint32 hide_mask, + gpointer default_closure); +GtkMenu * e_popup_menu_create_with_domain (EPopupMenu *menu_list, + guint32 disable_mask, + guint32 hide_mask, + gpointer default_closure, + const gchar *domain); G_END_DECLS diff --git a/widgets/misc/e-searching-tokenizer.c b/widgets/misc/e-searching-tokenizer.c index 0955779534..6d34b6d8f0 100644 --- a/widgets/misc/e-searching-tokenizer.c +++ b/widgets/misc/e-searching-tokenizer.c @@ -51,7 +51,8 @@ G_DEFINE_TYPE ( /* Utility functions */ -/* This is faster and safer than glib2's utf8 abomination, but isn't exported from camel as yet */ +/* This is faster and safer than glib2's utf8 abomination, + * but isn't exported from camel as yet */ static inline guint32 camel_utf8_getc (const guchar **ptr) { @@ -89,7 +90,8 @@ loop: return v; } -/* note: our tags of interest are 7 bit ascii, only, no need to do any fancy utf8 stuff */ +/* note: our tags of interest are 7 bit ascii + * only no need to do any fancy utf8 stuff */ /* tags should be upper case if this list gets longer than 10 entries, consider binary search */ static const gchar *ignored_tags[] = { @@ -246,7 +248,10 @@ build_trie (gint nocase, gint len, guchar **words) q->final = 0; if (state_depth_max < depth) { state_depth_max += 64; - state_depth = g_realloc (state_depth, sizeof (*state_depth[0])*state_depth_max); + state_depth = g_realloc ( + state_depth, + sizeof (*state_depth[0]) * + state_depth_max); } if (state_depth_size < depth) { state_depth[depth] = NULL; @@ -369,14 +374,20 @@ struct _searcher { }; static void -searcher_set_tokenfunc (struct _searcher *s, gchar *(*next)(), gpointer data) +searcher_set_tokenfunc (struct _searcher *s, + gchar *(*next)(), + gpointer data) { s->next_token = next; s->next_data = data; } static struct _searcher * -searcher_new (gint flags, gint argc, guchar **argv, const gchar *tags, const gchar *tage) +searcher_new (gint flags, + gint argc, + guchar **argv, + const gchar *tags, + const gchar *tage) { gint i, m; struct _searcher *s; @@ -457,10 +468,8 @@ output_token (struct _searcher *s, struct _token *token) if (token->tok[0] == TAG_ESCAPE) { if (token->offset >= s->offout) { - d (printf("moving tag token '%s' from input to output\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); g_queue_push_tail (&s->output, token); } else { - d (printf("discarding tag token '%s' from input\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); free_token (token); } } else { @@ -470,11 +479,9 @@ output_token (struct _searcher *s, struct _token *token) pre = s->offout - token->offset; if (pre>0) memmove (token->tok, token->tok+pre, left+1); - d (printf("adding partial remaining/failed '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); s->offout = offend; g_queue_push_tail (&s->output, token); } else { - d (printf("discarding whole token '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); free_token (token); } } @@ -516,20 +523,18 @@ output_match (struct _searcher *s, guint start, guint end) return; } - d (printf("start in token '%s'\n", starttoken->tok[0]==TAG_ESCAPE?starttoken->tok+1:starttoken->tok)); - d (printf("end in token '%s'\n", endtoken->tok[0]==TAG_ESCAPE?endtoken->tok+1:endtoken->tok)); - /* output pending stuff that didn't match afterall */ while ((struct _token *) g_queue_peek_head (&s->input) != starttoken) { token = g_queue_pop_head (&s->input); - d (printf("appending failed match '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); output_token (s, token); } /* output any pre-match text */ if (s->offout < start) { - token = append_token (&s->output, starttoken->tok + (s->offout-starttoken->offset), start-s->offout); - d (printf("adding pre-match text '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); + token = append_token ( + &s->output, starttoken->tok + + (s->offout-starttoken->offset), + start-s->offout); s->offout = start; } @@ -545,15 +550,16 @@ output_match (struct _searcher *s, guint start, guint end) if (starttoken != endtoken) { while ((struct _token *) g_queue_peek_head (&s->input) != endtoken) { token = g_queue_pop_head (&s->input); - d (printf("appending (partial) match node (head) '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); output_token (s, token); } } /* any remaining partial content */ if (s->offout < end) { - token = append_token (&s->output, endtoken->tok+(s->offout-endtoken->offset), end-s->offout); - d (printf("appending (partial) match node (tail) '%s'\n", token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); + token = append_token ( + &s->output, endtoken->tok + + (s->offout-endtoken->offset), + end-s->offout); s->offout = end; } @@ -608,7 +614,8 @@ merge_subpending (struct _searcher *s, gint offstart, gint offend) static void push_subpending (struct _searcher *s, gint offstart, gint offend) { - /* This is really an assertion, we just ignore the last pending match instead of crashing though */ + /* This is really an assertion, we just ignore the + * last pending match instead of crashing though. */ if (s->submatchp >= s->words) { d (printf("ERROR: submatch pending stack overflow\n")); s->submatchp = s->words-1; @@ -619,7 +626,8 @@ push_subpending (struct _searcher *s, gint offstart, gint offend) s->submatchp++; } -/* move any (partial) tokens from input to output if they are beyond the current output position */ +/* move any (partial) tokens from input to output + * if they are beyond the current output position */ static void output_pending (struct _searcher *s) { @@ -679,8 +687,6 @@ searcher_next_token (struct _searcher *s) token->offset = s->offset; tok = (guchar *) token->tok; - d (printf("new token %d '%s'\n", token->offset, token->tok[0]==TAG_ESCAPE?token->tok+1:token->tok)); - /* tag test, reset state on unknown tags */ if (tok[0] == TAG_ESCAPE) { if (!ignore_tag ((gchar *) tok)) { @@ -728,8 +734,10 @@ searcher_next_token (struct _searcher *s) push_subpending (s, offstart, offend); /*output_match(s, offstart, offend);*/ } else if (g_queue_get_length (&s->input) > 8) { - /* we're continuing to match and merge, but we have a lot of stuff - waiting, so flush it out now since this is a safe point to do it */ + /* we're continuing to match and merge, + * but we have a lot of stuff waiting, + * so flush it out now since this is a + * safe point to do it */ output_subpending (s); } } else { @@ -895,7 +903,9 @@ search_info_to_searcher (struct _search_info *si) tage = g_alloca (20); sprintf(tage, "%c</font>", TAG_ESCAPE); - return searcher_new (si->flags, si->strv->len, (guchar **) si->strv->pdata, tags, tage); + return searcher_new ( + si->flags, si->strv->len, + (guchar **) si->strv->pdata, tags, tage); } /* ********************************************************************** */ diff --git a/widgets/misc/e-selection-model.c b/widgets/misc/e-selection-model.c index d5ce69a1a6..e41d44e808 100644 --- a/widgets/misc/e-selection-model.c +++ b/widgets/misc/e-selection-model.c @@ -744,7 +744,8 @@ e_selection_model_key_press (ESelectionModel *selection, gint cursor_col = e_selection_model_cursor_col (selection); row = e_sorter_sorted_to_model (selection->sorter, row); - e_selection_model_select_as_key_press (selection, row, cursor_col, key->state); + e_selection_model_select_as_key_press ( + selection, row, cursor_col, key->state); return TRUE; } break; @@ -755,7 +756,8 @@ e_selection_model_key_press (ESelectionModel *selection, gint cursor_col = e_selection_model_cursor_col (selection); row = e_sorter_sorted_to_model (selection->sorter, row); - e_selection_model_select_as_key_press (selection, row, cursor_col, key->state); + e_selection_model_select_as_key_press ( + selection, row, cursor_col, key->state); return TRUE; } break; diff --git a/widgets/misc/e-web-view.c b/widgets/misc/e-web-view.c index e7153761ac..54bd251a53 100644 --- a/widgets/misc/e-web-view.c +++ b/widgets/misc/e-web-view.c @@ -476,9 +476,12 @@ web_view_button_press_event_cb (EWebView *web_view, if (event) { GdkPixbufAnimation *anim; - anim = gtk_html_get_image_at (frame ? frame : GTK_HTML (web_view), event->x, event->y); + if (frame == NULL) + frame = GTK_HTML (web_view); + + anim = gtk_html_get_image_at (frame, event->x, event->y); e_web_view_set_cursor_image (web_view, anim); - if (anim) + if (anim != NULL) g_object_unref (anim); } @@ -772,7 +775,7 @@ web_view_dispose (GObject *object) priv->paste_target_list = NULL; } - if (priv->cursor_image) { + if (priv->cursor_image != NULL) { g_object_unref (priv->cursor_image); priv->cursor_image = NULL; } @@ -1987,10 +1990,10 @@ e_web_view_set_cursor_image (EWebView *web_view, { g_return_if_fail (E_IS_WEB_VIEW (web_view)); - if (image) + if (image != NULL) g_object_ref (image); - if (web_view->priv->cursor_image) + if (web_view->priv->cursor_image != NULL) g_object_unref (web_view->priv->cursor_image); web_view->priv->cursor_image = image; diff --git a/widgets/misc/e-web-view.h b/widgets/misc/e-web-view.h index ed9017e3bd..b5f368f622 100644 --- a/widgets/misc/e-web-view.h +++ b/widgets/misc/e-web-view.h @@ -124,7 +124,8 @@ void e_web_view_set_magic_smileys (EWebView *web_view, const gchar * e_web_view_get_selected_uri (EWebView *web_view); void e_web_view_set_selected_uri (EWebView *web_view, const gchar *selected_uri); -GdkPixbufAnimation * e_web_view_get_cursor_image(EWebView *web_view); +GdkPixbufAnimation * + e_web_view_get_cursor_image (EWebView *web_view); void e_web_view_set_cursor_image (EWebView *web_view, GdkPixbufAnimation *animation); GtkAction * e_web_view_get_open_proxy (EWebView *web_view); diff --git a/widgets/table/e-cell-combo.c b/widgets/table/e-cell-combo.c index 48a762a8d9..b366c9382c 100644 --- a/widgets/table/e-cell-combo.c +++ b/widgets/table/e-cell-combo.c @@ -73,38 +73,36 @@ /* The height to make the popup list if there aren't any items in it. */ #define E_CELL_COMBO_LIST_EMPTY_HEIGHT 15 -static void e_cell_combo_dispose (GObject *object); - -static gint e_cell_combo_do_popup (ECellPopup *ecp, - GdkEvent *event, - gint row, - gint view_col); -static void e_cell_combo_select_matching_item (ECellCombo *ecc); -static void e_cell_combo_show_popup (ECellCombo *ecc, - gint row, - gint view_col); -static void e_cell_combo_get_popup_pos (ECellCombo *ecc, - gint row, - gint view_col, - gint *x, - gint *y, - gint *height, - gint *width); - -static void e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc); - -static gint e_cell_combo_button_press (GtkWidget *popup_window, - GdkEvent *event, - ECellCombo *ecc); -static gint e_cell_combo_button_release (GtkWidget *popup_window, - GdkEventButton *event, - ECellCombo *ecc); -static gint e_cell_combo_key_press (GtkWidget *popup_window, - GdkEventKey *event, - ECellCombo *ecc); - -static void e_cell_combo_update_cell (ECellCombo *ecc); -static void e_cell_combo_restart_edit (ECellCombo *ecc); +static void e_cell_combo_dispose (GObject *object); +static gint e_cell_combo_do_popup (ECellPopup *ecp, + GdkEvent *event, + gint row, + gint view_col); +static void e_cell_combo_select_matching_item + (ECellCombo *ecc); +static void e_cell_combo_show_popup (ECellCombo *ecc, + gint row, + gint view_col); +static void e_cell_combo_get_popup_pos (ECellCombo *ecc, + gint row, + gint view_col, + gint *x, + gint *y, + gint *height, + gint *width); +static void e_cell_combo_selection_changed (GtkTreeSelection *selection, + ECellCombo *ecc); +static gint e_cell_combo_button_press (GtkWidget *popup_window, + GdkEvent *event, + ECellCombo *ecc); +static gint e_cell_combo_button_release (GtkWidget *popup_window, + GdkEventButton *event, + ECellCombo *ecc); +static gint e_cell_combo_key_press (GtkWidget *popup_window, + GdkEventKey *event, + ECellCombo *ecc); +static void e_cell_combo_update_cell (ECellCombo *ecc); +static void e_cell_combo_restart_edit (ECellCombo *ecc); G_DEFINE_TYPE (ECellCombo, e_cell_combo, E_TYPE_CELL_POPUP) @@ -132,7 +130,8 @@ e_cell_combo_init (ECellCombo *ecc) ever be one popup in use at a time. */ ecc->popup_window = gtk_window_new (GTK_WINDOW_POPUP); - gtk_window_set_type_hint (GTK_WINDOW (ecc->popup_window), GDK_WINDOW_TYPE_HINT_COMBO); + gtk_window_set_type_hint ( + GTK_WINDOW (ecc->popup_window), GDK_WINDOW_TYPE_HINT_COMBO); gtk_window_set_resizable (GTK_WINDOW (ecc->popup_window), TRUE); frame = gtk_frame_new (NULL); @@ -143,53 +142,60 @@ e_cell_combo_init (ECellCombo *ecc) ecc->popup_scrolled_window = gtk_scrolled_window_new (NULL, NULL); scrolled_window = GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window); - gtk_scrolled_window_set_policy (scrolled_window, - GTK_POLICY_AUTOMATIC, - GTK_POLICY_AUTOMATIC); - gtk_widget_set_can_focus (gtk_scrolled_window_get_hscrollbar (scrolled_window), FALSE); - gtk_widget_set_can_focus (gtk_scrolled_window_get_vscrollbar (scrolled_window), FALSE); + gtk_scrolled_window_set_policy ( + scrolled_window, GTK_POLICY_AUTOMATIC, GTK_POLICY_AUTOMATIC); + gtk_widget_set_can_focus ( + gtk_scrolled_window_get_hscrollbar (scrolled_window), FALSE); + gtk_widget_set_can_focus ( + gtk_scrolled_window_get_vscrollbar (scrolled_window), FALSE); gtk_container_add (GTK_CONTAINER (frame), ecc->popup_scrolled_window); gtk_widget_show (ecc->popup_scrolled_window); store = gtk_list_store_new (1, G_TYPE_STRING); - ecc->popup_tree_view = gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); + ecc->popup_tree_view = + gtk_tree_view_new_with_model (GTK_TREE_MODEL (store)); g_object_unref (store); gtk_tree_view_append_column ( GTK_TREE_VIEW (ecc->popup_tree_view), - gtk_tree_view_column_new_with_attributes ("Text", gtk_cell_renderer_text_new (), "text", 0, NULL)); + gtk_tree_view_column_new_with_attributes ( + "Text", gtk_cell_renderer_text_new (), + "text", 0, NULL)); - gtk_tree_view_set_headers_visible (GTK_TREE_VIEW (ecc->popup_tree_view), FALSE); + gtk_tree_view_set_headers_visible ( + GTK_TREE_VIEW (ecc->popup_tree_view), FALSE); - selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ecc->popup_tree_view)); + selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (ecc->popup_tree_view)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - gtk_scrolled_window_add_with_viewport (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window), ecc->popup_tree_view); - gtk_container_set_focus_vadjustment (GTK_CONTAINER (ecc->popup_tree_view), - gtk_scrolled_window_get_vadjustment (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); - gtk_container_set_focus_hadjustment (GTK_CONTAINER (ecc->popup_tree_view), - gtk_scrolled_window_get_hadjustment (GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); + gtk_scrolled_window_add_with_viewport ( + GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window), + ecc->popup_tree_view); + gtk_container_set_focus_vadjustment ( + GTK_CONTAINER (ecc->popup_tree_view), + gtk_scrolled_window_get_vadjustment ( + GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); + gtk_container_set_focus_hadjustment ( + GTK_CONTAINER (ecc->popup_tree_view), + gtk_scrolled_window_get_hadjustment ( + GTK_SCROLLED_WINDOW (ecc->popup_scrolled_window))); gtk_widget_show (ecc->popup_tree_view); a11y = gtk_widget_get_accessible (ecc->popup_tree_view); atk_object_set_name (a11y, _("popup list")); - g_signal_connect (selection, - "changed", - G_CALLBACK (e_cell_combo_selection_changed), - ecc); - g_signal_connect (ecc->popup_window, - "button_press_event", - G_CALLBACK (e_cell_combo_button_press), - ecc); - /* We use connect_after here so the list updates the selection before - we hide the popup and update the cell. */ - g_signal_connect (ecc->popup_window, - "button_release_event", - G_CALLBACK (e_cell_combo_button_release), - ecc); - g_signal_connect (ecc->popup_window, - "key_press_event", - G_CALLBACK (e_cell_combo_key_press), ecc); + g_signal_connect ( + selection, "changed", + G_CALLBACK (e_cell_combo_selection_changed), ecc); + g_signal_connect ( + ecc->popup_window, "button_press_event", + G_CALLBACK (e_cell_combo_button_press), ecc); + g_signal_connect ( + ecc->popup_window, "button_release_event", + G_CALLBACK (e_cell_combo_button_release), ecc); + g_signal_connect ( + ecc->popup_window, "key_press_event", + G_CALLBACK (e_cell_combo_key_press), ecc); } /** @@ -209,7 +215,7 @@ e_cell_combo_new (void) * GObject::dispose method */ static void -e_cell_combo_dispose (GObject *object) +e_cell_combo_dispose (GObject *object) { ECellCombo *ecc = E_CELL_COMBO (object); @@ -221,8 +227,8 @@ e_cell_combo_dispose (GObject *object) } void -e_cell_combo_set_popdown_strings (ECellCombo *ecc, - GList *strings) +e_cell_combo_set_popdown_strings (ECellCombo *ecc, + GList *strings) { GList *elem; GtkListStore *store; @@ -230,7 +236,9 @@ e_cell_combo_set_popdown_strings (ECellCombo *ecc, g_return_if_fail (E_IS_CELL_COMBO (ecc)); g_return_if_fail (strings != NULL); - store = GTK_LIST_STORE (gtk_tree_view_get_model (GTK_TREE_VIEW (ecc->popup_tree_view))); + store = GTK_LIST_STORE ( + gtk_tree_view_get_model ( + GTK_TREE_VIEW (ecc->popup_tree_view))); gtk_list_store_clear (store); for (elem = strings; elem; elem = elem->next) { @@ -243,10 +251,10 @@ e_cell_combo_set_popdown_strings (ECellCombo *ecc, } static gint -e_cell_combo_do_popup (ECellPopup *ecp, - GdkEvent *event, - gint row, - gint view_col) +e_cell_combo_do_popup (ECellPopup *ecp, + GdkEvent *event, + gint row, + gint view_col) { ECellCombo *ecc = E_CELL_COMBO (ecp); guint32 time; @@ -311,9 +319,12 @@ e_cell_combo_select_matching_item (ECellCombo *ecc) gtk_tree_model_get (model, &iter, 0, &str, -1); if (str && g_str_equal (str, cell_text)) { - GtkTreePath *path = gtk_tree_model_get_path (model, &iter); + GtkTreePath *path; - gtk_tree_view_set_cursor (GTK_TREE_VIEW (ecc->popup_tree_view), path, NULL, FALSE); + path = gtk_tree_model_get_path (model, &iter); + gtk_tree_view_set_cursor ( + GTK_TREE_VIEW (ecc->popup_tree_view), + path, NULL, FALSE); gtk_tree_path_free (path); found = TRUE; @@ -444,7 +455,9 @@ e_cell_combo_get_popup_pos (ECellCombo *ecc, gtk_widget_get_preferred_size (ecc->popup_tree_view, &list_requisition, NULL); min_height = MIN (list_requisition.height, requisition.height); - if (!gtk_tree_model_iter_n_children (gtk_tree_view_get_model (GTK_TREE_VIEW (ecc->popup_tree_view)), NULL)) + if (!gtk_tree_model_iter_n_children ( + gtk_tree_view_get_model ( + GTK_TREE_VIEW (ecc->popup_tree_view)), NULL)) list_requisition.height += E_CELL_COMBO_LIST_EMPTY_HEIGHT; popwin_child = gtk_bin_get_child (popwin); @@ -530,7 +543,8 @@ e_cell_combo_selection_changed (GtkTreeSelection *selection, ECellCombo *ecc) GtkTreeIter iter; GtkTreeModel *model; - if (!gtk_widget_get_realized (ecc->popup_window) || !gtk_tree_selection_get_selected (selection, &model, &iter)) + if (!gtk_widget_get_realized (ecc->popup_window) || + !gtk_tree_selection_get_selected (selection, &model, &iter)) return; e_cell_combo_update_cell (ecc); @@ -633,7 +647,8 @@ e_cell_combo_key_press (GtkWidget *popup_window, && event->keyval != GDK_KEY_3270_Enter) return FALSE; - if (event->keyval == GDK_KEY_Escape && (!ecc->popup_window||!gtk_widget_get_visible (ecc->popup_window))) + if (event->keyval == GDK_KEY_Escape && + (!ecc->popup_window || !gtk_widget_get_visible (ecc->popup_window))) return FALSE; gtk_grab_remove (ecc->popup_window); @@ -660,7 +675,8 @@ e_cell_combo_update_cell (ECellCombo *ecc) ECellText *ecell_text = E_CELL_TEXT (ecp->child); ETableItem *eti = E_TABLE_ITEM (ecv->e_table_item_view); ETableCol *ecol; - GtkTreeSelection *selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (ecc->popup_tree_view)); + GtkTreeSelection *selection = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (ecc->popup_tree_view)); GtkTreeModel *model; GtkTreeIter iter; gchar *text = NULL, *old_text; diff --git a/widgets/table/e-cell-date-edit.c b/widgets/table/e-cell-date-edit.c index fc81d59cfd..750b4dea0b 100644 --- a/widgets/table/e-cell-date-edit.c +++ b/widgets/table/e-cell-date-edit.c @@ -843,7 +843,7 @@ e_cell_date_edit_on_ok_clicked (GtkWidget *button, } static void -e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) +e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) { GtkWidget *dialog; struct tm date_tm; @@ -873,46 +873,48 @@ e_cell_date_edit_show_time_invalid_warning (ECellDateEdit *ecde) } static void -e_cell_date_edit_on_now_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_now_clicked (GtkWidget *button, + ECellDateEdit *ecde) { struct tm tmp_tm; time_t t; gchar buffer[64]; if (ecde->time_callback) { - tmp_tm = (*ecde->time_callback) (ecde, ecde->time_callback_data); + tmp_tm = ecde->time_callback ( + ecde, ecde->time_callback_data); } else { t = time (NULL); tmp_tm = *localtime (&t); } - e_time_format_date_and_time (&tmp_tm, - ecde->use_24_hour_format, - TRUE, FALSE, - buffer, sizeof (buffer)); + + e_time_format_date_and_time ( + &tmp_tm, ecde->use_24_hour_format, + TRUE, FALSE, buffer, sizeof (buffer)); e_cell_date_edit_update_cell (ecde, buffer); e_cell_date_edit_hide_popup (ecde); } static void -e_cell_date_edit_on_none_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_none_clicked (GtkWidget *button, + ECellDateEdit *ecde) { e_cell_date_edit_update_cell (ecde, ""); e_cell_date_edit_hide_popup (ecde); } static void -e_cell_date_edit_on_today_clicked (GtkWidget *button, - ECellDateEdit *ecde) +e_cell_date_edit_on_today_clicked (GtkWidget *button, + ECellDateEdit *ecde) { struct tm tmp_tm; time_t t; gchar buffer[64]; if (ecde->time_callback) { - tmp_tm = (*ecde->time_callback) (ecde, ecde->time_callback_data); + tmp_tm = ecde->time_callback ( + ecde, ecde->time_callback_data); } else { t = time (NULL); tmp_tm = *localtime (&t); @@ -921,18 +923,18 @@ e_cell_date_edit_on_today_clicked (GtkWidget *button, tmp_tm.tm_hour = 0; tmp_tm.tm_min = 0; tmp_tm.tm_sec = 0; - e_time_format_date_and_time (&tmp_tm, - ecde->use_24_hour_format, - FALSE, FALSE, - buffer, sizeof (buffer)); + + e_time_format_date_and_time ( + &tmp_tm, ecde->use_24_hour_format, + FALSE, FALSE, buffer, sizeof (buffer)); e_cell_date_edit_update_cell (ecde, buffer); e_cell_date_edit_hide_popup (ecde); } static void -e_cell_date_edit_update_cell (ECellDateEdit *ecde, - const gchar *text) +e_cell_date_edit_update_cell (ECellDateEdit *ecde, + const gchar *text) { ECellPopup *ecp = E_CELL_POPUP (ecde); ECellText *ecell_text = E_CELL_TEXT (ecp->child); @@ -944,21 +946,26 @@ e_cell_date_edit_update_cell (ECellDateEdit *ecde, /* Compare the new text with the existing cell contents. */ ecol = e_table_header_get_column (eti->header, ecp->popup_view_col); - old_text = e_cell_text_get_text (ecell_text, ecv->e_table_model, - ecol->col_idx, ecp->popup_row); + old_text = e_cell_text_get_text ( + ecell_text, ecv->e_table_model, + ecol->col_idx, ecp->popup_row); /* If they are different, update the cell contents. */ if (strcmp (old_text, text)) { - e_cell_text_set_value (ecell_text, ecv->e_table_model, - ecol->col_idx, ecp->popup_row, text); - e_cell_leave_edit (ecv, ecp->popup_view_col, ecol->col_idx, ecp->popup_row, NULL); + e_cell_text_set_value ( + ecell_text, ecv->e_table_model, + ecol->col_idx, ecp->popup_row, text); + e_cell_leave_edit ( + ecv, ecp->popup_view_col, + ecol->col_idx, ecp->popup_row, NULL); } e_cell_text_free_text (ecell_text, old_text); } static void -e_cell_date_edit_on_time_selected (GtkTreeSelection *selection, ECellDateEdit *ecde) +e_cell_date_edit_on_time_selected (GtkTreeSelection *selection, + ECellDateEdit *ecde) { gchar *list_item_text = NULL; GtkTreeIter iter; @@ -977,7 +984,7 @@ e_cell_date_edit_on_time_selected (GtkTreeSelection *selection, ECellDateEdit *e } static void -e_cell_date_edit_hide_popup (ECellDateEdit *ecde) +e_cell_date_edit_hide_popup (ECellDateEdit *ecde) { gtk_grab_remove (ecde->popup_window); gtk_widget_hide (ecde->popup_window); diff --git a/widgets/table/e-cell-toggle.c b/widgets/table/e-cell-toggle.c index b1edb1424e..76fd452397 100644 --- a/widgets/table/e-cell-toggle.c +++ b/widgets/table/e-cell-toggle.c @@ -185,11 +185,8 @@ cell_toggle_draw (ECellView *ecell_view, priv = E_CELL_TOGGLE (ecell_view->ecell)->priv; - if (value < 0 || value >= priv->pixbufs->len) { - g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", - value, priv->pixbufs->len); + if (value < 0 || value >= priv->pixbufs->len) return; - } image = g_ptr_array_index (priv->pixbufs, value); @@ -238,7 +235,8 @@ cell_toggle_event (ECellView *ecell_view, ECellActions *actions) { ECellToggleView *toggle_view = (ECellToggleView *) ecell_view; - gpointer _value = e_table_model_value_at (ecell_view->e_table_model, model_col, row); + gpointer _value = e_table_model_value_at ( + ecell_view->e_table_model, model_col, row); const gint value = GPOINTER_TO_INT (_value); switch (event->type) { @@ -290,11 +288,8 @@ cell_toggle_print (ECellView *ecell_view, priv = E_CELL_TOGGLE (ecell_view->ecell)->priv; - if (value >= priv->pixbufs->len) { - g_warning ("Value from the table model is %d, the states we support are [0..%d)\n", - value, priv->pixbufs->len); + if (value >= priv->pixbufs->len) return; - } image = g_ptr_array_index (priv->pixbufs, value); if (image) { diff --git a/widgets/table/e-table-config.c b/widgets/table/e-table-config.c index 00ad664e61..01d62602e2 100644 --- a/widgets/table/e-table-config.c +++ b/widgets/table/e-table-config.c @@ -835,7 +835,14 @@ configure_sort_dialog (ETableConfig *config, GtkBuilder *builder) { GSList *l; gint i; - const gchar *algs[] = {"alignment4", "alignment3", "alignment2", "alignment1", NULL}; + + const gchar *algs[] = { + "alignment4", + "alignment3", + "alignment2", + "alignment1", + NULL + }; for (i = 0; i < 4; i++) { gchar buffer[80]; @@ -1268,7 +1275,9 @@ setup_gui (ETableConfig *config) builder, "e-table-config"); if (config->header) - gtk_window_set_title (GTK_WINDOW (config->dialog_toplevel), config->header); + gtk_window_set_title ( + GTK_WINDOW (config->dialog_toplevel), + config->header); config->dialog_show_fields = e_builder_get_widget ( builder, "dialog-show-fields"); @@ -1284,9 +1293,15 @@ setup_gui (ETableConfig *config) config->fields_label = e_builder_get_widget ( builder, "label-fields"); - connect_button (config, builder, "button-sort", G_CALLBACK (config_button_sort)); - connect_button (config, builder, "button-group", G_CALLBACK (config_button_group)); - connect_button (config, builder, "button-fields", G_CALLBACK (config_button_fields)); + connect_button ( + config, builder, "button-sort", + G_CALLBACK (config_button_sort)); + connect_button ( + config, builder, "button-group", + G_CALLBACK (config_button_group)); + connect_button ( + config, builder, "button-fields", + G_CALLBACK (config_button_fields)); if (!can_group) { GtkWidget *w; diff --git a/widgets/table/e-table-extras.c b/widgets/table/e-table-extras.c index db18a8cf9e..75626aa2a9 100644 --- a/widgets/table/e-table-extras.c +++ b/widgets/table/e-table-extras.c @@ -123,7 +123,8 @@ g_utf8_strncasecmp (const gchar *s1, c1 = g_unichar_tolower (g_utf8_get_char (s1)); c2 = g_unichar_tolower (g_utf8_get_char (s2)); - /* Collation is locale-dependent, so this totally fails to do the right thing. */ + /* Collation is locale-dependent, so this + * totally fails to do the right thing. */ if (c1 != c2) return c1 < c2 ? -1 : 1; diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index 5d38b686a0..12fc9b95bb 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -131,7 +131,8 @@ ethi_dispose (GObject *object) { ethi->full_header = NULL; if (ethi->etfcd.widget) - g_object_remove_weak_pointer (G_OBJECT (ethi->etfcd.widget), ði->etfcd.pointer); + g_object_remove_weak_pointer ( + G_OBJECT (ethi->etfcd.widget), ði->etfcd.pointer); if (ethi->config) g_object_unref (ethi->config); @@ -586,7 +587,8 @@ do_drag_motion (ETableHeaderItem *ethi, col = ethi_find_col_by_x_nearest (ethi, x); suggested_action = gdk_drag_context_get_suggested_action (context); - if (ethi->drag_col != -1 && (col == ethi->drag_col || col == ethi->drag_col + 1)) { + if (ethi->drag_col != -1 && (col == ethi->drag_col || + col == ethi->drag_col + 1)) { if (ethi->drag_col != -1) ethi_remove_destroy_marker (ethi); @@ -701,10 +703,10 @@ static void context_connect (ETableHeaderItem *ethi, GdkDragContext *context) { - if (g_dataset_get_data (context, "e-table-header-item") == NULL) { - g_object_ref (ethi); - g_dataset_set_data_full (context, "e-table-header-item", ethi, context_destroyed); - } + if (g_dataset_get_data (context, "e-table-header-item") == NULL) + g_dataset_set_data_full ( + context, "e-table-header-item", + g_object_ref (ethi), context_destroyed); } static gboolean @@ -984,26 +986,39 @@ ethi_draw (GnomeCanvasItem *item, style = gtk_widget_get_style (GTK_WIDGET (canvas)); if (ethi->sort_info) { - gint length = e_table_sort_info_grouping_get_count (ethi->sort_info); + gint length; gint i; + + length = e_table_sort_info_grouping_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = - e_table_sort_info_grouping_get_nth ( + ETableSortColumn column; + + column = e_table_sort_info_grouping_get_nth ( ethi->sort_info, i); - g_hash_table_insert (arrows, - GINT_TO_POINTER ((gint) column.column), - GINT_TO_POINTER (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + + g_hash_table_insert ( + arrows, + GINT_TO_POINTER ((gint) column.column), + GINT_TO_POINTER ( + column.ascending ? + E_TABLE_COL_ARROW_DOWN : + E_TABLE_COL_ARROW_UP)); } + length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth (ethi->sort_info, i); - g_hash_table_insert (arrows, - GINT_TO_POINTER ((gint) column.column), - GINT_TO_POINTER (column.ascending ? - E_TABLE_COL_ARROW_DOWN : - E_TABLE_COL_ARROW_UP)); + ETableSortColumn column; + + column = e_table_sort_info_sorting_get_nth ( + ethi->sort_info, i); + + g_hash_table_insert ( + arrows, + GINT_TO_POINTER ((gint) column.column), + GINT_TO_POINTER ( + column.ascending ? + E_TABLE_COL_ARROW_DOWN : + E_TABLE_COL_ARROW_UP)); } } @@ -1710,7 +1725,11 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) length = e_table_sort_info_grouping_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_grouping_get_nth (ethi->sort_info, i); + ETableSortColumn column; + + column = e_table_sort_info_grouping_get_nth ( + ethi->sort_info, i); + if (model_col == column.column || model_col == -1) { gint ascending = column.ascending; ascending = !ascending; @@ -1725,7 +1744,10 @@ ethi_change_sort_state (ETableHeaderItem *ethi, ETableCol *col) if (!found) { length = e_table_sort_info_sorting_get_count (ethi->sort_info); for (i = 0; i < length; i++) { - ETableSortColumn column = e_table_sort_info_sorting_get_nth (ethi->sort_info, i); + ETableSortColumn column; + + column = e_table_sort_info_sorting_get_nth ( + ethi->sort_info, i); if (model_col == column.column || model_col == -1) { gint ascending = column.ascending; @@ -1909,13 +1931,15 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) info->col = ethi->selected_col; ecol = e_table_header_get_column (ethi->eth, info->col); - popup = e_popup_menu_create_with_domain (ethi_context_menu, - 1 + - (ecol->sortable ? 0 : 2) + - ((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 + + (ecol->sortable ? 0 : 2) + + ((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); g_object_ref_sink (popup); g_signal_connect (popup, "selection-done", G_CALLBACK (free_popup_info), info); @@ -1932,13 +1956,15 @@ ethi_event (GnomeCanvasItem *item, GdkEvent *e) (e->key.keyval == GDK_KEY_KP_Right)) { ETableCol *ecol; - if ((ethi->selected_col < 0) || (ethi->selected_col >= ethi->eth->col_count - 1)) + if ((ethi->selected_col < 0) || + (ethi->selected_col >= ethi->eth->col_count - 1)) ethi->selected_col = 0; else ethi->selected_col++; ecol = e_table_header_get_column (ethi->eth, ethi->selected_col); ethi_change_sort_state (ethi, ecol); - } else if ((e->key.keyval == GDK_KEY_Left) || (e->key.keyval == GDK_KEY_KP_Left)) { + } else if ((e->key.keyval == GDK_KEY_Left) || + (e->key.keyval == GDK_KEY_KP_Left)) { ETableCol *ecol; if ((ethi->selected_col <= 0) || (ethi->selected_col >= ethi->eth->col_count)) diff --git a/widgets/table/e-table-header.c b/widgets/table/e-table-header.c index cc5b147747..e890d4836c 100644 --- a/widgets/table/e-table-header.c +++ b/widgets/table/e-table-header.c @@ -395,7 +395,8 @@ e_table_header_add_column (ETableHeader *eth, ETableCol *tc, gint pos) if (pos == -1) pos = eth->col_count; - eth->columns = g_realloc (eth->columns, sizeof (ETableCol *) * (eth->col_count + 1)); + eth->columns = g_realloc ( + eth->columns, sizeof (ETableCol *) * (eth->col_count + 1)); /* * We are the primary owners of the column diff --git a/widgets/table/e-table-subset-variable.c b/widgets/table/e-table-subset-variable.c index be9e3e29ec..78a980a660 100644 --- a/widgets/table/e-table-subset-variable.c +++ b/widgets/table/e-table-subset-variable.c @@ -48,7 +48,9 @@ etssv_add (ETableSubsetVariable *etssv, if (etss->n_map + 1 > etssv->n_vals_allocated) { etssv->n_vals_allocated += INCREMENT_AMOUNT; - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); + etss->map_table = g_realloc ( + etss->map_table, + etssv->n_vals_allocated * sizeof (gint)); } etss->map_table[etss->n_map++] = row; @@ -69,7 +71,9 @@ etssv_add_array (ETableSubsetVariable *etssv, if (etss->n_map + count > etssv->n_vals_allocated) { etssv->n_vals_allocated += MAX (INCREMENT_AMOUNT, count); - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); + etss->map_table = g_realloc ( + etss->map_table, + etssv->n_vals_allocated * sizeof (gint)); } for (i = 0; i < count; i++) etss->map_table[etss->n_map++] = array[i]; @@ -90,7 +94,9 @@ etssv_add_all (ETableSubsetVariable *etssv) rows = e_table_model_row_count (etss->source); if (etss->n_map + rows > etssv->n_vals_allocated) { etssv->n_vals_allocated += MAX (INCREMENT_AMOUNT, rows); - etss->map_table = g_realloc (etss->map_table, etssv->n_vals_allocated * sizeof (gint)); + etss->map_table = g_realloc ( + etss->map_table, + etssv->n_vals_allocated * sizeof (gint)); } for (i = 0; i < rows; i++) etss->map_table[etss->n_map++] = i; @@ -109,7 +115,10 @@ etssv_remove (ETableSubsetVariable *etssv, for (i = 0; i < etss->n_map; i++) { if (etss->map_table[i] == row) { e_table_model_pre_change (etm); - memmove (etss->map_table + i, etss->map_table + i + 1, (etss->n_map - i - 1) * sizeof (gint)); + memmove ( + etss->map_table + i, + etss->map_table + i + 1, + (etss->n_map - i - 1) * sizeof (gint)); etss->n_map--; e_table_model_row_deleted (etm, i); diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index c1d0a2ad94..d1241543a5 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -1665,41 +1665,47 @@ et_real_construct (ETable *e_table, ETableModel *etm, ETableExtras *ete, e_table->horizontal_resize = specification->horizontal_resize; e_table->allow_grouping = specification->allow_grouping; - e_table->sort_info = state->sort_info; - g_object_ref (state->sort_info); - e_table_sort_info_set_can_group (e_table->sort_info, e_table->allow_grouping); + e_table->sort_info = g_object_ref (state->sort_info); + + e_table_sort_info_set_can_group ( + e_table->sort_info, e_table->allow_grouping); - e_table->group_info_change_id = - g_signal_connect (G_OBJECT (e_table->sort_info), "group_info_changed", - G_CALLBACK (group_info_changed), e_table); + e_table->group_info_change_id = g_signal_connect ( + e_table->sort_info, "group_info_changed", + G_CALLBACK (group_info_changed), e_table); - e_table->sort_info_change_id = - g_signal_connect (G_OBJECT (e_table->sort_info), "sort_info_changed", - G_CALLBACK (sort_info_changed), e_table); + e_table->sort_info_change_id = g_signal_connect ( + e_table->sort_info, "sort_info_changed", + G_CALLBACK (sort_info_changed), e_table); g_value_set_object (val, e_table->sort_info); g_object_set_property (G_OBJECT(e_table->header), "sort_info", val); g_free (val); - e_table->sorter = e_table_sorter_new (etm, e_table->full_header, e_table->sort_info); + e_table->sorter = e_table_sorter_new ( + etm, e_table->full_header, e_table->sort_info); - g_object_set (e_table->selection, - "model", etm, - "selection_mode", specification->selection_mode, - "cursor_mode", specification->cursor_mode, - "sorter", e_table->sorter, - "header", e_table->header, - NULL); + g_object_set ( + e_table->selection, + "model", etm, + "selection_mode", specification->selection_mode, + "cursor_mode", specification->cursor_mode, + "sorter", e_table->sorter, + "header", e_table->header, + NULL); - g_signal_connect(e_table->selection, "selection_changed", - G_CALLBACK (et_selection_model_selection_changed), e_table); - g_signal_connect(e_table->selection, "selection_row_changed", - G_CALLBACK (et_selection_model_selection_row_changed), e_table); + g_signal_connect ( + e_table->selection, "selection_changed", + G_CALLBACK (et_selection_model_selection_changed), e_table); + g_signal_connect ( + e_table->selection, "selection_row_changed", + G_CALLBACK (et_selection_model_selection_row_changed), e_table); - if (!specification->no_headers) { + if (!specification->no_headers) e_table_setup_header (e_table); - } - e_table_setup_table (e_table, e_table->full_header, e_table->header, etm); + + e_table_setup_table ( + e_table, e_table->full_header, e_table->header, etm); e_table_fill_table (e_table, etm); scrollable = GTK_SCROLLABLE (e_table->table_canvas); @@ -2235,7 +2241,8 @@ e_table_commit_click_to_add (ETable *table) { et_eti_leave_edit (table); if (table->click_to_add) - e_table_click_to_add_commit (E_TABLE_CLICK_TO_ADD (table->click_to_add)); + e_table_click_to_add_commit ( + E_TABLE_CLICK_TO_ADD (table->click_to_add)); } static void @@ -2261,25 +2268,33 @@ et_get_property (GObject *object, break; case PROP_HADJUSTMENT: if (etable->table_canvas) - g_object_get_property (G_OBJECT (etable->table_canvas), "hadjustment", value); + g_object_get_property ( + G_OBJECT (etable->table_canvas), + "hadjustment", value); else g_value_set_object (value, NULL); break; case PROP_VADJUSTMENT: if (etable->table_canvas) - g_object_get_property (G_OBJECT (etable->table_canvas), "vadjustment", value); + g_object_get_property ( + G_OBJECT (etable->table_canvas), + "vadjustment", value); else g_value_set_object (value, NULL); break; case PROP_HSCROLL_POLICY: if (etable->table_canvas) - g_object_get_property (G_OBJECT (etable->table_canvas), "hscroll-policy", value); + g_object_get_property ( + G_OBJECT (etable->table_canvas), + "hscroll-policy", value); else g_value_set_enum (value, 0); break; case PROP_VSCROLL_POLICY: if (etable->table_canvas) - g_object_get_property (G_OBJECT (etable->table_canvas), "vscroll-policy", value); + g_object_get_property ( + G_OBJECT (etable->table_canvas), + "vscroll-policy", value); else g_value_set_enum (value, 0); break; @@ -2295,9 +2310,9 @@ typedef struct { static void et_set_property (GObject *object, - guint prop_id, - const GValue *value, - GParamSpec *pspec) + guint prop_id, + const GValue *value, + GParamSpec *pspec) { ETable *etable = E_TABLE (object); @@ -2305,17 +2320,21 @@ et_set_property (GObject *object, case PROP_LENGTH_THRESHOLD: etable->length_threshold = g_value_get_int (value); if (etable->group) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etable->group), - "length_threshold", etable->length_threshold, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etable->group), + "length_threshold", + etable->length_threshold, + NULL); } break; case PROP_UNIFORM_ROW_HEIGHT: etable->uniform_row_height = g_value_get_boolean (value); if (etable->group) { - gnome_canvas_item_set (GNOME_CANVAS_ITEM (etable->group), - "uniform_row_height", etable->uniform_row_height, - NULL); + gnome_canvas_item_set ( + GNOME_CANVAS_ITEM (etable->group), + "uniform_row_height", + etable->uniform_row_height, + NULL); } break; case PROP_ALWAYS_SEARCH: @@ -2333,23 +2352,27 @@ et_set_property (GObject *object, clear_current_search_col (etable); if (etable->use_click_to_add) { - etable->click_to_add = gnome_canvas_item_new - (GNOME_CANVAS_GROUP (etable->canvas_vbox), - e_table_click_to_add_get_type (), - "header", etable->header, - "model", etable->model, - "message", etable->click_to_add_message, - NULL); + etable->click_to_add = gnome_canvas_item_new ( + GNOME_CANVAS_GROUP (etable->canvas_vbox), + e_table_click_to_add_get_type (), + "header", etable->header, + "model", etable->model, + "message", etable->click_to_add_message, + NULL); if (etable->use_click_to_add_end) - e_canvas_vbox_add_item (E_CANVAS_VBOX (etable->canvas_vbox), - etable->click_to_add); + e_canvas_vbox_add_item ( + E_CANVAS_VBOX (etable->canvas_vbox), + etable->click_to_add); else - e_canvas_vbox_add_item_start (E_CANVAS_VBOX (etable->canvas_vbox), - etable->click_to_add); - - g_signal_connect (G_OBJECT (etable->click_to_add), "cursor_change", - G_CALLBACK (click_to_add_cursor_change), etable); + e_canvas_vbox_add_item_start ( + E_CANVAS_VBOX (etable->canvas_vbox), + etable->click_to_add); + + g_signal_connect ( + etable->click_to_add, "cursor_change", + G_CALLBACK (click_to_add_cursor_change), + etable); } else { g_object_run_dispose (G_OBJECT (etable->click_to_add)); etable->click_to_add = NULL; @@ -2357,19 +2380,27 @@ et_set_property (GObject *object, break; case PROP_HADJUSTMENT: if (etable->table_canvas) - g_object_set_property (G_OBJECT (etable->table_canvas), "hadjustment", value); + g_object_set_property ( + G_OBJECT (etable->table_canvas), + "hadjustment", value); break; case PROP_VADJUSTMENT: if (etable->table_canvas) - g_object_set_property (G_OBJECT (etable->table_canvas), "vadjustment", value); + g_object_set_property ( + G_OBJECT (etable->table_canvas), + "vadjustment", value); break; case PROP_HSCROLL_POLICY: if (etable->table_canvas) - g_object_set_property (G_OBJECT (etable->table_canvas), "hscroll-policy", value); + g_object_set_property ( + G_OBJECT (etable->table_canvas), + "hscroll-policy", value); break; case PROP_VSCROLL_POLICY: if (etable->table_canvas) - g_object_set_property (G_OBJECT (etable->table_canvas), "vscroll-policy", value); + g_object_set_property ( + G_OBJECT (etable->table_canvas), + "vscroll-policy", value); break; } } diff --git a/widgets/table/e-tree-memory.c b/widgets/table/e-tree-memory.c index 61200cda4c..0fe0cb79b0 100644 --- a/widgets/table/e-tree-memory.c +++ b/widgets/table/e-tree-memory.c @@ -338,12 +338,15 @@ etmm_clear_children_computed (ETreeMemoryPath *path) static void etmm_node_request_collapse (ETreeModel *etm, ETreePath node) { + ETreeModelClass *parent_class; + if (node) etmm_clear_children_computed (node); - if (E_TREE_MODEL_CLASS (e_tree_memory_parent_class)->node_request_collapse) { - E_TREE_MODEL_CLASS (e_tree_memory_parent_class)->node_request_collapse (etm, node); - } + parent_class = E_TREE_MODEL_CLASS (e_tree_memory_parent_class); + + if (parent_class->node_request_collapse != NULL) + parent_class->node_request_collapse (etm, node); } diff --git a/widgets/table/gal-a11y-e-table-click-to-add.c b/widgets/table/gal-a11y-e-table-click-to-add.c index 1b7ce531e2..a118359b1c 100644 --- a/widgets/table/gal-a11y-e-table-click-to-add.c +++ b/widgets/table/gal-a11y-e-table-click-to-add.c @@ -36,7 +36,9 @@ static AtkObjectClass *parent_class; static GType parent_type; static gint priv_offset; -#define GET_PRIVATE(object) ((GalA11yETableClickToAddPrivate *) (((gchar *) object) + priv_offset)) +#define GET_PRIVATE(object) \ + ((GalA11yETableClickToAddPrivate *) \ + (((gchar *) object) + priv_offset)) #define PARENT_TYPE (parent_type) struct _GalA11yETableClickToAddPrivate { @@ -128,7 +130,9 @@ etcta_get_name (AtkObject *obj) g_return_val_if_fail (GAL_A11Y_IS_E_TABLE_CLICK_TO_ADD (obj), NULL); - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (obj))); + etcta = E_TABLE_CLICK_TO_ADD ( + atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (obj))); if (etcta && etcta->message != NULL) return etcta->message; @@ -141,9 +145,9 @@ etcta_get_n_children (AtkObject *accessible) return 1; } -static AtkObject* +static AtkObject * etcta_ref_child (AtkObject *accessible, - gint i) + gint i) { AtkObject * atk_obj = NULL; ETableClickToAdd * etcta; @@ -151,14 +155,18 @@ etcta_ref_child (AtkObject *accessible, if (i != 0) return NULL; - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (accessible))); + etcta = E_TABLE_CLICK_TO_ADD ( + atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (accessible))); g_return_val_if_fail (etcta, NULL); if (etcta->rect) { - atk_obj = atk_gobject_accessible_for_object (G_OBJECT (etcta->rect)); + atk_obj = atk_gobject_accessible_for_object ( + G_OBJECT (etcta->rect)); } else if (etcta->row) { - atk_obj = atk_gobject_accessible_for_object (G_OBJECT (etcta->row)); + atk_obj = atk_gobject_accessible_for_object ( + G_OBJECT (etcta->row)); } g_object_ref (atk_obj); @@ -198,15 +206,6 @@ etcta_init (GalA11yETableClickToAdd *a11y) { } -/** - * gal_a11y_e_table_click_to_add_get_type: - * @void: - * - * Registers the &GalA11yETableClickToAdd class if necessary, and returns the type ID - * associated to it. - * - * Return value: The type ID of the &GalA11yETableClickToAdd class. - **/ GType gal_a11y_e_table_click_to_add_get_type (void) { @@ -234,7 +233,9 @@ gal_a11y_e_table_click_to_add_get_type (void) NULL }; - factory = atk_registry_get_factory (atk_get_default_registry (), GNOME_TYPE_CANVAS_ITEM); + factory = atk_registry_get_factory ( + atk_get_default_registry (), + GNOME_TYPE_CANVAS_ITEM); parent_type = atk_object_factory_get_accessible_type (factory); type = gal_a11y_type_register_static_with_private (PARENT_TYPE, @@ -288,14 +289,19 @@ etcta_selection_cursor_changed (ESelectionModel *esm, gint row, gint col, ETableClickToAdd *etcta; AtkObject *row_a11y; - etcta = E_TABLE_CLICK_TO_ADD (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (a11y))); + etcta = E_TABLE_CLICK_TO_ADD ( + atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (a11y))); if (etcta == NULL || etcta->row == NULL) return; row_a11y = atk_gobject_accessible_for_object (G_OBJECT (etcta->row)); if (row_a11y) { - AtkObject *cell_a11y = g_object_get_data (G_OBJECT(row_a11y), "gail-focus-object"); + AtkObject *cell_a11y; + + cell_a11y = g_object_get_data ( + G_OBJECT (row_a11y), "gail-focus-object"); if (cell_a11y) { atk_focus_tracker_notify (cell_a11y); } diff --git a/widgets/table/gal-a11y-e-table-item.c b/widgets/table/gal-a11y-e-table-item.c index ffa4bd51c2..1d0add2353 100644 --- a/widgets/table/gal-a11y-e-table-item.c +++ b/widgets/table/gal-a11y-e-table-item.c @@ -654,7 +654,10 @@ table_remove_row_selection (AtkTable *table, gint row) if (!atk_table_is_row_selected (table, row)) return TRUE; - e_selection_model_toggle_single_row (item->selection, view_to_model_row (item, row)); + + e_selection_model_toggle_single_row ( + item->selection, view_to_model_row (item, row)); + return TRUE; } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 3986033c75..fe50f85a0c 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -1827,7 +1827,10 @@ e_text_event (GnomeCanvasItem *item, GdkEvent *event) } start_editing (text); - text->show_cursor = FALSE; /* so we'll redraw and the cursor will be shown */ + + /* So we'll redraw and the + * cursor will be shown. */ + text->show_cursor = FALSE; } else { if (text->im_context) { gtk_im_context_focus_out (text->im_context); @@ -2190,10 +2193,9 @@ e_text_paste (EText *text, GdkAtom selection) { g_object_ref (text); gtk_clipboard_request_text ( - - gtk_widget_get_clipboard (GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), - selection), - paste_received, text); + gtk_widget_get_clipboard ( + GTK_WIDGET (GNOME_CANVAS_ITEM (text)->canvas), + selection), paste_received, text); } typedef struct { diff --git a/widgets/text/gal-a11y-e-text.c b/widgets/text/gal-a11y-e-text.c index dcc96d1d69..aeb6e6bf3b 100644 --- a/widgets/text/gal-a11y-e-text.c +++ b/widgets/text/gal-a11y-e-text.c @@ -677,7 +677,8 @@ et_get_selection (AtkText *text, if (full_text == NULL) return NULL; len = g_utf8_strlen (full_text, -1); - etext = E_TEXT (atk_gobject_accessible_get_object (ATK_GOBJECT_ACCESSIBLE (text))); + etext = E_TEXT (atk_gobject_accessible_get_object ( + ATK_GOBJECT_ACCESSIBLE (text))); start = MIN (etext->selection_start, etext->selection_end); end = MAX (etext->selection_start, etext->selection_end); start = MIN (MAX (0, start), len); |