diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2011-01-29 23:50:53 +0800 |
---|---|---|
committer | Rodrigo Moya <rodrigo@gnome-db.org> | 2011-06-30 00:41:29 +0800 |
commit | 6af0c53b697c6981c1470c177b2c37e081635258 (patch) | |
tree | 35acd2868077859124e55626ba95f2599f1fdc5c | |
parent | 5c0b316904b9463623e7d8976e7ef43662b55765 (diff) | |
download | gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.tar.gz gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.tar.zst gsoc2013-evolution-6af0c53b697c6981c1470c177b2c37e081635258.zip |
Coding style and whitespace cleanup.
69 files changed, 1271 insertions, 620 deletions
diff --git a/addressbook/gui/contact-editor/e-contact-quick-add.c b/addressbook/gui/contact-editor/e-contact-quick-add.c index c0c424cc23..30f0068035 100644 --- a/addressbook/gui/contact-editor/e-contact-quick-add.c +++ b/addressbook/gui/contact-editor/e-contact-quick-add.c @@ -169,12 +169,14 @@ quick_add_merge_contact (QuickAdd *qa) (GAsyncReadyCallback) merge_cb, qa); } -/* - * Raise a contact editor with all fields editable, and hook up all signals accordingly. - */ +/* Raise a contact editor with all fields editable, + * and hook up all signals accordingly. */ static void -contact_added_cb (EContactEditor *ce, EBookStatus status, EContact *contact, gpointer closure) +contact_added_cb (EContactEditor *ce, + EBookStatus status, + EContact *contact, + gpointer closure) { QuickAdd *qa = (QuickAdd *) g_object_get_data (G_OBJECT (ce), "quick_add"); @@ -228,11 +230,14 @@ ce_have_contact (EBook *book, const GError *error, EContact *contact, gpointer c "changed", contact != NULL, NULL); - /* We pass this via object data, so that we don't get a dangling pointer referenced if both - the "contact_added" and "editor_closed" get emitted. (Which, based on a backtrace in bugzilla, - I think can happen and cause a crash. */ - g_object_set_data_full (G_OBJECT (contact_editor), "quick_add", qa, - (GDestroyNotify) quick_add_unref); + /* We pass this via object data, so that we don't get a + * dangling pointer referenced if both the "contact_added" + * and "editor_closed" get emitted. (Which, based on a + * backtrace in bugzilla, I think can happen and cause a + * crash. */ + g_object_set_data_full ( + G_OBJECT (contact_editor), "quick_add", qa, + (GDestroyNotify) quick_add_unref); g_signal_connect (contact_editor, "contact_added", @@ -294,7 +299,8 @@ clicked_cb (GtkWidget *w, gint button, gpointer closure) QuickAdd *qa = (QuickAdd *) closure; /* Get data out of entries. */ - if (!qa->vcard && (button == GTK_RESPONSE_OK || button == QUICK_ADD_RESPONSE_EDIT_FULL)) { + if (!qa->vcard && (button == GTK_RESPONSE_OK || + button == QUICK_ADD_RESPONSE_EDIT_FULL)) { gchar *name = NULL; gchar *email = NULL; @@ -498,7 +504,8 @@ e_contact_quick_add (const gchar *in_name, const gchar *email, /* Remove extra whitespace and the quotes some mailers put around names. */ g_strstrip (name); len = strlen (name); - if ((name[0] == '\'' && name[len-1] == '\'') || (name[0] == '"' && name[len-1] == '"')) { + if ((name[0] == '\'' && name[len-1] == '\'') || + (name[0] == '"' && name[len-1] == '"')) { name[0] = ' '; name[len-1] = ' '; } @@ -520,7 +527,9 @@ e_contact_quick_add (const gchar *in_name, const gchar *email, } void -e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, gpointer closure) +e_contact_quick_add_free_form (const gchar *text, + EContactQuickAddCallback cb, + gpointer closure) { gchar *name=NULL, *email=NULL; const gchar *last_at, *s; @@ -595,7 +604,9 @@ e_contact_quick_add_free_form (const gchar *text, EContactQuickAddCallback cb, g } void -e_contact_quick_add_email (const gchar *email, EContactQuickAddCallback cb, gpointer closure) +e_contact_quick_add_email (const gchar *email, + EContactQuickAddCallback cb, + gpointer closure) { gchar *name = NULL; gchar *addr = NULL; @@ -622,7 +633,9 @@ e_contact_quick_add_email (const gchar *email, EContactQuickAddCallback cb, gpoi } void -e_contact_quick_add_vcard (const gchar *vcard, EContactQuickAddCallback cb, gpointer closure) +e_contact_quick_add_vcard (const gchar *vcard, + EContactQuickAddCallback cb, + gpointer closure) { QuickAdd *qa; GtkWidget *dialog; diff --git a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c index f1a7939cb7..cb1adcfe25 100644 --- a/addressbook/gui/widgets/e-addressbook-reflow-adapter.c +++ b/addressbook/gui/widgets/e-addressbook-reflow-adapter.c @@ -197,11 +197,19 @@ addressbook_create_cmp_cache (EReflowModel *erm) cmp_cache = g_hash_table_new_full (g_direct_hash, g_direct_equal, NULL, g_free); for (ii = 0; ii < count; ii++) { - EContact *contact = (EContact*) e_addressbook_model_contact_at (priv->model, ii); - if (contact) { - const gchar *file_as = e_contact_get_const (contact, E_CONTACT_FILE_AS); - if (file_as) - g_hash_table_insert (cmp_cache, GINT_TO_POINTER (ii), g_utf8_collate_key (file_as, -1)); + EContact *contact; + + contact = (EContact *) + e_addressbook_model_contact_at (priv->model, ii); + if (contact != NULL) { + const gchar *file_as; + + file_as = e_contact_get_const ( + contact, E_CONTACT_FILE_AS); + if (file_as != NULL) + g_hash_table_insert ( + cmp_cache, GINT_TO_POINTER (ii), + g_utf8_collate_key (file_as, -1)); } } diff --git a/addressbook/gui/widgets/e-addressbook-view.c b/addressbook/gui/widgets/e-addressbook-view.c index 5879d9970d..f85bcfe6d3 100644 --- a/addressbook/gui/widgets/e-addressbook-view.c +++ b/addressbook/gui/widgets/e-addressbook-view.c @@ -1471,14 +1471,15 @@ e_addressbook_view_view (EAddressbookView *view) /* XXX Use e_alert_new(). */ /* XXX Provide a parent window. */ dialog = gtk_message_dialog_new ( - NULL, 0, GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, - ngettext ( - /* Translators: This is shown for more than 5 contacts. */ - "Opening %d contacts will open %d new windows as well.\nDo you really want to display all of these contacts?", - "Opening %d contacts will open %d new windows as well.\nDo you really want to display all of these contacts?", - length - ), - length, length); + NULL, 0, + GTK_MESSAGE_QUESTION, GTK_BUTTONS_NONE, ngettext ( + /* Translators: This is shown for > 5 contacts. */ + "Opening %d contacts will open %d new windows " + "as well.\nDo you really want to display all of " + "these contacts?", + "Opening %d contacts will open %d new windows " + "as well.\nDo you really want to display all of " + "these contacts?", length), length, length); gtk_dialog_add_buttons ( GTK_DIALOG (dialog), _("_Don't Display"), GTK_RESPONSE_NO, diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index dc21a7bbb9..3bdd60a1b7 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -123,19 +123,32 @@ typedef struct { static gpointer midnight_refresh_id = NULL; static time_t midnight = 0; -static void -remove_client_alarms (ClientAlarms *ca); -static void display_notification (time_t trigger, CompQueuedAlarms *cqa, - gpointer alarm_id, gboolean use_description); -static void audio_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id); -static void mail_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id); -static void procedure_notification (time_t trigger, CompQueuedAlarms *cqa, gpointer alarm_id); +static void remove_client_alarms (ClientAlarms *ca); +static void display_notification (time_t trigger, + CompQueuedAlarms *cqa, + gpointer alarm_id, + gboolean use_description); +static void audio_notification (time_t trigger, + CompQueuedAlarms *cqa, + gpointer alarm_id); +static void mail_notification (time_t trigger, + CompQueuedAlarms *cqa, + gpointer alarm_id); +static void procedure_notification (time_t trigger, + CompQueuedAlarms *cqa, + gpointer alarm_id); #ifdef HAVE_LIBNOTIFY -static void popup_notification (time_t trigger, CompQueuedAlarms *cqa, - gpointer alarm_id, gboolean use_description); +static void popup_notification (time_t trigger, + CompQueuedAlarms *cqa, + gpointer alarm_id, + gboolean use_description); #endif -static void query_objects_changed_cb (ECal *client, GList *objects, gpointer data); -static void query_objects_removed_cb (ECal *client, GList *objects, gpointer data); +static void query_objects_changed_cb (ECal *client, + GList *objects, + gpointer data); +static void query_objects_removed_cb (ECal *client, + GList *objects, + gpointer data); static void update_cqa (CompQueuedAlarms *cqa, ECalComponent *comp); static void update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa); @@ -196,7 +209,9 @@ e_ctime (const time_t *timep) ret = buffer[next++] = g_strdup (ctime (timep)); if (buffer[next - 1] && *buffer[next - 1]) { gint len = strlen (buffer[next - 1]); - while (len > 0 && (buffer[next - 1][len - 1] == '\n' || buffer[next - 1][len - 1] == '\r' || g_ascii_isspace (buffer[next - 1][len - 1]))) + while (len > 0 && (buffer[next - 1][len - 1] == '\n' || + buffer[next - 1][len - 1] == '\r' || + g_ascii_isspace (buffer[next - 1][len - 1]))) len--; buffer[next - 1][len - 1] = 0; @@ -485,20 +500,16 @@ add_component_alarms (ClientAlarms *ca, ECalComponentAlarms *alarms) ECalComponentAlarmInstance *instance; gpointer alarm_id; QueuedAlarm *qa; - time_t tnow = time (NULL); instance = l->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 (("Could not schedule a trigger for %s. Discarding", e_ctime (&(instance->trigger)))); + alarm_id = alarm_add ( + instance->trigger, alarm_trigger_cb, cqa, NULL); + if (!alarm_id) continue; - } qa = g_new (QueuedAlarm, 1); qa->alarm_id = alarm_id; @@ -507,7 +518,6 @@ add_component_alarms (ClientAlarms *ca, ECalComponentAlarms *alarms) qa->snooze = FALSE; cqa->queued_alarms = g_slist_prepend (cqa->queued_alarms, qa); - debug (("Adding alarm %p %p at %s %s", qa, alarm_id, e_ctime (&(instance->trigger)), e_ctime (&tnow))); } id = e_cal_component_get_id (alarms->comp); @@ -545,15 +555,17 @@ load_alarms (ClientAlarms *ca, time_t start, time_t end) return; } - str_query = g_strdup_printf ("(has-alarms-in-range? (make-time \"%s\") (make-time \"%s\"))", - iso_start, iso_end); + str_query = g_strdup_printf ( + "(has-alarms-in-range? (make-time \"%s\") " + "(make-time \"%s\"))", iso_start, iso_end); g_free (iso_start); g_free (iso_end); /* create the live query */ if (ca->query) { debug (("Disconnecting old queries")); - g_signal_handlers_disconnect_matched (ca->query, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, ca); + g_signal_handlers_disconnect_matched ( + ca->query, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, ca); g_object_unref (ca->query); ca->query = NULL; } @@ -564,12 +576,15 @@ load_alarms (ClientAlarms *ca, time_t start, time_t end) } else { debug (("Setting Call backs")); - g_signal_connect (G_OBJECT (ca->query), "objects_added", - G_CALLBACK (query_objects_changed_cb), ca); - g_signal_connect (G_OBJECT (ca->query), "objects_modified", - G_CALLBACK (query_objects_changed_cb), ca); - g_signal_connect (G_OBJECT (ca->query), "objects_removed", - G_CALLBACK (query_objects_removed_cb), ca); + g_signal_connect ( + ca->query, "objects_added", + G_CALLBACK (query_objects_changed_cb), ca); + g_signal_connect ( + ca->query, "objects_modified", + G_CALLBACK (query_objects_changed_cb), ca); + g_signal_connect ( + ca->query, "objects_removed", + G_CALLBACK (query_objects_removed_cb), ca); e_cal_view_start (ca->query); } @@ -610,7 +625,6 @@ cal_opened_cb (ECal *client, const GError *error, gpointer data) ca = data; - debug (("Opened Calendar %p (Status %d%s%s%s)", client, error ? error->code : 0, error ? " (" : "", error ? error->message : "", error ? ")" : "")); if (error) return; @@ -767,7 +781,8 @@ query_objects_changed_async (struct _query_msg *msg) } debug (("Alarm Already Exist for %s", id->uid)); - /* if the alarms or the alarms list is empty remove it after updating the cqa structure */ + /* If the alarms or the alarms list is empty, + * 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 */ @@ -1075,7 +1090,8 @@ tray_list_remove_cqa_async (struct _tray_cqa_msg *msg) debug (("Found")); tray_icons_list = g_list_delete_link (tray_icons_list, tmp); if (alarm_notifications_dialog) { - model = gtk_tree_view_get_model (GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); + model = gtk_tree_view_get_model ( + GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); gtk_list_store_remove (GTK_LIST_STORE (model), &(tray_data->iter)); } free_tray_icon_data (tray_data); @@ -1091,11 +1107,14 @@ tray_list_remove_cqa_async (struct _tray_cqa_msg *msg) alarm_notifications_dialog = NULL; } else { GtkTreeIter iter; - GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); + GtkTreeModel *model; GtkTreeSelection *sel; + model = gtk_tree_view_get_model ( + GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); gtk_tree_model_get_iter_first (model, &iter); - sel = gtk_tree_view_get_selection (GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); + sel = gtk_tree_view_get_selection ( + GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); gtk_tree_selection_select_iter (sel, &iter); } } @@ -1133,7 +1152,9 @@ tray_list_remove_async (Message *msg) tray_icons_list = g_list_remove_link (tray_icons_list, list); 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, tray_data->cqa->id); + g_hash_table_remove ( + tray_data->cqa->parent_client->uid_alarms_hash, + tray_data->cqa->id); e_cal_component_free_id (tray_data->cqa->id); g_free (tray_data->cqa); } @@ -1241,7 +1262,10 @@ notify_dialog_cb (AlarmNotifyResult result, gint snooze_mins, gpointer data) case ALARM_NOTIFY_DISMISS: if (alarm_notifications_dialog) { - GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); + GtkTreeModel *model; + + model = gtk_tree_view_get_model ( + GTK_TREE_VIEW (alarm_notifications_dialog->treeview)); gtk_list_store_remove (GTK_LIST_STORE (model), &tray_data->iter); } break; @@ -1520,7 +1544,10 @@ display_notification (time_t trigger, CompQueuedAlarms *cqa, if (g_list_length (tray_icons_list) > 1) { gchar *tip; - tip = g_strdup_printf (ngettext ("You have %d alarm", "You have %d alarms", g_list_length (tray_icons_list)), g_list_length (tray_icons_list)); + tip = g_strdup_printf (ngettext ( + "You have %d alarm", "You have %d alarms", + g_list_length (tray_icons_list)), + g_list_length (tray_icons_list)); gtk_status_icon_set_tooltip_text (tray_icon, tip); } else { @@ -1599,15 +1626,23 @@ popup_notification (time_t trigger, CompQueuedAlarms *cqa, if (organiser.cn) { if (location) - body = g_strdup_printf ("<b>%s</b>\n%s %s\n%s %s", organiser.cn, _("Location:"), location, start_str, time_str); + body = g_strdup_printf ( + "<b>%s</b>\n%s %s\n%s %s", + organiser.cn, _("Location:"), + location, start_str, time_str); else - body = g_strdup_printf ("<b>%s</b>\n%s %s", organiser.cn, start_str, time_str); + body = g_strdup_printf ( + "<b>%s</b>\n%s %s", + organiser.cn, start_str, time_str); } else { if (location) - body = g_strdup_printf ("%s %s\n%s %s", _("Location:"), location, start_str, time_str); + body = g_strdup_printf ( + "%s %s\n%s %s", _("Location:"), + location, start_str, time_str); else - body = g_strdup_printf ("%s %s", start_str, time_str); + body = g_strdup_printf ( + "%s %s", start_str, time_str); } #ifdef HAVE_LIBNOTIFY_07 @@ -1759,7 +1794,8 @@ procedure_notification_dialog (const gchar *cmd, const gchar *url) /* Run the dialog */ btn = gtk_dialog_run (GTK_DIALOG (dialog)); - if (btn == GTK_RESPONSE_OK && gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox))) + if (btn == GTK_RESPONSE_OK && + gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (checkbox))) config_data_save_blessed_program (url); gtk_widget_destroy (dialog); @@ -1937,7 +1973,8 @@ alarm_queue_done (void) debug (("...")); - g_hash_table_foreach_remove (client_alarms_hash, (GHRFunc) free_client_alarms_cb, NULL); + g_hash_table_foreach_remove ( + client_alarms_hash, (GHRFunc) free_client_alarms_cb, NULL); g_hash_table_destroy (client_alarms_hash); client_alarms_hash = NULL; @@ -2007,7 +2044,8 @@ alarm_queue_add_async (struct _alarm_client_msg *msg) g_hash_table_insert (client_alarms_hash, client, ca); - ca->uid_alarms_hash = g_hash_table_new ((GHashFunc) hash_ids, (GEqualFunc) compare_ids); + ca->uid_alarms_hash = g_hash_table_new ( + (GHashFunc) hash_ids, (GEqualFunc) compare_ids); if (e_cal_get_load_state (client) == E_CAL_LOAD_LOADED) { load_alarms_for_today (ca); @@ -2160,8 +2198,8 @@ alarm_queue_remove_client (ECal *client, gboolean immediately) message_push ((Message *) msg); } -/* Update non-time related variables for various structures on modification of an existing component - to be called only from query_objects_changed_cb */ +/* Update non-time related variables for various structures on modification + * of an existing component to be called only from query_objects_changed_cb */ static void update_cqa (CompQueuedAlarms *cqa, ECalComponent *newcomp) { @@ -2221,9 +2259,13 @@ update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa) GSList *instance_list; debug (("...")); - for (instance_list = alarms->alarms; instance_list; instance_list = instance_list->next) { + for (instance_list = alarms->alarms; + instance_list; + instance_list = instance_list->next) { al_inst = instance_list->data; - if (al_inst->trigger == qa->orig_trigger) { /* FIXME if two or more alarm instances (audio, note) for same component have same trigger */ + /* FIXME If two or more alarm instances (audio, note) + * for same component have same trigger... */ + if (al_inst->trigger == qa->orig_trigger) { g_free ((gchar *) qa->instance->auid); qa->instance->auid = g_strdup (al_inst->auid); break; diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c index eea273cf62..2aab3cee71 100644 --- a/calendar/gui/alarm-notify/config-data.c +++ b/calendar/gui/alarm-notify/config-data.c @@ -402,8 +402,8 @@ config_data_init_debugging (void) } /* returns whether started debugging; - call config_data_stop_debugging() when started and you are done with it -*/ + * call config_data_stop_debugging() when started and you are done with it + */ gboolean config_data_start_debugging (void) { diff --git a/calendar/gui/alarm-notify/config-data.h b/calendar/gui/alarm-notify/config-data.h index e956f508a0..2a40950a00 100644 --- a/calendar/gui/alarm-notify/config-data.h +++ b/calendar/gui/alarm-notify/config-data.h @@ -51,7 +51,7 @@ void config_data_stop_debugging (void); #define debug(x) G_STMT_START { \ if (config_data_start_debugging ()) { \ g_print ("%s (%s): ", G_STRFUNC, G_STRLOC); \ - g_print x ; \ + g_print x; \ g_print ("\n"); \ \ config_data_stop_debugging (); \ diff --git a/calendar/gui/dialogs/send-comp.c b/calendar/gui/dialogs/send-comp.c index a965c3d4da..ab80844b32 100644 --- a/calendar/gui/dialogs/send-comp.c +++ b/calendar/gui/dialogs/send-comp.c @@ -43,7 +43,6 @@ component_has_new_attendees (ECalComponent *comp) return g_object_get_data (G_OBJECT (comp), "new-attendees") != NULL; } - static gboolean component_has_recipients (ECalComponent *comp) { diff --git a/calendar/gui/e-cal-config.h b/calendar/gui/e-cal-config.h index 68dca3e3aa..73514ec220 100644 --- a/calendar/gui/e-cal-config.h +++ b/calendar/gui/e-cal-config.h @@ -65,11 +65,14 @@ struct _ECalConfigTargetPrefs { typedef struct _EConfigItem ECalConfigItem; -GType e_cal_config_get_type (void); -ECalConfig *e_cal_config_new (gint type, const gchar *menuid); - -ECalConfigTargetSource *e_cal_config_target_new_source (ECalConfig *ecp, struct _ESource *source); -ECalConfigTargetPrefs *e_cal_config_target_new_prefs (ECalConfig *ecp); +GType e_cal_config_get_type (void); +ECalConfig * e_cal_config_new (gint type, + const gchar *menuid); +ECalConfigTargetSource * + e_cal_config_target_new_source (ECalConfig *ecp, + ESource *source); +ECalConfigTargetPrefs * + e_cal_config_target_new_prefs (ECalConfig *ecp); G_END_DECLS diff --git a/calendar/gui/e-date-time-list.c b/calendar/gui/e-date-time-list.c index 0b6afa34a6..bb089f1dd9 100644 --- a/calendar/gui/e-date-time-list.c +++ b/calendar/gui/e-date-time-list.c @@ -31,9 +31,11 @@ * one-column list store? There's no mention of why this was done. */ #define G_LIST(x) ((GList *) x) -#define E_DATE_TIME_LIST_IS_SORTED(list) (E_DATE_TIME_LIST (list)->sort_column_id != -2) -#define IS_VALID_ITER(dt_list, iter) (iter!= NULL && iter->user_data != NULL && \ - dt_list->stamp == iter->stamp) +#define E_DATE_TIME_LIST_IS_SORTED(list) \ + (E_DATE_TIME_LIST (list)->sort_column_id != -2) +#define IS_VALID_ITER(dt_list, iter) \ + (iter != NULL && iter->user_data != NULL && \ + dt_list->stamp == iter->stamp) enum { PROP_0, @@ -74,7 +76,8 @@ copy_datetime (const ECalComponentDateTime *datetime) } static gint -compare_datetime (const ECalComponentDateTime *datetime1, const ECalComponentDateTime *datetime2) +compare_datetime (const ECalComponentDateTime *datetime1, + const ECalComponentDateTime *datetime2) { return icaltime_compare (*datetime1->value, *datetime2->value); } @@ -494,7 +497,9 @@ e_date_time_list_set_date_time (EDateTimeList *date_time_list, GtkTreeIter *iter datetime_old = G_LIST (iter->user_data)->data; free_datetime (datetime_old); G_LIST (iter->user_data)->data = copy_datetime (datetime); - row_updated (date_time_list, g_list_position (date_time_list->list, G_LIST (iter->user_data))); + row_updated ( + date_time_list, g_list_position ( + date_time_list->list, G_LIST (iter->user_data))); } gboolean @@ -522,8 +527,11 @@ e_date_time_list_append (EDateTimeList *date_time_list, GtkTreeIter *iter, { g_return_if_fail (datetime != NULL); - if (g_list_find_custom (date_time_list->list, datetime, (GCompareFunc)compare_datetime) == NULL) { - date_time_list->list = g_list_append (date_time_list->list, copy_datetime (datetime)); + if (g_list_find_custom ( + date_time_list->list, datetime, + (GCompareFunc)compare_datetime) == NULL) { + date_time_list->list = g_list_append ( + date_time_list->list, copy_datetime (datetime)); row_added (date_time_list, g_list_length (date_time_list->list) - 1); } @@ -542,7 +550,8 @@ e_date_time_list_remove (EDateTimeList *date_time_list, GtkTreeIter *iter) n = g_list_position (date_time_list->list, G_LIST (iter->user_data)); free_datetime ((ECalComponentDateTime *) G_LIST (iter->user_data)->data); - date_time_list->list = g_list_delete_link (date_time_list->list, G_LIST (iter->user_data)); + date_time_list->list = g_list_delete_link ( + date_time_list->list, G_LIST (iter->user_data)); row_deleted (date_time_list, n); } diff --git a/calendar/gui/e-day-view-time-item.c b/calendar/gui/e-day-view-time-item.c index 2340f25220..cfe808f806 100644 --- a/calendar/gui/e-day-view-time-item.c +++ b/calendar/gui/e-day-view-time-item.c @@ -274,14 +274,14 @@ e_day_view_time_item_update (GnomeCanvasItem *item, * DRAWING ROUTINES - functions to paint the canvas item. */ static void -edvti_draw_zone (GnomeCanvasItem *canvas_item, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height, - gint x_offset, - icaltimezone *use_zone) +edvti_draw_zone (GnomeCanvasItem *canvas_item, + cairo_t *cr, + gint x, + gint y, + gint width, + gint height, + gint x_offset, + icaltimezone *use_zone) { EDayView *day_view; EDayViewTimeItem *time_item; @@ -604,11 +604,11 @@ edvti_draw_zone (GnomeCanvasItem *canvas_item, static void e_day_view_time_item_draw (GnomeCanvasItem *canvas_item, - cairo_t *cr, - gint x, - gint y, - gint width, - gint height) + cairo_t *cr, + gint x, + gint y, + gint width, + gint height) { EDayViewTimeItem *time_item; diff --git a/calendar/gui/e-day-view.c b/calendar/gui/e-day-view.c index a548b764c0..f881fc99e7 100644 --- a/calendar/gui/e-day-view.c +++ b/calendar/gui/e-day-view.c @@ -4627,7 +4627,7 @@ e_day_view_check_layout (EDayView *day_view) || day_view->long_events_need_reshape) e_day_view_reshape_long_events (day_view); - if (day_view->long_events_need_layout + if (day_view->long_events_need_layout && day_view->rows_in_top_display != rows_in_top_display) { day_view->rows_in_top_display = rows_in_top_display; e_day_view_update_top_scroll (day_view, FALSE); diff --git a/calendar/gui/e-meeting-store.c b/calendar/gui/e-meeting-store.c index db1a8efa4b..ccf8fe255b 100644 --- a/calendar/gui/e-meeting-store.c +++ b/calendar/gui/e-meeting-store.c @@ -826,7 +826,8 @@ e_meeting_store_init (EMeetingStore *store) store->priv->attendees = g_ptr_array_new (); store->priv->refresh_queue = g_ptr_array_new (); - store->priv->refresh_data = g_hash_table_new_full (g_str_hash, g_str_equal, g_free, NULL); + store->priv->refresh_data = g_hash_table_new_full ( + g_str_hash, g_str_equal, g_free, NULL); store->priv->mutex = g_mutex_new (); @@ -1708,7 +1709,11 @@ async_read (GObject *source_object, GAsyncResult *res, gpointer data) } static void -soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gboolean retrying, gpointer data) +soup_authenticate (SoupSession *session, + SoupMessage *msg, + SoupAuth *auth, + gboolean retrying, + gpointer data) { SoupURI *suri; const gchar *orig_uri; @@ -1757,7 +1762,10 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool description = g_string_new (""); - g_string_append_printf (description, _("Enter password to access free/busy information on server %s as user %s"), bold_host, bold_user); + g_string_append_printf ( + description, _("Enter password to access " + "free/busy information on server %s as user %s"), + bold_host, bold_user); g_free (bold_host); g_free (bold_user); @@ -1767,9 +1775,12 @@ soup_authenticate (SoupSession *session, SoupMessage *msg, SoupAuth *auth, gbool g_string_append_printf (description, _("Failure reason: %s"), msg->reason_phrase); } - password = e_passwords_ask_password (_("Enter password"), "Calendar", orig_uri, description->str, - E_PASSWORDS_REMEMBER_FOREVER | E_PASSWORDS_SECRET | E_PASSWORDS_ONLINE | (retrying ? E_PASSWORDS_REPROMPT : 0), - &remember, NULL); + password = e_passwords_ask_password ( + _("Enter password"), "Calendar", orig_uri, + description->str, E_PASSWORDS_REMEMBER_FOREVER | + E_PASSWORDS_SECRET | E_PASSWORDS_ONLINE | + (retrying ? E_PASSWORDS_REPROMPT : 0), + &remember, NULL); g_string_free (description, TRUE); @@ -1822,12 +1833,17 @@ soup_msg_ready_cb (SoupSession *session, SoupMessage *msg, gpointer user_data) g_return_if_fail (qdata != NULL); if (SOUP_STATUS_IS_SUCCESSFUL (msg->status_code)) { - qdata->string = g_string_new_len (msg->response_body->data, msg->response_body->length); + qdata->string = g_string_new_len ( + msg->response_body->data, + msg->response_body->length); process_free_busy (qdata, qdata->string->str); } else { - g_warning ("Unable to access free/busy url: %s", - msg->reason_phrase && *msg->reason_phrase ? msg->reason_phrase : - (soup_status_get_phrase (msg->status_code) ? soup_status_get_phrase (msg->status_code) : "Unknown error")); + g_warning ( + "Unable to access free/busy url: %s", + msg->reason_phrase && *msg->reason_phrase ? + msg->reason_phrase : (soup_status_get_phrase ( + msg->status_code) ? soup_status_get_phrase ( + msg->status_code) : "Unknown error")); process_callbacks (qdata); } } @@ -1867,7 +1883,9 @@ download_with_libsoup (const gchar *uri, EMeetingStoreQueueData *qdata) g_object_unref (proxy); soup_message_set_flags (msg, SOUP_MESSAGE_NO_REDIRECT); - soup_message_add_header_handler (msg, "got_body", "Location", G_CALLBACK (redirect_handler), session); + soup_message_add_header_handler ( + msg, "got_body", "Location", + G_CALLBACK (redirect_handler), session); soup_message_headers_append (msg->request_headers, "Connection", "close"); soup_session_queue_message (session, msg, soup_msg_ready_cb, qdata); } diff --git a/calendar/gui/itip-utils.c b/calendar/gui/itip-utils.c index 05b5f0a24a..7b50de9cf1 100644 --- a/calendar/gui/itip-utils.c +++ b/calendar/gui/itip-utils.c @@ -87,7 +87,9 @@ itip_organizer_is_user_ex (ECalComponent *comp, ECal *client, gboolean skip_cap_ const gchar *strip; gboolean user_org = FALSE; - if (!e_cal_component_has_organizer (comp) || (!skip_cap_test && e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_ORGANIZER))) + if (!e_cal_component_has_organizer (comp) || + (!skip_cap_test && e_cal_get_static_capability ( + client, CAL_STATIC_CAPABILITY_NO_ORGANIZER))) return FALSE; e_cal_component_get_organizer (comp, &organizer); @@ -95,10 +97,12 @@ itip_organizer_is_user_ex (ECalComponent *comp, ECal *client, gboolean skip_cap_ strip = itip_strip_mailto (organizer.value); - if (e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) { + if (e_cal_get_static_capability ( + client, CAL_STATIC_CAPABILITY_ORGANIZER_NOT_EMAIL_ADDRESS)) { gchar *email = NULL; - if (e_cal_get_cal_address (client, &email, NULL) && !g_ascii_strcasecmp (email, strip)) { + if (e_cal_get_cal_address (client, &email, NULL) && + !g_ascii_strcasecmp (email, strip)) { g_free (email); return TRUE; @@ -108,7 +112,9 @@ itip_organizer_is_user_ex (ECalComponent *comp, ECal *client, gboolean skip_cap_ return FALSE; } - user_org = e_account_list_find (itip_addresses_get (), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; + user_org = e_account_list_find ( + itip_addresses_get (), + E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; } return user_org; @@ -127,13 +133,17 @@ itip_sentby_is_user (ECalComponent *comp, ECal *client) const gchar *strip; gboolean user_sentby = FALSE; - if (!e_cal_component_has_organizer (comp) ||e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_NO_ORGANIZER)) + if (!e_cal_component_has_organizer (comp) || + e_cal_get_static_capability ( + client, CAL_STATIC_CAPABILITY_NO_ORGANIZER)) return FALSE; e_cal_component_get_organizer (comp, &organizer); if (organizer.sentby != NULL) { strip = itip_strip_mailto (organizer.sentby); - user_sentby = e_account_list_find (itip_addresses_get (), E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; + user_sentby = e_account_list_find ( + itip_addresses_get (), + E_ACCOUNT_FIND_ID_ADDRESS, strip) != NULL; } return user_sentby; @@ -166,7 +176,8 @@ get_attendee_if_attendee_sentby_is_user (GSList *attendees, gchar *address) for (l = attendees; l; l = l->next) { ECalComponentAttendee *attendee = l->data; - if (attendee->sentby && g_str_equal (itip_strip_mailto (attendee->sentby), address)) { + if (attendee->sentby && g_str_equal ( + itip_strip_mailto (attendee->sentby), address)) { return attendee; } } @@ -327,12 +338,16 @@ foreach_tzid_callback (icalparameter *param, gpointer data) if (!vtimezone_comp) return; - icalcomponent_add_component (tz_data->icomp, icalcomponent_new_clone (vtimezone_comp)); + icalcomponent_add_component ( + tz_data->icomp, icalcomponent_new_clone (vtimezone_comp)); g_hash_table_insert (tz_data->tzids, (gchar *)tzid, (gchar *)tzid); } static icalcomponent * -comp_toplevel_with_zones (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, icalcomponent *zones) +comp_toplevel_with_zones (ECalComponentItipMethod method, + ECalComponent *comp, + ECal *client, + icalcomponent *zones) { icalcomponent *top_level, *icomp; icalproperty *prop; @@ -426,7 +441,11 @@ comp_from (ECalComponentItipMethod method, ECalComponent *comp) } static EDestination ** -comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, gboolean reply_all, const GSList *only_attendees) +comp_to_list (ECalComponentItipMethod method, + ECalComponent *comp, + GList *users, + gboolean reply_all, + const GSList *only_attendees) { ECalComponentOrganizer organizer; GSList *attendees, *l; @@ -481,7 +500,9 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, else if (att->status == ICAL_PARTSTAT_DELEGATED && (att->delto && *att->delto) && !(att->rsvp) && method == E_CAL_COMPONENT_METHOD_REQUEST) continue; - else if (only_attendees && !comp_editor_have_in_new_attendees_lst (only_attendees, itip_strip_mailto (att->value))) + else if (only_attendees && + !comp_editor_have_in_new_attendees_lst ( + only_attendees, itip_strip_mailto (att->value))) continue; destination = e_destination_new (); @@ -514,7 +535,9 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, if (att->cutype != ICAL_CUTYPE_INDIVIDUAL && att->cutype != ICAL_CUTYPE_GROUP) continue; - else if (only_attendees && !comp_editor_have_in_new_attendees_lst (only_attendees, itip_strip_mailto (att->value))) + else if (only_attendees && + !comp_editor_have_in_new_attendees_lst ( + only_attendees, itip_strip_mailto (att->value))) continue; destination = e_destination_new (); @@ -570,7 +593,10 @@ comp_to_list (ECalComponentItipMethod method, ECalComponent *comp, GList *users, if (att->cutype != ICAL_CUTYPE_INDIVIDUAL && att->cutype != ICAL_CUTYPE_GROUP) continue; - if (!g_ascii_strcasecmp (itip_strip_mailto (att->value), sender) || (att->sentby && !g_ascii_strcasecmp (itip_strip_mailto (att->sentby), sender))) { + if (!g_ascii_strcasecmp ( + itip_strip_mailto (att->value), sender) || + (att->sentby && !g_ascii_strcasecmp ( + itip_strip_mailto (att->sentby), sender))) { if (!(att->delfrom && *att->delfrom)) break; @@ -660,7 +686,10 @@ comp_subject (ECalComponentItipMethod method, ECalComponent *comp) for (l = alist; l != NULL; l = l->next) { a = l->data; - if ((sender && *sender) && (g_ascii_strcasecmp (itip_strip_mailto (a->value), sender) || (a->sentby && g_ascii_strcasecmp (itip_strip_mailto (a->sentby), sender)))) + if ((sender && *sender) && (g_ascii_strcasecmp ( + itip_strip_mailto (a->value), sender) || + (a->sentby && g_ascii_strcasecmp ( + itip_strip_mailto (a->sentby), sender)))) break; } g_free (sender); @@ -816,8 +845,11 @@ comp_description (ECalComponent *comp, } static gboolean -comp_server_send (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, - icalcomponent *zones, GList **users) +comp_server_send (ECalComponentItipMethod method, + ECalComponent *comp, + ECal *client, + icalcomponent *zones, + GList **users) { icalcomponent *top_level, *returned_icalcomp = NULL; gboolean retval = TRUE; @@ -828,9 +860,14 @@ comp_server_send (ECalComponentItipMethod method, ECalComponent *comp, ECal *cli /* FIXME Really need a book problem status code */ if (error->code != E_CALENDAR_STATUS_OK) { if (error->code == E_CALENDAR_STATUS_OBJECT_ID_ALREADY_EXISTS) { - e_notice (NULL, GTK_MESSAGE_ERROR, _("Unable to book a resource, the new event collides with some other.")); + e_notice ( + NULL, GTK_MESSAGE_ERROR, + _("Unable to book a resource, the " + "new event collides with some other.")); } else { - gchar *msg = g_strconcat (_("Unable to book a resource, error: "), error->message, NULL); + gchar *msg = g_strconcat ( + _("Unable to book a resource, error: "), + error->message, NULL); e_notice (NULL, GTK_MESSAGE_ERROR, msg); g_free (msg); } @@ -881,7 +918,10 @@ comp_limit_attendees (ECalComponent *comp) attendee_text = g_strdup (itip_strip_mailto (attendee)); g_free (attendee); attendee_text = g_strstrip (attendee_text); - found = match = e_account_list_find (itip_addresses_get (), E_ACCOUNT_FIND_ID_ADDRESS, attendee_text) != NULL; + found = match = e_account_list_find ( + itip_addresses_get (), + E_ACCOUNT_FIND_ID_ADDRESS, + attendee_text) != NULL; if (!found) { param = icalproperty_get_first_parameter (prop, ICAL_SENTBY_PARAMETER); @@ -889,7 +929,10 @@ comp_limit_attendees (ECalComponent *comp) attendee_sentby = icalparameter_get_sentby (param); attendee_sentby_text = g_strdup (itip_strip_mailto (attendee_sentby)); attendee_sentby_text = g_strstrip (attendee_sentby_text); - found = match = e_account_list_find (itip_addresses_get (), E_ACCOUNT_FIND_ID_ADDRESS, attendee_sentby_text) != NULL; + found = match = e_account_list_find ( + itip_addresses_get (), + E_ACCOUNT_FIND_ID_ADDRESS, + attendee_sentby_text) != NULL; } } @@ -938,7 +981,10 @@ comp_sentby (ECalComponent *comp, ECal *client) for (l = attendees; l; l = l->next) { ECalComponentAttendee *a = l->data; - if (!g_ascii_strcasecmp (itip_strip_mailto (a->value), user) || (a->sentby && !g_ascii_strcasecmp (itip_strip_mailto (a->sentby), user))) { + if (!g_ascii_strcasecmp ( + itip_strip_mailto (a->value), user) || + (a->sentby && !g_ascii_strcasecmp ( + itip_strip_mailto (a->sentby), user))) { g_free (user); return; } @@ -1273,7 +1319,10 @@ find_enabled_account (EAccountList *accounts, const gchar *id_address) } static void -setup_from (ECalComponentItipMethod method, ECalComponent *comp, ECal *client, EComposerHeaderTable *table) +setup_from (ECalComponentItipMethod method, + ECalComponent *comp, + ECal *client, + EComposerHeaderTable *table) { EAccountList *accounts; @@ -1350,7 +1399,9 @@ itip_send_comp (ECalComponentItipMethod method, } /* check whether backend could handle sending requests/updates */ - if (method != E_CAL_COMPONENT_METHOD_PUBLISH && e_cal_get_static_capability (client, CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) { + if (method != E_CAL_COMPONENT_METHOD_PUBLISH && + e_cal_get_static_capability (client, + CAL_STATIC_CAPABILITY_CREATE_MESSAGES)) { if (users) { g_list_foreach (users, (GFunc) g_free, NULL); g_list_free (users); @@ -1366,7 +1417,10 @@ itip_send_comp (ECalComponentItipMethod method, goto cleanup; /* Recipients */ - destinations = comp_to_list (method, comp, users, FALSE, only_new_attendees ? g_object_get_data (G_OBJECT (send_comp), "new-attendees") : NULL); + destinations = comp_to_list ( + method, comp, users, FALSE, + only_new_attendees ? g_object_get_data ( + G_OBJECT (send_comp), "new-attendees") : NULL); if (method != E_CAL_COMPONENT_METHOD_PUBLISH) { if (destinations == NULL) { /* We sent them all via the server */ @@ -1550,7 +1604,10 @@ reply_to_calendar_comp (ECalComponentItipMethod method, start_zone = icaltimezone_get_builtin_timezone_from_tzid (dtstart.tzid); if (!start_zone) { if (!e_cal_get_timezone (client, dtstart.tzid, &start_zone, NULL)) - g_warning ("Couldn't get timezone from server: %s", dtstart.tzid ? dtstart.tzid : ""); + g_warning ( + "Couldn't get timezone from " + "server: %s", dtstart.tzid ? + dtstart.tzid : ""); } if (!start_zone || dtstart.value->is_date) @@ -1560,7 +1617,10 @@ reply_to_calendar_comp (ECalComponentItipMethod method, time = g_strdup (ctime (&start)); } - body = g_string_new ("<br><br><hr><br><b>______ Original Appointment ______ </b><br><br><table>"); + body = g_string_new ( + "<br><br><hr><br><b>" + "______ Original Appointment ______ " + "</b><br><br><table>"); if (orig_from && *orig_from) g_string_append_printf (body, @@ -1841,7 +1901,8 @@ check_time (const struct icaltimetype tmval, gboolean can_null_time) tmval.second >= 0 && tmval.second < 60; } -/* returns whether the passed-in icalcomponent is valid or not. It does some sanity checks on values too. */ +/* Returns whether the passed-in icalcomponent is valid or not. + * It does some sanity checks on values too. */ gboolean is_icalcomp_valid (icalcomponent *icalcomp) { diff --git a/calendar/gui/print.c b/calendar/gui/print.c index 5c62d3c111..804330cac0 100644 --- a/calendar/gui/print.c +++ b/calendar/gui/print.c @@ -528,7 +528,14 @@ titled_box (GtkPrintContext *context, const gchar *text, static gboolean get_show_week_numbers (void) { - return e_shell_settings_get_boolean (e_shell_get_shell_settings (e_shell_get_default ()), "cal-show-week-numbers"); + EShell *shell; + EShellSettings *shell_settings; + + shell = e_shell_get_default (); + shell_settings = e_shell_get_shell_settings (shell); + + return e_shell_settings_get_boolean ( + shell_settings, "cal-show-week-numbers"); } enum datefmt { @@ -614,14 +621,17 @@ calc_small_month_width (GtkPrintContext *context, gdouble for_height) gint ii; font_bold = get_font_for_size (for_height / 7.4, PANGO_WEIGHT_BOLD); - res = MAX (evo_calendar_print_renderer_get_width (context, font_bold, "23"), res); + res = MAX (evo_calendar_print_renderer_get_width ( + context, font_bold, "23"), res); for (ii = 0; ii < 7; ii++) { - res = MAX (evo_calendar_print_renderer_get_width (context, font_bold, _(daynames[ii])), res); + res = MAX (evo_calendar_print_renderer_get_width ( + context, font_bold, _(daynames[ii])), res); } pango_font_description_free (font_bold); - /* res is max cell width, thus multiply it with column count plus some space between columns */ + /* res is max cell width, so multiply it with column + * count plus some space between columns. */ res = (res + 1.0) * (7 + (get_show_week_numbers () ? 1 : 0)) - 1.0; if (res < MIN_SMALL_MONTH_WIDTH) @@ -706,7 +716,8 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, print_text ( context, font_bold, _(daynames[weekday]), PANGO_ALIGN_RIGHT, - x1 + (x + (week_numbers ? 1 : 0)) * col_width, x1 + (x + 1 + (week_numbers ? 1 : 0)) * col_width, + x1 + (x + (week_numbers ? 1 : 0)) * col_width, + x1 + (x + 1 + (week_numbers ? 1 : 0)) * col_width, y1, y1 + row_height * 1.4); weekday = (weekday + 1) % 7; } @@ -741,7 +752,11 @@ print_month_small (GtkPrintContext *context, GnomeCalendar *gcal, time_t month, convert_timet_to_struct_tm (week_begin, zone, &tm); /* month in e_calendar_item_get_week_number is also zero-based */ - sprintf (buf, "%d", e_calendar_item_get_week_number (NULL, tm.tm_mday, tm.tm_mon, tm.tm_year + 1900)); + sprintf ( + buf, "%d", + e_calendar_item_get_week_number ( + NULL, tm.tm_mday, tm.tm_mon, + tm.tm_year + 1900)); print_text (context, font_normal, buf, PANGO_ALIGN_RIGHT, cell_left, text_right, @@ -901,9 +916,13 @@ print_day_background (GtkPrintContext *context, GnomeCalendar *gcal, max_font_size = width * 0.2; minute_font_size = MIN (font_size, max_font_size); font_minute = get_font_for_size (minute_font_size, PANGO_WEIGHT_BOLD); - hour_minute_width = evo_calendar_print_renderer_get_width (context, font_minute, use_24_hour ? "00" : _("am")); + hour_minute_width = evo_calendar_print_renderer_get_width ( + context, font_minute, use_24_hour ? "00" : _("am")); if (!use_24_hour) - hour_minute_width = MAX (hour_minute_width, evo_calendar_print_renderer_get_width (context, font_minute, _("pm"))); + hour_minute_width = + MAX (hour_minute_width, + evo_calendar_print_renderer_get_width ( + context, font_minute, _("pm"))); row = 0; hour_minute_x = left + width - hour_minute_width - 3; @@ -2245,7 +2264,9 @@ print_day_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date) 0.0, HEADER_HEIGHT + 4, 1.0, 0.9); /* Print the 2 mini calendar-months. */ - l = width - SMALL_MONTH_PAD - (small_month_width + week_numbers_inc) * 2 - SMALL_MONTH_SPACING; + l = width - SMALL_MONTH_PAD - + (small_month_width + week_numbers_inc) * 2 - + SMALL_MONTH_SPACING; print_month_small (context, gcal, date, l, 2, l + small_month_width + week_numbers_inc, HEADER_HEIGHT + 2, @@ -2338,9 +2359,13 @@ print_work_week_background (GtkPrintContext *context, GnomeCalendar *gcal, max_font_size = width * 0.2; minute_font_size = MIN (font_size, max_font_size); font_minute = get_font_for_size (minute_font_size, PANGO_WEIGHT_BOLD); - hour_minute_xr = evo_calendar_print_renderer_get_width (context, font_minute, use_24_hour ? "00" : _("am")); + hour_minute_xr = evo_calendar_print_renderer_get_width ( + context, font_minute, use_24_hour ? "00" : _("am")); if (!use_24_hour) - hour_minute_xr = MAX (hour_minute_xr, evo_calendar_print_renderer_get_width (context, font_minute, _("pm"))); + hour_minute_xr = + MAX (hour_minute_xr, + evo_calendar_print_renderer_get_width ( + context, font_minute, _("pm"))); row = 0; hour_minute_xl = left + width - hour_minute_xr - 3; @@ -2624,7 +2649,9 @@ print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date GtkPageSetup *setup; icaltimezone *zone; time_t when, start, end; - gdouble width, height, l, small_month_width = calc_small_month_width (context, HEADER_HEIGHT); + gdouble width, height, l; + gdouble small_month_width; + gdouble weeknum_inc; gint i, days = 5; gchar buf[100]; const gint LONG_EVENT_OFFSET = 6; @@ -2632,7 +2659,6 @@ print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date struct tm tm; gdouble day_width, day_x; ECalModel *model; - gdouble weeknum_inc = get_show_week_numbers () ? small_month_width / 7.0 : 0; model = gnome_calendar_get_model (gcal); zone = e_cal_model_get_timezone (model); @@ -2642,6 +2668,9 @@ print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date width = gtk_page_setup_get_page_width (setup, GTK_UNIT_POINTS); height = gtk_page_setup_get_page_height (setup, GTK_UNIT_POINTS); + small_month_width = calc_small_month_width (context, HEADER_HEIGHT); + weeknum_inc = get_show_week_numbers () ? small_month_width / 7.0 : 0; + /* We always start on a Monday */ start = time_week_begin_with_zone (date, 1, zone); end = time_add_day_with_zone (start, days, zone); @@ -2661,7 +2690,8 @@ print_work_week_view (GtkPrintContext *context, GnomeCalendar *gcal, time_t date print_border (context, 0.0, width, 0.0, HEADER_HEIGHT, 1.0, 0.9); /* Print the 2 mini calendar-months. */ - l = width - SMALL_MONTH_PAD - (small_month_width + weeknum_inc) * 2 - SMALL_MONTH_SPACING; + l = width - SMALL_MONTH_PAD - (small_month_width + weeknum_inc) * 2 - + SMALL_MONTH_SPACING; print_month_small (context, gcal, start, l, 4, l + small_month_width + weeknum_inc, HEADER_HEIGHT + 4, diff --git a/calendar/gui/weekday-picker.c b/calendar/gui/weekday-picker.c index 44993724a9..650c2fa1e8 100644 --- a/calendar/gui/weekday-picker.c +++ b/calendar/gui/weekday-picker.c @@ -220,8 +220,8 @@ weekday_picker_realize (GtkWidget *widget) static void weekday_picker_get_preferred_width (GtkWidget *widget, - gint *minimum_width, - gint *natural_width) + gint *minimum_width, + gint *natural_width) { WeekdayPicker *wp; WeekdayPickerPrivate *priv; @@ -231,10 +231,11 @@ weekday_picker_get_preferred_width (GtkWidget *widget, *minimum_width = *natural_width = (priv->max_letter_width + 2 * PADDING + 1) * 7 + 1; } + static void weekday_picker_get_preferred_height (GtkWidget *widget, - gint *minimum_height, - gint *natural_height) + gint *minimum_height, + gint *natural_height) { WeekdayPicker *wp; WeekdayPickerPrivate *priv; @@ -242,7 +243,8 @@ weekday_picker_get_preferred_height (GtkWidget *widget, wp = WEEKDAY_PICKER (widget); priv = wp->priv; - *minimum_height = *natural_height = (priv->font_ascent + priv->font_descent + 2 * PADDING + 2); + *minimum_height = *natural_height = + (priv->font_ascent + priv->font_descent + 2 * PADDING + 2); } static void diff --git a/e-util/e-alert.c b/e-util/e-alert.c index f99ca51c57..4845ce61a3 100644 --- a/e-util/e-alert.c +++ b/e-util/e-alert.c @@ -496,8 +496,8 @@ alert_dispose (GObject *object) while (!g_queue_is_empty (&priv->actions)) { GtkAction *action = g_queue_pop_head (&priv->actions); - g_signal_handlers_disconnect_by_func (action, G_CALLBACK (alert_action_activate), object); - + g_signal_handlers_disconnect_by_func ( + action, G_CALLBACK (alert_action_activate), object); g_object_unref (action); } diff --git a/e-util/e-dialog-widgets.c b/e-util/e-dialog-widgets.c index 87821acd71..0948f2fb61 100644 --- a/e-util/e-dialog-widgets.c +++ b/e-util/e-dialog-widgets.c @@ -169,7 +169,9 @@ e_dialog_combo_box_get (GtkWidget *widget, const gint *value_map) * @text_value: A string to be added to the @list_store **/ void -e_dialog_append_list_store_text (GtkTreeModel *list_store, gint text_column, const gchar *text_value) +e_dialog_append_list_store_text (GtkTreeModel *list_store, + gint text_column, + const gchar *text_value) { GtkTreeIter iter; GtkListStore *store; diff --git a/e-util/e-sorter-array.c b/e-util/e-sorter-array.c index 3e559acb3a..808af66242 100644 --- a/e-util/e-sorter-array.c +++ b/e-util/e-sorter-array.c @@ -245,7 +245,9 @@ e_sorter_array_construct (ESorterArray *esa, } ESorterArray * -e_sorter_array_new (ECreateCmpCacheFunc create_cmp_cache, ECompareRowsFunc compare, gpointer closure) +e_sorter_array_new (ECreateCmpCacheFunc create_cmp_cache, + ECompareRowsFunc compare, + gpointer closure) { ESorterArray *esa = g_object_new (E_SORTER_ARRAY_TYPE, NULL); diff --git a/em-format/em-format-quote.c b/em-format/em-format-quote.c index bdb632b252..e2eb9d382b 100644 --- a/em-format/em-format-quote.c +++ b/em-format/em-format-quote.c @@ -530,9 +530,8 @@ emfq_format_message (EMFormat *emf, cancellable, NULL); } -/* Decodes inline encoded parts of 'part'. The returned pointer, if not NULL, should - be unreffed with g_object_unref(). -*/ +/* Decodes inline encoded parts of 'part'. The returned pointer, + * if not NULL, should be unreffed with g_object_unref(). */ static CamelMimePart * decode_inline_parts (CamelMimePart *part, GCancellable *cancellable) { @@ -547,13 +546,16 @@ decode_inline_parts (CamelMimePart *part, GCancellable *cancellable) filtered_stream = camel_stream_filter_new (null); g_object_unref (null); - inline_filter = em_inline_filter_new (camel_mime_part_get_encoding (part), camel_mime_part_get_content_type (part)); + inline_filter = em_inline_filter_new ( + camel_mime_part_get_encoding (part), + camel_mime_part_get_content_type (part)); camel_stream_filter_add ( CAMEL_STREAM_FILTER (filtered_stream), CAMEL_MIME_FILTER (inline_filter)); camel_data_wrapper_decode_to_stream_sync ( - camel_medium_get_content (CAMEL_MEDIUM (part)), (CamelStream *)filtered_stream, cancellable, NULL); - camel_stream_close ((CamelStream *)filtered_stream, cancellable, NULL); + camel_medium_get_content (CAMEL_MEDIUM (part)), + filtered_stream, cancellable, NULL); + camel_stream_close (filtered_stream, cancellable, NULL); g_object_unref (filtered_stream); if (!em_inline_filter_found_any (inline_filter)) { @@ -567,7 +569,8 @@ decode_inline_parts (CamelMimePart *part, GCancellable *cancellable) if (mp) { part = camel_mime_part_new (); - camel_medium_set_content (CAMEL_MEDIUM (part), CAMEL_DATA_WRAPPER (mp)); + camel_medium_set_content ( + CAMEL_MEDIUM (part), CAMEL_DATA_WRAPPER (mp)); g_object_unref (mp); } else { g_object_ref (part); diff --git a/em-format/em-format.c b/em-format/em-format.c index 43c38c9179..cba7c765bc 100644 --- a/em-format/em-format.c +++ b/em-format/em-format.c @@ -1490,19 +1490,31 @@ add_validity_found (EMFormat *emf, /* ********************************************************************** */ static void -preserve_charset_in_content_type (CamelMimePart *ipart, CamelMimePart *opart) +preserve_charset_in_content_type (CamelMimePart *ipart, + CamelMimePart *opart) { - CamelContentType *ict; + CamelDataWrapper *data_wrapper; + CamelContentType *content_type; + const gchar *charset; g_return_if_fail (ipart != NULL); g_return_if_fail (opart != NULL); - ict = camel_data_wrapper_get_mime_type_field (camel_medium_get_content (CAMEL_MEDIUM (ipart))); - if (!ict || !camel_content_type_param (ict, "charset") || !*camel_content_type_param (ict, "charset")) + data_wrapper = camel_medium_get_content (CAMEL_MEDIUM (ipart)); + content_type = camel_data_wrapper_get_mime_type_field (data_wrapper); + + if (content_type == NULL) + return; + + charset = camel_content_type_param (content_type, "charset"); + + if (charset == NULL || *charset == '\0') return; - camel_content_type_set_param (camel_data_wrapper_get_mime_type_field (camel_medium_get_content (CAMEL_MEDIUM (opart))), - "charset", camel_content_type_param (ict, "charset")); + data_wrapper = camel_medium_get_content (CAMEL_MEDIUM (opart)); + content_type = camel_data_wrapper_get_mime_type_field (data_wrapper); + + camel_content_type_set_param (content_type, "charset", charset); } #ifdef ENABLE_SMIME diff --git a/libgnomecanvas/gnome-canvas-pixbuf.c b/libgnomecanvas/gnome-canvas-pixbuf.c index 6fc3e44fd9..82152bd629 100644 --- a/libgnomecanvas/gnome-canvas-pixbuf.c +++ b/libgnomecanvas/gnome-canvas-pixbuf.c @@ -49,7 +49,9 @@ static void gnome_canvas_pixbuf_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void gnome_canvas_pixbuf_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags); +static void gnome_canvas_pixbuf_update (GnomeCanvasItem *item, + const cairo_matrix_t *i2c, + gint flags); static void gnome_canvas_pixbuf_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height); static GnomeCanvasItem *gnome_canvas_pixbuf_point (GnomeCanvasItem *item, @@ -250,7 +252,8 @@ gnome_canvas_pixbuf_update (GnomeCanvasItem *item, priv = gcp->priv; if (GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->update) - GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)->update (item, i2c, flags); + GNOME_CANVAS_ITEM_CLASS (gnome_canvas_pixbuf_parent_class)-> + update (item, i2c, flags); /* ordinary update logic */ gnome_canvas_request_redraw ( diff --git a/libgnomecanvas/gnome-canvas-rect.c b/libgnomecanvas/gnome-canvas-rect.c index 853992e254..a61c98f3c4 100644 --- a/libgnomecanvas/gnome-canvas-rect.c +++ b/libgnomecanvas/gnome-canvas-rect.c @@ -85,7 +85,9 @@ G_DEFINE_TYPE (GnomeCanvasRect, gnome_canvas_rect, GNOME_TYPE_CANVAS_ITEM) static guint32 get_rgba_from_color (GdkColor *color) { - return ((color->red & 0xff00) << 16) | ((color->green & 0xff00) << 8) | (color->blue & 0xff00) | 0xff; + return ((color->red & 0xff00) << 16) | + ((color->green & 0xff00) << 8) | + (color->blue & 0xff00) | 0xff; } static gboolean diff --git a/libgnomecanvas/gnome-canvas-text.c b/libgnomecanvas/gnome-canvas-text.c index a012c76df8..a9e546a883 100644 --- a/libgnomecanvas/gnome-canvas-text.c +++ b/libgnomecanvas/gnome-canvas-text.c @@ -105,7 +105,9 @@ static void gnome_canvas_text_get_property (GObject *object, GValue *value, GParamSpec *pspec); -static void gnome_canvas_text_update (GnomeCanvasItem *item, const cairo_matrix_t *matrix, gint flags); +static void gnome_canvas_text_update (GnomeCanvasItem *item, + const cairo_matrix_t *matrix, + gint flags); static void gnome_canvas_text_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint height); static GnomeCanvasItem *gnome_canvas_text_point (GnomeCanvasItem *item, @@ -635,7 +637,9 @@ gnome_canvas_text_set_property (GObject *object, text = GNOME_CANVAS_TEXT (object); if (!text->layout) - text->layout = pango_layout_new (gtk_widget_get_pango_context (GTK_WIDGET (item->canvas))); + text->layout = pango_layout_new ( + gtk_widget_get_pango_context ( + GTK_WIDGET (item->canvas))); switch (param_id) { case PROP_TEXT: diff --git a/libgnomecanvas/gnome-canvas.c b/libgnomecanvas/gnome-canvas.c index c28bc824e9..86624f2b99 100644 --- a/libgnomecanvas/gnome-canvas.c +++ b/libgnomecanvas/gnome-canvas.c @@ -160,8 +160,9 @@ gnome_canvas_item_get_type (void) NULL /* value_table */ }; - canvas_item_type = g_type_register_static (G_TYPE_INITIALLY_UNOWNED, "GnomeCanvasItem", - &object_info, 0); + canvas_item_type = g_type_register_static ( + G_TYPE_INITIALLY_UNOWNED, + "GnomeCanvasItem", &object_info, 0); } return canvas_item_type; @@ -1504,7 +1505,7 @@ gnome_canvas_group_draw (GnomeCanvasItem *item, if ((child->flags & GNOME_CANVAS_ITEM_VISIBLE) && ((child->x1 < (x + width)) && (child->y1 < (y + height)) - && (child->x2 > x) + && (child->x2 > x) && (child->y2 > y))) { cairo_save (cr); @@ -2517,7 +2518,9 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) /* find the closest item */ if (canvas->root->flags & GNOME_CANVAS_ITEM_VISIBLE) - canvas->new_current_item = gnome_canvas_item_invoke_point (canvas->root, x, y, cx, cy); + canvas->new_current_item = + gnome_canvas_item_invoke_point ( + canvas->root, x, y, cx, cy); else canvas->new_current_item = NULL; } else diff --git a/mail/e-mail-backend.c b/mail/e-mail-backend.c index 3ab7cbda8d..e598c9388d 100644 --- a/mail/e-mail-backend.c +++ b/mail/e-mail-backend.c @@ -360,8 +360,10 @@ mail_backend_folder_changed_cb (MailFolderCache *folder_cache, gint folder_type; gint flags = 0; - if (mail_folder_cache_get_folder_from_uri (folder_cache, folder_uri, &folder)) - if (folder && !mail_folder_cache_get_folder_info_flags (folder_cache, folder, &flags)) + if (mail_folder_cache_get_folder_from_uri ( + folder_cache, folder_uri, &folder)) + if (folder && !mail_folder_cache_get_folder_info_flags ( + folder_cache, folder, &flags)) g_return_if_reached (); target = em_event_target_new_folder ( diff --git a/mail/e-mail-display.c b/mail/e-mail-display.c index 30608748a1..ae340d9571 100644 --- a/mail/e-mail-display.c +++ b/mail/e-mail-display.c @@ -269,11 +269,19 @@ mail_display_link_clicked (GtkHTML *html, } else if (g_ascii_strncasecmp (uri, "mailto:", 7) == 0) { EMFormat *format = EM_FORMAT (priv->formatter); CamelFolder *folder = NULL; + const gchar *folder_uri = NULL; + EShell *shell; - if (format && format->folder) + if (format != NULL && format->folder != NULL) folder = format->folder; - em_utils_compose_new_message_with_mailto (e_shell_get_default (), uri, folder ? camel_folder_get_uri (folder) : NULL); + if (folder != NULL) + folder_uri = camel_folder_get_uri (folder); + + shell = e_shell_get_default (); + em_utils_compose_new_message_with_mailto ( + shell, uri, folder_uri); + } else if (*uri == '#') gtk_html_jump_to_anchor (html, uri + 1); diff --git a/mail/e-mail-local.c b/mail/e-mail-local.c index d2bb42171d..d1938080d2 100644 --- a/mail/e-mail-local.c +++ b/mail/e-mail-local.c @@ -85,7 +85,7 @@ e_mail_local_init (EMailSession *session, /* FIXME camel_store_get_folder() may block. */ default_local_folders[ii].folder_uri = folder_uri; if (!strcmp (display_name, "Inbox")) - default_local_folders [ii].folder = camel_store_get_inbox_folder_sync ( + default_local_folders[ii].folder = camel_store_get_inbox_folder_sync ( CAMEL_STORE (service), NULL, NULL); else default_local_folders[ii].folder = camel_store_get_folder_sync ( diff --git a/mail/e-mail-migrate.c b/mail/e-mail-migrate.c index 0d650771f7..984cf3558c 100644 --- a/mail/e-mail-migrate.c +++ b/mail/e-mail-migrate.c @@ -741,7 +741,6 @@ migrate_to_db (EShellBackend *shell_backend) #endif - static gboolean mbox_to_maildir_migration_needed (EShellBackend *shell_backend) { diff --git a/mail/e-mail-reader.c b/mail/e-mail-reader.c index 3f1e40af85..c05b392cda 100644 --- a/mail/e-mail-reader.c +++ b/mail/e-mail-reader.c @@ -434,7 +434,8 @@ get_message_checksum (CamelFolder *folder, CamelMimeMessage *msg) buffer = camel_stream_mem_get_byte_array (CAMEL_STREAM_MEM (mem)); if (buffer) - digest = g_compute_checksum_for_data (duplicate_csum, buffer->data, buffer->len); + digest = g_compute_checksum_for_data ( + duplicate_csum, buffer->data, buffer->len); g_object_unref (mem); @@ -453,7 +454,10 @@ message_is_duplicated (GHashTable *messages, guint64 id, gchar *digest) } static void -remove_duplicates_got_messages_cb (CamelFolder *folder, GPtrArray *uids, GPtrArray *msgs, gpointer data) +remove_duplicates_got_messages_cb (CamelFolder *folder, + GPtrArray *uids, + GPtrArray *msgs, + gpointer data) { EMailReader *reader = data; GtkWindow *parent; @@ -461,36 +465,46 @@ remove_duplicates_got_messages_cb (CamelFolder *folder, GPtrArray *uids, GPtrArr GPtrArray *dups; gint ii; - g_return_if_fail (folder != NULL); g_return_if_fail (CAMEL_IS_FOLDER (folder)); g_return_if_fail (uids != NULL); g_return_if_fail (msgs != NULL); g_return_if_fail (msgs->len <= uids->len); - g_return_if_fail (reader != NULL); g_return_if_fail (E_IS_MAIL_READER (reader)); parent = e_mail_reader_get_window (reader); - messages = g_hash_table_new_full (g_int_hash, g_int_equal, g_free, g_free); + messages = g_hash_table_new_full ( + g_int_hash, g_int_equal, g_free, g_free); dups = g_ptr_array_new (); for (ii = 0; ii < msgs->len; ii++) { - CamelMessageInfo *msg_info = camel_folder_get_message_info (folder, uids->pdata[ii]); - const CamelSummaryMessageID *mid = camel_message_info_message_id (msg_info); - guint32 flags = camel_message_info_flags (msg_info); + CamelMessageInfo *msg_info; + const CamelSummaryMessageID *mid; + guint32 flags; + + msg_info = camel_folder_get_message_info ( + folder, uids->pdata[ii]); + mid = camel_message_info_message_id (msg_info); + flags = camel_message_info_flags (msg_info); if (!(flags & CAMEL_MESSAGE_DELETED)) { - gchar *digest = get_message_checksum (folder, msgs->pdata[ii]); + gchar *digest; + + digest = get_message_checksum (folder, msgs->pdata[ii]); - if (digest) { - if (message_is_duplicated (messages, mid->id.id, digest)) { + if (digest != NULL) { + if (message_is_duplicated ( + messages, mid->id.id, digest)) { g_ptr_array_add (dups, uids->pdata[ii]); g_free (digest); } else { guint64 *id; + id = g_new0 (guint64, 1); *id = mid->id.id; - g_hash_table_insert (messages, id, digest); + + g_hash_table_insert ( + messages, id, digest); } } } @@ -499,20 +513,26 @@ remove_duplicates_got_messages_cb (CamelFolder *folder, GPtrArray *uids, GPtrArr } if (dups->len == 0) { - em_utils_prompt_user (parent, NULL, "mail:info-no-remove-duplicates", camel_folder_get_name (folder), NULL); + em_utils_prompt_user ( + parent, NULL, "mail:info-no-remove-duplicates", + camel_folder_get_name (folder), NULL); } else { gchar *msg = g_strdup_printf (ngettext ( /* Translators: %s is replaced with a folder name %d with count of duplicate messages. */ - "Folder '%s' contains %d duplicate message. Are you sure you want to delete it?", - "Folder '%s' contains %d duplicate messages. Are you sure you want to delete them?", + "Folder '%s' contains %d duplicate message. " + "Are you sure you want to delete it?", + "Folder '%s' contains %d duplicate messages. " + "Are you sure you want to delete them?", dups->len), camel_folder_get_name (folder), dups->len); - if (em_utils_prompt_user (parent, NULL, "mail:ask-remove-duplicates", msg, NULL)) { + if (em_utils_prompt_user ( + parent, NULL, "mail:ask-remove-duplicates", msg, NULL)) { camel_folder_freeze (folder); for (ii = 0; ii < dups->len; ii++) - camel_folder_delete_message (folder, g_ptr_array_index (dups, ii)); + camel_folder_delete_message ( + folder, g_ptr_array_index (dups, ii)); camel_folder_thaw (folder); } @@ -539,7 +559,9 @@ action_mail_remove_duplicates (GtkAction *action, EMailReader *reader) em_utils_uids_free (uids); } else { /* the function itself is freeing uids */ - mail_get_messages (folder, uids, remove_duplicates_got_messages_cb, reader); + mail_get_messages ( + folder, uids, + remove_duplicates_got_messages_cb, reader); } } @@ -3012,12 +3034,18 @@ mail_reader_update_actions (EMailReader *reader, MessageList *message_list; gint row = -1, count = -1; ETreeTableAdapter *etta; - ETreePath node; + ETreePath node = NULL; - message_list = MESSAGE_LIST (e_mail_reader_get_message_list (reader)); + message_list = MESSAGE_LIST ( + e_mail_reader_get_message_list (reader)); etta = e_tree_get_table_adapter (E_TREE (message_list)); - if (message_list->cursor_uid != NULL && (node = g_hash_table_lookup (message_list->uid_nodemap, message_list->cursor_uid)) != NULL) { + if (message_list->cursor_uid != NULL) + node = g_hash_table_lookup ( + message_list->uid_nodemap, + message_list->cursor_uid); + + if (node != NULL) { row = e_tree_table_adapter_row_of_node (etta, node); count = e_table_model_row_count (E_TABLE_MODEL (etta)); } diff --git a/mail/e-mail-session.c b/mail/e-mail-session.c index 706fa2647e..7c9a8e041a 100644 --- a/mail/e-mail-session.c +++ b/mail/e-mail-session.c @@ -313,7 +313,8 @@ main_get_filter_driver (CamelSession *session, if (ms->priv->filter_logfile == NULL) { gchar *filename; - filename = gconf_client_get_string (client, "/apps/evolution/mail/filters/logfile", NULL); + filename = gconf_client_get_string ( + client, "/apps/evolution/mail/filters/logfile", NULL); if (filename) { ms->priv->filter_logfile = g_fopen (filename, "a+"); g_free (filename); @@ -328,10 +329,14 @@ main_get_filter_driver (CamelSession *session, camel_filter_driver_set_play_sound_func (driver, session_play_sound, NULL); camel_filter_driver_set_system_beep_func (driver, session_system_beep, NULL); - if ((!strcmp (type, E_FILTER_SOURCE_INCOMING) || !strcmp (type, E_FILTER_SOURCE_JUNKTEST)) - && camel_session_get_check_junk (session)) { + if ((!strcmp (type, E_FILTER_SOURCE_INCOMING) || + !strcmp (type, E_FILTER_SOURCE_JUNKTEST)) + && camel_session_get_check_junk (session)) { + /* implicit junk check as 1st rule */ - camel_filter_driver_add_rule (driver, "Junk check", "(junk-test)", "(begin (set-system-flag \"junk\"))"); + camel_filter_driver_add_rule ( + driver, "Junk check", "(junk-test)", + "(begin (set-system-flag \"junk\"))"); } if (strcmp (type, E_FILTER_SOURCE_JUNKTEST) != 0) { @@ -397,8 +402,8 @@ ms_forward_to_cb (CamelFolder *folder, client = gconf_client_get_default (); /* do not call mail send immediately, just pile them all in the outbox */ - if (preparing_flush || - gconf_client_get_bool (client, "/apps/evolution/mail/filters/flush-outbox", NULL)) { + if (preparing_flush || gconf_client_get_bool ( + client, "/apps/evolution/mail/filters/flush-outbox", NULL)) { if (preparing_flush) g_source_remove (preparing_flush); @@ -668,12 +673,15 @@ mail_session_get_password (CamelSession *session, eflags |= E_PASSWORDS_PASSPHRASE; /* HACK: breaks abstraction ... - e_account_writable doesn't use the eaccount, it also uses the same writable key for - source and transport */ + * e_account_writable() doesn't use the + * EAccount, it also uses the same writable + * key for source and transport. */ if (!e_account_writable (NULL, E_ACCOUNT_SOURCE_SAVE_PASSWD)) eflags |= E_PASSWORDS_DISABLE_REMEMBER; - ret = e_passwords_ask_password (title, domain, key, prompt, eflags, &remember, NULL); + ret = e_passwords_ask_password ( + title, domain, key, prompt, + eflags, &remember, NULL); if (!ret) e_passwords_forget_password (domain, key); @@ -855,6 +863,8 @@ mail_session_forward_to (CamelSession *session, CamelInternetAddress *addr; CamelFolder *out_folder; CamelMessageInfo *info; + CamelMedium *medium; + const gchar *header_name; struct _camel_header_raw *xev; gchar *subject; @@ -883,25 +893,37 @@ mail_session_forward_to (CamelSession *session, /* make copy of the message, because we are going to modify it */ mem = camel_stream_mem_new (); - camel_data_wrapper_write_to_stream_sync ((CamelDataWrapper *)message, mem, NULL, NULL); + camel_data_wrapper_write_to_stream_sync ( + CAMEL_DATA_WRAPPER (message), mem, NULL, NULL); g_seekable_seek (G_SEEKABLE (mem), 0, G_SEEK_SET, NULL, NULL); - camel_data_wrapper_construct_from_stream_sync ((CamelDataWrapper *)forward, mem, NULL, NULL); + camel_data_wrapper_construct_from_stream_sync ( + CAMEL_DATA_WRAPPER (forward), mem, NULL, NULL); g_object_unref (mem); /* clear previous recipients */ - camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_TO, NULL); - camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_CC, NULL); - camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_BCC, NULL); - camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_RESENT_TO, NULL); - camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_RESENT_CC, NULL); - camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_RESENT_BCC, NULL); + camel_mime_message_set_recipients ( + forward, CAMEL_RECIPIENT_TYPE_TO, NULL); + camel_mime_message_set_recipients ( + forward, CAMEL_RECIPIENT_TYPE_CC, NULL); + camel_mime_message_set_recipients ( + forward, CAMEL_RECIPIENT_TYPE_BCC, NULL); + camel_mime_message_set_recipients ( + forward, CAMEL_RECIPIENT_TYPE_RESENT_TO, NULL); + camel_mime_message_set_recipients ( + forward, CAMEL_RECIPIENT_TYPE_RESENT_CC, NULL); + camel_mime_message_set_recipients ( + forward, CAMEL_RECIPIENT_TYPE_RESENT_BCC, NULL); + + medium = CAMEL_MEDIUM (forward); /* remove all delivery and notification headers */ - while (camel_medium_get_header (CAMEL_MEDIUM (forward), "Disposition-Notification-To")) - camel_medium_remove_header (CAMEL_MEDIUM (forward), "Disposition-Notification-To"); + header_name = "Disposition-Notification-To"; + while (camel_medium_get_header (medium, header_name)) + camel_medium_remove_header (medium, header_name); - while (camel_medium_get_header (CAMEL_MEDIUM (forward), "Delivered-To")) - camel_medium_remove_header (CAMEL_MEDIUM (forward), "Delivered-To"); + header_name = "Delivered-To"; + while (camel_medium_get_header (medium, header_name)) + camel_medium_remove_header (medium, header_name); /* remove any X-Evolution-* headers that may have been set */ xev = mail_tool_remove_xevolution_headers (forward); @@ -909,14 +931,16 @@ mail_session_forward_to (CamelSession *session, /* from */ addr = camel_internet_address_new (); - camel_internet_address_add (addr, account->id->name, account->id->address); + camel_internet_address_add ( + addr, account->id->name, account->id->address); camel_mime_message_set_from (forward, addr); g_object_unref (addr); /* to */ addr = camel_internet_address_new (); camel_address_decode (CAMEL_ADDRESS (addr), address); - camel_mime_message_set_recipients (forward, CAMEL_RECIPIENT_TYPE_TO, addr); + camel_mime_message_set_recipients ( + forward, CAMEL_RECIPIENT_TYPE_TO, addr); g_object_unref (addr); /* subject */ diff --git a/mail/e-mail-store.c b/mail/e-mail-store.c index af602b1a81..9dfaab693b 100644 --- a/mail/e-mail-store.c +++ b/mail/e-mail-store.c @@ -173,7 +173,10 @@ mail_store_add (EMailSession *session, g_return_if_fail (store_table != NULL); g_return_if_fail (store != NULL); g_return_if_fail (CAMEL_IS_STORE (store)); - g_return_if_fail ((CAMEL_SERVICE (store)->provider->flags & CAMEL_PROVIDER_IS_STORAGE) != 0); + + g_return_if_fail ( + (CAMEL_SERVICE (store)->provider->flags & + CAMEL_PROVIDER_IS_STORAGE) != 0); default_model = em_folder_tree_model_get_default (); folder_cache = e_mail_session_get_folder_cache (session); diff --git a/mail/em-account-editor.c b/mail/em-account-editor.c index 3c373f444c..cf33586453 100644 --- a/mail/em-account-editor.c +++ b/mail/em-account-editor.c @@ -2368,7 +2368,7 @@ emae_option_checkspin_check_changed (GtkToggleButton *toggle, EMAccountEditorSer } static void -parse_checkspin_format (const char *str, +parse_checkspin_format (const gchar *str, gboolean *on_ret, gdouble *min_ret, gdouble *def_ret, @@ -3784,7 +3784,7 @@ static void set_provider_defaults_on_url (EMAccountEditor *emae, CamelProvider *provider, CamelURL *url) { CamelProviderConfEntry *entries; - int i; + gint i; if (!emae->priv->new_account) return; diff --git a/mail/em-composer-utils.c b/mail/em-composer-utils.c index 6929f7069d..1b5b380f76 100644 --- a/mail/em-composer-utils.c +++ b/mail/em-composer-utils.c @@ -1143,8 +1143,8 @@ edit_message (EShell *shell, typedef enum { QUOTING_ATTRIBUTION, QUOTING_FORWARD, QUOTING_ORIGINAL } QuotingTextEnum; static struct { - const gchar* gconf_key; - const gchar* message; + const gchar * gconf_key; + const gchar * message; } conf_messages[] = { [QUOTING_ATTRIBUTION] = { "/apps/evolution/mail/composer/message_attribution", diff --git a/mail/em-filter-context.c b/mail/em-filter-context.c index 2e6d19cc95..52039d9aa8 100644 --- a/mail/em-filter-context.c +++ b/mail/em-filter-context.c @@ -150,8 +150,11 @@ filter_context_rename_uri (ERuleContext *context, element = el->data; if (EM_IS_FILTER_FOLDER_ELEMENT (element) - && cmp (em_filter_folder_element_get_uri (EM_FILTER_FOLDER_ELEMENT (element)), olduri)) { - em_filter_folder_element_set_uri (EM_FILTER_FOLDER_ELEMENT (element), newuri); + && cmp (em_filter_folder_element_get_uri ( + EM_FILTER_FOLDER_ELEMENT (element)), olduri)) { + em_filter_folder_element_set_uri ( + EM_FILTER_FOLDER_ELEMENT ( + element), newuri); rulecount++; } el = el->next; @@ -202,7 +205,8 @@ filter_context_delete_uri (ERuleContext *context, element = el->data; if (EM_IS_FILTER_FOLDER_ELEMENT (element) - && cmp (em_filter_folder_element_get_uri (EM_FILTER_FOLDER_ELEMENT (element)), uri)) { + && cmp (em_filter_folder_element_get_uri ( + EM_FILTER_FOLDER_ELEMENT (element)), uri)) { /* check if last action, if so, remove rule instead? */ l = l->next; em_filter_rule_remove_action ((EMFilterRule *)rule, action); diff --git a/mail/em-filter-folder-element.c b/mail/em-filter-folder-element.c index d5e7bd259a..9ad4cacc39 100644 --- a/mail/em-filter-folder-element.c +++ b/mail/em-filter-folder-element.c @@ -72,7 +72,9 @@ filter_folder_element_set_session (EMFilterFolderElement *element, EMailSession *session) { if (!session) - session = e_mail_backend_get_session (E_MAIL_BACKEND (e_shell_get_backend_by_name (e_shell_get_default(), "mail"))); + session = e_mail_backend_get_session ( + E_MAIL_BACKEND (e_shell_get_backend_by_name ( + e_shell_get_default (), "mail"))); g_return_if_fail (E_IS_MAIL_SESSION (session)); g_return_if_fail (element->priv->session == NULL); @@ -242,8 +244,10 @@ validate (EFilterElement *fe, EAlert **alert) static gint folder_eq (EFilterElement *fe, EFilterElement *cm) { - return E_FILTER_ELEMENT_CLASS (em_filter_folder_element_parent_class)->eq (fe, cm) - && strcmp (((EMFilterFolderElement *)fe)->priv->uri, ((EMFilterFolderElement *)cm)->priv->uri)== 0; + return E_FILTER_ELEMENT_CLASS ( + em_filter_folder_element_parent_class)->eq (fe, cm) && + strcmp (((EMFilterFolderElement *)fe)->priv->uri, + ((EMFilterFolderElement *)cm)->priv->uri)== 0; } static xmlNodePtr @@ -366,8 +370,11 @@ static void emff_copy_value (EFilterElement *de, EFilterElement *se) { if (EM_IS_FILTER_FOLDER_ELEMENT (se)) { - ((EMFilterFolderElement *)de)->store_camel_uri = ((EMFilterFolderElement *)se)->store_camel_uri; - em_filter_folder_element_set_uri ((EMFilterFolderElement *)de, ((EMFilterFolderElement *)se)->priv->uri); + ((EMFilterFolderElement *)de)->store_camel_uri = + ((EMFilterFolderElement *)se)->store_camel_uri; + em_filter_folder_element_set_uri (( + EMFilterFolderElement *) de, + ((EMFilterFolderElement *) se)->priv->uri); } else E_FILTER_ELEMENT_CLASS (em_filter_folder_element_parent_class)->copy_value (de, se); } diff --git a/mail/em-vfolder-rule.c b/mail/em-vfolder-rule.c index 1bb7830aec..088c6c761f 100644 --- a/mail/em-vfolder-rule.c +++ b/mail/em-vfolder-rule.c @@ -79,8 +79,17 @@ static void vfolder_rule_set_session (EMVFolderRule *rule, EMailSession *session) { - if (!session) - session = e_mail_backend_get_session (E_MAIL_BACKEND (e_shell_get_backend_by_name (e_shell_get_default(), "mail"))); + if (session == NULL) { + EShell *shell; + EShellBackend *shell_backend; + EMailBackend *backend; + + shell = e_shell_get_default (); + shell_backend = e_shell_get_backend_by_name (shell, "mail"); + + backend = E_MAIL_BACKEND (shell_backend); + session = e_mail_backend_get_session (backend); + } g_return_if_fail (E_IS_MAIL_SESSION (session)); g_return_if_fail (rule->priv->session == NULL); @@ -376,7 +385,8 @@ xml_decode (EFilterRule *fr, xmlNodePtr node, struct _ERuleContext *f) EMVFolderRule *vr =(EMVFolderRule *)fr; gchar *tmp; - result = E_FILTER_RULE_CLASS (em_vfolder_rule_parent_class)->xml_decode (fr, node, f); + result = E_FILTER_RULE_CLASS (em_vfolder_rule_parent_class)-> + xml_decode (fr, node, f); if (result != 0) return result; @@ -668,7 +678,8 @@ get_widget (EFilterRule *fr, ERuleContext *rc) GObject *object; gint i; - widget = E_FILTER_RULE_CLASS (em_vfolder_rule_parent_class)->get_widget (fr, rc); + widget = E_FILTER_RULE_CLASS (em_vfolder_rule_parent_class)-> + get_widget (fr, rc); data = g_malloc0 (sizeof (*data)); data->rc = rc; diff --git a/mail/importers/mail-importer.c b/mail/importers/mail-importer.c index 4654956cc2..f6cbbbb82c 100644 --- a/mail/importers/mail-importer.c +++ b/mail/importers/mail-importer.c @@ -141,7 +141,8 @@ import_mbox_exec (struct _import_mbox_msg *m, mp = camel_mime_parser_new (); camel_mime_parser_scan_from (mp, TRUE); - if (camel_mime_parser_init_with_fd (mp, fd) == -1) { /* will never happen - 0 is unconditionally returned */ + if (camel_mime_parser_init_with_fd (mp, fd) == -1) { + /* will never happen - 0 is unconditionally returned */ goto fail2; } @@ -195,7 +196,6 @@ import_mbox_exec (struct _import_mbox_msg *m, camel_folder_synchronize_sync (folder, FALSE, NULL, NULL); camel_folder_thaw (folder); camel_operation_pop_message (cancellable); - /* TODO: these api's are a bit weird, registering the old is the same as deregistering */ fail2: g_object_unref (mp); } @@ -342,7 +342,8 @@ import_folders_rec (struct _import_folders_data *m, m->session, filefull, uri, m->cancellable); g_free (uri); - /* This little gem re-uses the stat buffer and filefull to automagically scan mozilla-format folders */ + /* This little gem re-uses the stat buffer and filefull + * to automagically scan mozilla-format folders. */ if (!m->elmfmt) { gchar *tmp = g_strdup_printf("%s.sbd", filefull); @@ -355,7 +356,10 @@ import_folders_rec (struct _import_folders_data *m, } if (S_ISDIR (st.st_mode)) { - foldersub = folderparent?g_strdup_printf("%s/%s", folderparent, folder):g_strdup(folder); + foldersub = folderparent ? + g_strdup_printf ( + "%s/%s", folderparent, folder) : + g_strdup (folder); import_folders_rec (m, filefull, foldersub); g_free (foldersub); } diff --git a/mail/mail-autofilter.c b/mail/mail-autofilter.c index aac7deb49a..2055480ea7 100644 --- a/mail/mail-autofilter.c +++ b/mail/mail-autofilter.c @@ -50,7 +50,9 @@ #define d(x) static void -rule_match_recipients (ERuleContext *context, EFilterRule *rule, CamelInternetAddress *iaddr) +rule_match_recipients (ERuleContext *context, + EFilterRule *rule, + CamelInternetAddress *iaddr) { EFilterPart *part; EFilterElement *element; @@ -218,7 +220,10 @@ rule_match_mlist (ERuleContext *context, EFilterRule *rule, const gchar *mlist) } static void -rule_from_address (EFilterRule *rule, ERuleContext *context, CamelInternetAddress* addr, gint flags) +rule_from_address (EFilterRule *rule, + ERuleContext *context, + CamelInternetAddress *addr, + gint flags) { rule->grouping = E_FILTER_GROUP_ANY; @@ -241,7 +246,10 @@ rule_from_address (EFilterRule *rule, ERuleContext *context, CamelInternetAddres } static void -rule_from_message (EFilterRule *rule, ERuleContext *context, CamelMimeMessage *msg, gint flags) +rule_from_message (EFilterRule *rule, + ERuleContext *context, + CamelMimeMessage *msg, + gint flags) { CamelInternetAddress *addr; @@ -275,10 +283,14 @@ rule_from_message (EFilterRule *rule, ERuleContext *context, CamelMimeMessage *m } } if (flags & AUTO_TO) { - addr = (CamelInternetAddress *)camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_TO); + addr = (CamelInternetAddress *) + camel_mime_message_get_recipients ( + msg, CAMEL_RECIPIENT_TYPE_TO); if (addr) rule_match_recipients (context, rule, addr); - addr = (CamelInternetAddress *)camel_mime_message_get_recipients (msg, CAMEL_RECIPIENT_TYPE_CC); + addr = (CamelInternetAddress *) + camel_mime_message_get_recipients ( + msg, CAMEL_RECIPIENT_TYPE_CC); if (addr) rule_match_recipients (context, rule, addr); } @@ -409,9 +421,9 @@ mail_filter_rename_uri (EMailBackend *backend, e_rule_context_load ((ERuleContext *)fc, system, user); g_free (system); - changed = e_rule_context_rename_uri ((ERuleContext *)fc, eolduri, enewuri, g_str_equal); + changed = e_rule_context_rename_uri ( + (ERuleContext *)fc, eolduri, enewuri, g_str_equal); if (changed) { - d(printf("Folder rename '%s' -> '%s' changed filters, resaving\n", olduri, newuri)); if (e_rule_context_save ((ERuleContext *)fc, user) == -1) g_warning("Could not write out changed filter rules\n"); e_rule_context_free_uri_list ((ERuleContext *)fc, changed); diff --git a/mail/mail-config.c b/mail/mail-config.c index f5c107ddcc..77204f7830 100644 --- a/mail/mail-config.c +++ b/mail/mail-config.c @@ -99,7 +99,8 @@ config_write_style (void) fprintf (rc, " GtkHTML::spell_error_color = \"%s\"\n", spell_color); g_free (spell_color); - if (gconf_client_get_bool (client, "/apps/evolution/mail/display/mark_citations", NULL)) + key = "/apps/evolution/mail/display/mark_citations"; + if (gconf_client_get_bool (client, key, NULL)) fprintf (rc, " GtkHTML::cite_color = \"%s\"\n", citation_color); g_free (citation_color); @@ -125,24 +126,31 @@ config_write_style (void) } static void -gconf_style_changed (GConfClient *client, guint cnxn_id, - GConfEntry *entry, gpointer user_data) +gconf_style_changed (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) { config_write_style (); } static void -gconf_outlook_filenames_changed (GConfClient *client, guint cnxn_id, - GConfEntry *entry, gpointer user_data) +gconf_outlook_filenames_changed (GConfClient *client, + guint cnxn_id, + GConfEntry *entry, + gpointer user_data) { + const gchar *key; + g_return_if_fail (client != NULL); + key = "/apps/evolution/mail/composer/outlook_filenames"; + /* pass option to the camel */ - if (gconf_client_get_bool (client, "/apps/evolution/mail/composer/outlook_filenames", NULL)) { + if (gconf_client_get_bool (client, key, NULL)) camel_header_param_encode_filenames_in_rfc_2047 = 1; - } else { + else camel_header_param_encode_filenames_in_rfc_2047 = 0; - } } static void @@ -450,16 +458,28 @@ mail_config_get_lookup_book_local_only (void) } static void -folder_deleted_cb (MailFolderCache *cache, CamelStore *store, const gchar *uri, gpointer user_data) +folder_deleted_cb (MailFolderCache *cache, + CamelStore *store, + const gchar *uri, + gpointer user_data) { - mail_config_uri_deleted (CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (store))->compare_folder_name, uri); + CamelStoreClass *class; + + class = CAMEL_STORE_GET_CLASS (store); + mail_config_uri_deleted (class->compare_folder_name, uri); } static void -folder_renamed_cb (MailFolderCache *cache, CamelStore *store, const gchar *olduri, const gchar *newuri, gpointer user_data) +folder_renamed_cb (MailFolderCache *cache, + CamelStore *store, + const gchar *olduri, + const gchar *newuri, + gpointer user_data) { - mail_config_uri_renamed (CAMEL_STORE_CLASS (CAMEL_OBJECT_GET_CLASS (store))->compare_folder_name, - olduri, newuri); + CamelStoreClass *class; + + class = CAMEL_STORE_GET_CLASS (store); + mail_config_uri_renamed (class->compare_folder_name, olduri, newuri); } /* Config struct routines */ diff --git a/mail/mail-folder-cache.c b/mail/mail-folder-cache.c index 8b3f3d2c24..876cbb3103 100644 --- a/mail/mail-folder-cache.c +++ b/mail/mail-folder-cache.c @@ -295,7 +295,8 @@ update_1folder (MailFolderCache *self, else unread = camel_folder_get_unread_message_count (folder); } - } else if (info && !em_utils_folder_is_drafts (NULL, info->uri) && !em_utils_folder_is_outbox (NULL, info->uri)) + } else if (info && !em_utils_folder_is_drafts (NULL, info->uri) && + !em_utils_folder_is_outbox (NULL, info->uri)) unread = info->unread; d(printf("folder updated: unread %d: '%s'\n", unread, mfi->full_name)); diff --git a/mail/mail-send-recv.c b/mail/mail-send-recv.c index aed6cf59a0..1c17024f39 100644 --- a/mail/mail-send-recv.c +++ b/mail/mail-send-recv.c @@ -410,7 +410,7 @@ build_dialog (GtkWindow *parent, EAccountList *accounts, CamelFolder *outbox, const gchar *destination, - gboolean allow_send) + gboolean allow_send) { GtkDialog *gd; GtkWidget *table; @@ -1193,14 +1193,20 @@ auto_online (EShell *shell) { EIterator *iter; EAccountList *accounts; + EShellSettings *shell_settings; struct _auto_data *info; gboolean can_update_all; if (!e_shell_get_online (shell)) return; - can_update_all = e_shell_settings_get_boolean (e_shell_get_shell_settings (shell), "mail-check-on-start") - && e_shell_settings_get_boolean (e_shell_get_shell_settings (shell), "mail-check-all-on-start"); + shell_settings = e_shell_get_shell_settings (shell); + + can_update_all = + e_shell_settings_get_boolean ( + shell_settings, "mail-check-on-start") && + e_shell_settings_get_boolean ( + shell_settings, "mail-check-all-on-start"); accounts = e_get_account_list (); for (iter = e_list_get_iterator ((EList *)accounts); @@ -1212,8 +1218,7 @@ auto_online (EShell *shell) continue; info = g_object_get_data ( - G_OBJECT (account), - "mail-autoreceive"); + G_OBJECT (account), "mail-autoreceive"); if (info && (info->timeout_id || can_update_all)) auto_timeout (info); } @@ -1228,6 +1233,7 @@ void mail_autoreceive_init (EMailBackend *backend) { EShellBackend *shell_backend; + EShellSettings *shell_settings; EMailSession *session; EAccountList *accounts; EIterator *iter; @@ -1262,8 +1268,10 @@ mail_autoreceive_init (EMailBackend *backend) shell_backend = E_SHELL_BACKEND (backend); shell = e_shell_backend_get_shell (shell_backend); + shell_settings = e_shell_get_shell_settings (shell); - if (e_shell_settings_get_boolean (e_shell_get_shell_settings (shell), "mail-check-on-start")) { + if (e_shell_settings_get_boolean ( + shell_settings, "mail-check-on-start")) { auto_online (shell); /* also flush outbox on start */ diff --git a/mail/mail-vfolder.c b/mail/mail-vfolder.c index 3629de1a4b..9c8b87506f 100644 --- a/mail/mail-vfolder.c +++ b/mail/mail-vfolder.c @@ -262,7 +262,9 @@ vfolder_adduri_exec (struct _adduri_msg *m, if (!m->remove && !mail_folder_cache_get_folder_from_uri (folder_cache, m->uri, &folder)) { - g_warning("Folder '%s' disappeared while I was adding/remove it to/from my vfolder", m->uri); + g_warning ( + "Folder '%s' disappeared while I was " + "adding/removing it to/from my vfolder", m->uri); return; } @@ -463,10 +465,13 @@ mail_vfolder_add_uri (EMailSession *session, const gchar *source; CamelVeeFolder *vf; GList *folders = NULL, *link; - gint remote = (((CamelService *)store)->provider->flags & CAMEL_PROVIDER_IS_REMOTE) != 0; + gint remote; gint is_ignore; gchar *uri; + remote = (((CamelService *)store)->provider->flags & + CAMEL_PROVIDER_IS_REMOTE) != 0; + uri = em_uri_from_camel (curi); if (uri_is_spethal (store, curi)) { g_free (uri); @@ -518,7 +523,8 @@ mail_vfolder_add_uri (EMailSession *session, d(printf("invalid rule (%p): rule->name is set to NULL\n", rule)); continue; } - /* dont auto-add any sent/drafts folders etc, they must be explictly listed as a source */ + /* Don't auto-add any sent/drafts folders etc, + * they must be explictly listed as a source. */ if (rule->source && !is_ignore && ((((EMVFolderRule *)rule)->with == EM_VFOLDER_RULE_WITH_LOCAL && !remote) @@ -527,7 +533,8 @@ mail_vfolder_add_uri (EMailSession *session, found = TRUE; source = NULL; - while (!found && (source = em_vfolder_rule_next_source ((EMVFolderRule *)rule, source))) { + while (!found && (source = em_vfolder_rule_next_source ( + (EMVFolderRule *)rule, source))) { gchar *csource; csource = em_uri_to_camel (source); found = camel_store_folder_uri_equal (store, curi, csource); @@ -663,8 +670,10 @@ mail_vfolder_delete_uri (EMailBackend *backend, g_warning ("vf is NULL for %s\n", rule->name); continue; } - g_signal_handlers_disconnect_matched (rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0, - 0, NULL, rule_changed, vf); + g_signal_handlers_disconnect_matched ( + rule, G_SIGNAL_MATCH_FUNC | + G_SIGNAL_MATCH_DATA, 0, 0, NULL, + rule_changed, vf); em_vfolder_rule_remove_source ((EMVFolderRule *)rule, source); g_signal_connect (rule, "changed", G_CALLBACK(rule_changed), vf); if (changed_count == 0) { @@ -758,14 +767,15 @@ mail_vfolder_rename_uri (CamelStore *store, const gchar *cfrom, const gchar *cto /* Remove all sources that match, ignore changed events though because the adduri call above does the work async */ if (camel_store_folder_uri_equal (store, cfrom, csource)) { - d(printf("Vfolder '%s' used '%s' ('%s') now uses '%s'\n", rule->name, source, from, to)); vf = g_hash_table_lookup (vfolder_hash, rule->name); if (!vf) { g_warning ("vf is NULL for %s\n", rule->name); continue; } - g_signal_handlers_disconnect_matched (rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0, - 0, NULL, rule_changed, vf); + g_signal_handlers_disconnect_matched ( + rule, G_SIGNAL_MATCH_FUNC | + G_SIGNAL_MATCH_DATA, 0, 0, NULL, + rule_changed, vf); em_vfolder_rule_remove_source ((EMVFolderRule *)rule, source); em_vfolder_rule_add_source ((EMVFolderRule *)rule, to); g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), vf); @@ -885,11 +895,17 @@ rule_changed (EFilterRule *rule, CamelFolder *folder) &sources_folder, &sources_uri); G_LOCK (vfolder); - if (((EMVFolderRule *)rule)->with == EM_VFOLDER_RULE_WITH_LOCAL || ((EMVFolderRule *)rule)->with == EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE) + if (((EMVFolderRule *)rule)->with == + EM_VFOLDER_RULE_WITH_LOCAL || + ((EMVFolderRule *)rule)->with == + EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE) rule_add_sources ( session, source_folders_local, &sources_folder, &sources_uri); - if (((EMVFolderRule *)rule)->with == EM_VFOLDER_RULE_WITH_REMOTE_ACTIVE || ((EMVFolderRule *)rule)->with == EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE) + if (((EMVFolderRule *)rule)->with == + EM_VFOLDER_RULE_WITH_REMOTE_ACTIVE || + ((EMVFolderRule *)rule)->with == + EM_VFOLDER_RULE_WITH_LOCAL_REMOTE_ACTIVE) rule_add_sources ( session, source_folders_remote, &sources_folder, &sources_uri); @@ -970,9 +986,11 @@ store_folder_deleted_cb (CamelStore *store, if (rule) { const gchar *config_dir; - /* We need to stop listening to removed events, otherwise we'll try and remove it again */ - g_signal_handlers_disconnect_matched (context, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0, - 0, NULL, context_rule_removed, context); + /* We need to stop listening to removed events, + * otherwise we'll try and remove it again. */ + g_signal_handlers_disconnect_matched ( + context, G_SIGNAL_MATCH_FUNC | G_SIGNAL_MATCH_DATA, + 0, 0, NULL, context_rule_removed, context); e_rule_context_remove_rule ((ERuleContext *)context, rule); g_object_unref (rule); g_signal_connect(context, "rule_removed", G_CALLBACK(context_rule_removed), context); @@ -1019,8 +1037,9 @@ store_folder_renamed_cb (CamelStore *store, return; } - g_signal_handlers_disconnect_matched (rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, 0, - 0, NULL, rule_changed, folder); + g_signal_handlers_disconnect_matched ( + rule, G_SIGNAL_MATCH_FUNC|G_SIGNAL_MATCH_DATA, + 0, 0, NULL, rule_changed, folder); e_filter_rule_set_name (rule, info->full_name); g_signal_connect(rule, "changed", G_CALLBACK(rule_changed), folder); @@ -1064,7 +1083,11 @@ folder_deleted_cb (MailFolderCache *cache, } static void -folder_renamed_cb (MailFolderCache *cache, CamelStore *store, const gchar *olduri, const gchar *newuri, gpointer user_data) +folder_renamed_cb (MailFolderCache *cache, + CamelStore *store, + const gchar *olduri, + const gchar *newuri, + gpointer user_data) { mail_vfolder_rename_uri (store, olduri, newuri); } @@ -1075,6 +1098,7 @@ vfolder_load_storage (EMailBackend *backend) /* lock for loading storage, it is safe to call it more than once */ G_LOCK_DEFINE_STATIC (vfolder_hash); + const gchar *key; const gchar *data_dir; const gchar *config_dir; gchar *user, *storeuri; @@ -1154,8 +1178,9 @@ vfolder_load_storage (EMailBackend *backend) /* reenable the feature if required */ client = gconf_client_get_default (); - if (!gconf_client_get_bool (client, "/apps/evolution/mail/display/enable_vfolders", NULL)) - gconf_client_set_bool (client, "/apps/evolution/mail/display/enable_vfolders", TRUE, NULL); + key = "/apps/evolution/mail/display/enable_vfolders"; + if (!gconf_client_get_bool (client, key, NULL)) + gconf_client_set_bool (client, key, TRUE, NULL); g_object_unref (client); folder_cache = e_mail_session_get_folder_cache (session); @@ -1263,7 +1288,8 @@ vfolder_edit_rule (EMailBackend *backend, url = camel_url_new (uri, NULL); if (url && url->fragment - && (rule = e_rule_context_find_rule ((ERuleContext *)context, url->fragment, NULL))) { + && (rule = e_rule_context_find_rule ( + (ERuleContext *) context, url->fragment, NULL))) { g_object_ref (G_OBJECT (rule)); newrule = e_filter_rule_clone (rule); @@ -1285,9 +1311,15 @@ vfolder_edit_rule (EMailBackend *backend, gtk_window_set_default_size (GTK_WINDOW (gd), 500, 500); gtk_box_pack_start (GTK_BOX (container), w, TRUE, TRUE, 0); gtk_widget_show ((GtkWidget *)gd); - g_object_set_data_full(G_OBJECT(gd), "rule", newrule, (GDestroyNotify)g_object_unref); - g_object_set_data_full(G_OBJECT(gd), "orig", rule, (GDestroyNotify)g_object_unref); - g_signal_connect(gd, "response", G_CALLBACK(edit_rule_response), NULL); + g_object_set_data_full ( + G_OBJECT (gd), "rule", newrule, + (GDestroyNotify) g_object_unref); + g_object_set_data_full ( + G_OBJECT (gd), "orig", rule, + (GDestroyNotify) g_object_unref); + g_signal_connect ( + gd, "response", + G_CALLBACK (edit_rule_response), NULL); gtk_widget_show ((GtkWidget *)gd); } else { /* TODO: we should probably just create it ... */ @@ -1315,7 +1347,9 @@ new_rule_clicked (GtkWidget *w, gint button, gpointer data) } if (e_rule_context_find_rule ((ERuleContext *)context, rule->name, rule->source)) { - e_alert_run_dialog_for_args ((GtkWindow *)w, "mail:vfolder-notunique", rule->name, NULL); + e_alert_run_dialog_for_args ( + GTK_WINDOW (w), "mail:vfolder-notunique", + rule->name, NULL); return; } @@ -1345,7 +1379,8 @@ vfolder_create_part (const gchar *name) return e_rule_context_create_part ((ERuleContext *)context, name); } -/* clones a filter/search rule into a matching vfolder rule (assuming the same system definitions) */ +/* clones a filter/search rule into a matching vfolder rule + * (assuming the same system definitions) */ EFilterRule * vfolder_clone_rule (EMailSession *session, EFilterRule *in) { diff --git a/modules/calendar/e-cal-shell-migrate.c b/modules/calendar/e-cal-shell-migrate.c index 3ef6e554ad..710aa8f2a2 100644 --- a/modules/calendar/e-cal-shell-migrate.c +++ b/modules/calendar/e-cal-shell-migrate.c @@ -94,9 +94,11 @@ create_calendar_sources (EShellBackend *shell_backend, if (groups) { /* groups are already there, we need to search for things... */ GSList *g; + const gchar *data_dir; gchar *base_dir, *base_uri; - base_dir = g_build_filename (e_shell_backend_get_data_dir (shell_backend), "local", NULL); + data_dir = e_shell_backend_get_data_dir (shell_backend); + base_dir = g_build_filename (data_dir, "local", NULL); base_uri = g_filename_to_uri (base_dir, NULL, NULL); for (g = groups; g; g = g->next) { diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 1af16b3b8e..f61e0a60a7 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -111,6 +111,7 @@ cal_shell_sidebar_backend_died_cb (ECalShellSidebar *cal_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; GHashTable *client_table; ESource *source; @@ -120,6 +121,7 @@ cal_shell_sidebar_backend_died_cb (ECalShellSidebar *cal_shell_sidebar, shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); source = e_cal_get_source (client); uid = e_source_peek_uid (source); @@ -129,7 +131,8 @@ cal_shell_sidebar_backend_died_cb (ECalShellSidebar *cal_shell_sidebar, g_hash_table_remove (client_table, uid); cal_shell_sidebar_emit_status_message (cal_shell_sidebar, NULL); - e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:calendar-crashed", NULL); g_object_unref (source); @@ -141,18 +144,23 @@ cal_shell_sidebar_backend_error_cb (ECalShellSidebar *cal_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; ESourceGroup *source_group; ESource *source; shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); source = e_cal_get_source (client); source_group = e_source_peek_group (source); - e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)), - "calendar:backend-error", e_source_group_peek_name (source_group), e_source_peek_name (source), message, NULL); + e_alert_submit ( + E_ALERT_SINK (shell_content), + "calendar:backend-error", + e_source_group_peek_name (source_group), + e_source_peek_name (source), message, NULL); } static void @@ -161,11 +169,13 @@ cal_shell_sidebar_client_opened_cb (ECalShellSidebar *cal_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; const gchar *message; shell_sidebar = E_SHELL_SIDEBAR (cal_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) || @@ -186,14 +196,16 @@ cal_shell_sidebar_client_opened_cb (ECalShellSidebar *cal_shell_sidebar, return; case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: - e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:prompt-no-contents-offline-calendar", NULL); /* fall through */ default: if (error->code != E_CALENDAR_STATUS_REPOSITORY_OFFLINE) { - e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:failed-open-calendar", error->message, NULL); } @@ -222,6 +234,7 @@ cal_shell_sidebar_default_loaded_cb (ESource *source, EShellSidebar *shell_sidebar) { ECalShellSidebarPrivate *priv; + EShellContent *shell_content; EShellView *shell_view; ECal *client; GError *error = NULL; @@ -229,6 +242,7 @@ cal_shell_sidebar_default_loaded_cb (ESource *source, priv = E_CAL_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); client = e_load_cal_source_finish (source, result, &error); @@ -237,7 +251,8 @@ cal_shell_sidebar_default_loaded_cb (ESource *source, goto exit; } else if (error != NULL) { - e_alert_submit (E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:failed-open-calendar", error->message, NULL); g_error_free (error); diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 3417875803..90abf79c3c 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -1216,7 +1216,9 @@ edit_event_as (ECalShellView *cal_shell_view, gboolean as_meeting) } } - e_calendar_view_edit_appointment (calendar_view, client, icalcomp, as_meeting ? EDIT_EVENT_FORCE_MEETING : EDIT_EVENT_FORCE_APPOINTMENT); + e_calendar_view_edit_appointment ( + calendar_view, client, icalcomp, as_meeting ? + EDIT_EVENT_FORCE_MEETING : EDIT_EVENT_FORCE_APPOINTMENT); if (!as_meeting && icalcomp) { icalcomponent_free (icalcomp); diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index 31304948f9..b7e52a9095 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -101,24 +101,12 @@ memo_shell_sidebar_emit_status_message (EMemoShellSidebar *memo_shell_sidebar, g_signal_emit (memo_shell_sidebar, signal_id, 0, status_message, -1.0); } -static EAlertSink * -get_alert_sink (EShellView *shell_view) -{ - EShellWindow *shell_window; - - shell_window = e_shell_view_get_shell_window (shell_view); - - if (g_strcmp0 (e_shell_window_get_active_view (shell_window), "calendar") == 0) - shell_view = e_shell_window_peek_shell_view (shell_window, "calendar"); - - return E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)); -} - static void memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; GHashTable *client_table; ESource *source; @@ -128,6 +116,7 @@ memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar, shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); source = e_cal_get_source (client); uid = e_source_peek_uid (source); @@ -137,7 +126,8 @@ memo_shell_sidebar_backend_died_cb (EMemoShellSidebar *memo_shell_sidebar, g_hash_table_remove (client_table, uid); memo_shell_sidebar_emit_status_message (memo_shell_sidebar, NULL); - e_alert_submit (get_alert_sink (shell_view), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:memos-crashed", NULL); g_object_unref (source); @@ -149,18 +139,23 @@ memo_shell_sidebar_backend_error_cb (EMemoShellSidebar *memo_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; ESourceGroup *source_group; ESource *source; shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); source = e_cal_get_source (client); source_group = e_source_peek_group (source); - e_alert_submit (get_alert_sink (shell_view), - "calendar:backend-error", e_source_group_peek_name (source_group), e_source_peek_name (source), message, NULL); + e_alert_submit ( + E_ALERT_SINK (shell_content), + "calendar:backend-error", + e_source_group_peek_name (source_group), + e_source_peek_name (source), message, NULL); } static void @@ -169,11 +164,13 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; const gchar *message; shell_sidebar = E_SHELL_SIDEBAR (memo_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) || @@ -194,14 +191,16 @@ memo_shell_sidebar_client_opened_cb (EMemoShellSidebar *memo_shell_sidebar, return; case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: - e_alert_submit (get_alert_sink (shell_view), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:prompt-no-contents-offline-memos", NULL); /* fall through */ default: if (error->code != E_CALENDAR_STATUS_REPOSITORY_OFFLINE) { - e_alert_submit (get_alert_sink (shell_view), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:failed-open-memos", error->message, NULL); } @@ -230,6 +229,7 @@ memo_shell_sidebar_default_loaded_cb (ESource *source, EShellSidebar *shell_sidebar) { EMemoShellSidebarPrivate *priv; + EShellContent *shell_content; EShellView *shell_view; ECal *client; GError *error = NULL; @@ -237,6 +237,7 @@ memo_shell_sidebar_default_loaded_cb (ESource *source, priv = E_MEMO_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); client = e_load_cal_source_finish (source, result, &error); @@ -245,7 +246,8 @@ memo_shell_sidebar_default_loaded_cb (ESource *source, goto exit; } else if (error != NULL) { - e_alert_submit (get_alert_sink (shell_view), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:failed-open-memos", error->message, NULL); g_error_free (error); diff --git a/modules/calendar/e-task-shell-migrate.c b/modules/calendar/e-task-shell-migrate.c index f57ac7e75a..d7daafc91d 100644 --- a/modules/calendar/e-task-shell-migrate.c +++ b/modules/calendar/e-task-shell-migrate.c @@ -70,9 +70,11 @@ create_task_sources (EShellBackend *shell_backend, if (groups) { /* groups are already there, we need to search for things... */ GSList *g; + const gchar *data_dir; gchar *base_dir, *base_uri; - base_dir = g_build_filename (e_shell_backend_get_data_dir (shell_backend), "local", NULL); + data_dir = e_shell_backend_get_data_dir (shell_backend); + base_dir = g_build_filename (data_dir, "local", NULL); base_uri = g_filename_to_uri (base_dir, NULL, NULL); for (g = groups; g; g = g->next) { diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index e00159026c..62973d2efc 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -101,24 +101,12 @@ task_shell_sidebar_emit_status_message (ETaskShellSidebar *task_shell_sidebar, g_signal_emit (task_shell_sidebar, signal_id, 0, status_message, -1.0); } -static EAlertSink * -get_alert_sink (EShellView *shell_view) -{ - EShellWindow *shell_window; - - shell_window = e_shell_view_get_shell_window (shell_view); - - if (g_strcmp0 (e_shell_window_get_active_view (shell_window), "calendar") == 0) - shell_view = e_shell_window_peek_shell_view (shell_window, "calendar"); - - return E_ALERT_SINK (e_shell_view_get_shell_content (shell_view)); -} - static void task_shell_sidebar_backend_died_cb (ETaskShellSidebar *task_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; GHashTable *client_table; ESource *source; @@ -128,6 +116,7 @@ task_shell_sidebar_backend_died_cb (ETaskShellSidebar *task_shell_sidebar, shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); source = e_cal_get_source (client); uid = e_source_peek_uid (source); @@ -137,7 +126,8 @@ task_shell_sidebar_backend_died_cb (ETaskShellSidebar *task_shell_sidebar, g_hash_table_remove (client_table, uid); task_shell_sidebar_emit_status_message (task_shell_sidebar, NULL); - e_alert_submit (get_alert_sink (shell_view), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:tasks-crashed", NULL); g_object_unref (source); @@ -149,18 +139,23 @@ task_shell_sidebar_backend_error_cb (ETaskShellSidebar *task_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; ESourceGroup *source_group; ESource *source; shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); source = e_cal_get_source (client); source_group = e_source_peek_group (source); - e_alert_submit (get_alert_sink (shell_view), - "calendar:backend-error", e_source_group_peek_name (source_group), e_source_peek_name (source), message, NULL); + e_alert_submit ( + E_ALERT_SINK (shell_content), + "calendar:backend-error", + e_source_group_peek_name (source_group), + e_source_peek_name (source), message, NULL); } static void @@ -169,11 +164,13 @@ task_shell_sidebar_client_opened_cb (ETaskShellSidebar *task_shell_sidebar, ECal *client) { EShellView *shell_view; + EShellContent *shell_content; EShellSidebar *shell_sidebar; const gchar *message; shell_sidebar = E_SHELL_SIDEBAR (task_shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); if (g_error_matches (error, E_CALENDAR_ERROR, E_CALENDAR_STATUS_AUTHENTICATION_FAILED) || @@ -194,14 +191,16 @@ task_shell_sidebar_client_opened_cb (ETaskShellSidebar *task_shell_sidebar, return; case E_CALENDAR_STATUS_REPOSITORY_OFFLINE: - e_alert_submit (get_alert_sink (shell_view), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:prompt-no-contents-offline-tasks", NULL); /* fall through */ default: if (error->code != E_CALENDAR_STATUS_REPOSITORY_OFFLINE) { - e_alert_submit (get_alert_sink (shell_view), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:failed-open-tasks", error->message, NULL); } @@ -230,6 +229,7 @@ task_shell_sidebar_default_loaded_cb (ESource *source, EShellSidebar *shell_sidebar) { ETaskShellSidebarPrivate *priv; + EShellContent *shell_content; EShellView *shell_view; ECal *client; GError *error = NULL; @@ -237,6 +237,7 @@ task_shell_sidebar_default_loaded_cb (ESource *source, priv = E_TASK_SHELL_SIDEBAR_GET_PRIVATE (shell_sidebar); shell_view = e_shell_sidebar_get_shell_view (shell_sidebar); + shell_content = e_shell_view_get_shell_content (shell_view); client = e_load_cal_source_finish (source, result, &error); @@ -245,7 +246,8 @@ task_shell_sidebar_default_loaded_cb (ESource *source, goto exit; } else if (error != NULL) { - e_alert_submit (get_alert_sink (shell_view), + e_alert_submit ( + E_ALERT_SINK (shell_content), "calendar:failed-open-tasks", error->message, NULL); g_error_free (error); diff --git a/modules/mail/e-mail-shell-sidebar.c b/modules/mail/e-mail-shell-sidebar.c index 7c538de519..8a3587b1c8 100644 --- a/modules/mail/e-mail-shell-sidebar.c +++ b/modules/mail/e-mail-shell-sidebar.c @@ -232,16 +232,17 @@ guess_screen_width (EMailShellSidebar *sidebar) static void mail_shell_sidebar_get_preferred_height (GtkWidget *widget, - gint *minimum_height, - gint *natural_height) + gint *minimum_height, + gint *natural_height) { - GTK_WIDGET_CLASS (parent_class)->get_preferred_height (widget, minimum_height, natural_height); + GTK_WIDGET_CLASS (parent_class)->get_preferred_height ( + widget, minimum_height, natural_height); } static void mail_shell_sidebar_get_preferred_width (GtkWidget *widget, - gint *minimum_width, - gint *natural_width) + gint *minimum_width, + gint *natural_width) { /* We override the normal size-request handler so that we can * spit out a treeview with a suitable width. We measure the @@ -267,7 +268,8 @@ mail_shell_sidebar_get_preferred_width (GtkWidget *widget, sidebar = E_MAIL_SHELL_SIDEBAR (widget); - GTK_WIDGET_CLASS (parent_class)->get_preferred_width (widget, minimum_width, natural_width); + GTK_WIDGET_CLASS (parent_class)->get_preferred_width ( + widget, minimum_width, natural_width); /* This string is a mockup only; it doesn't need to be translated */ layout = gtk_widget_create_pango_layout ( diff --git a/modules/mail/e-mail-shell-view-actions.c b/modules/mail/e-mail-shell-view-actions.c index 1342e8aa11..1665b8e8ce 100644 --- a/modules/mail/e-mail-shell-view-actions.c +++ b/modules/mail/e-mail-shell-view-actions.c @@ -257,8 +257,10 @@ action_mail_folder_expunge_cb (GtkAction *action, { EMailShellSidebar *mail_shell_sidebar; EMFolderTree *folder_tree; + EShellBackend *shell_backend; EShellWindow *shell_window; EShellView *shell_view; + EMailSession *session; CamelFolder *folder; /* This handles both the "folder-expunge" and "account-expunge" @@ -278,7 +280,10 @@ action_mail_folder_expunge_cb (GtkAction *action, folder = em_folder_tree_get_selected_folder (folder_tree); g_return_if_fail (folder != NULL); - em_utils_expunge_folder (GTK_WIDGET (shell_window), e_mail_backend_get_session (E_MAIL_BACKEND (e_shell_view_get_shell_backend (shell_view))), folder); + shell_backend = e_shell_view_get_shell_backend (shell_view); + session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); + + em_utils_expunge_folder (GTK_WIDGET (shell_window), session, folder); } static void @@ -718,21 +723,27 @@ action_mail_label_none_cb (GtkAction *action, } static void -action_mail_send_receive_cb (GtkAction *action, EMailShellView *mail_shell_view) +action_mail_send_receive_cb (GtkAction *action, + EMailShellView *mail_shell_view) { - e_mail_shell_view_send_receive (mail_shell_view, E_MAIL_SEND_RECEIVE_BOTH, NULL); + e_mail_shell_view_send_receive ( + mail_shell_view, E_MAIL_SEND_RECEIVE_BOTH, NULL); } static void -action_mail_send_receive_receive_all_cb (GtkAction *action, EMailShellView *mail_shell_view) +action_mail_send_receive_receive_all_cb (GtkAction *action, + EMailShellView *mail_shell_view) { - e_mail_shell_view_send_receive (mail_shell_view, E_MAIL_SEND_RECEIVE_RECEIVE, NULL); + e_mail_shell_view_send_receive ( + mail_shell_view, E_MAIL_SEND_RECEIVE_RECEIVE, NULL); } static void -action_mail_send_receive_send_all_cb (GtkAction *action, EMailShellView *mail_shell_view) +action_mail_send_receive_send_all_cb (GtkAction *action, + EMailShellView *mail_shell_view) { - e_mail_shell_view_send_receive (mail_shell_view, E_MAIL_SEND_RECEIVE_SEND, NULL); + e_mail_shell_view_send_receive ( + mail_shell_view, E_MAIL_SEND_RECEIVE_SEND, NULL); } static void diff --git a/modules/mail/e-mail-shell-view-private.c b/modules/mail/e-mail-shell-view-private.c index 6a15f4ed07..d69ba8da3b 100644 --- a/modules/mail/e-mail-shell-view-private.c +++ b/modules/mail/e-mail-shell-view-private.c @@ -1137,17 +1137,22 @@ e_mail_shell_view_update_sidebar (EMailShellView *mail_shell_view) } void -e_mail_shell_view_send_receive (EMailShellView *mail_shell_view, EMailSendReceiveMode mode, const gchar *account_uid) +e_mail_shell_view_send_receive (EMailShellView *mail_shell_view, + EMailSendReceiveMode mode, + const gchar *account_uid) { - EMailBackend *backend; EMailSession *session; + EShellView *shell_view; EShellWindow *shell_window; + EShellBackend *shell_backend; g_return_if_fail (mail_shell_view != NULL); - shell_window = e_shell_view_get_shell_window (E_SHELL_VIEW (mail_shell_view)); - backend = E_MAIL_BACKEND (e_shell_view_get_shell_backend (E_SHELL_VIEW (mail_shell_view))); - session = e_mail_backend_get_session (backend); + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + shell_backend = e_shell_view_get_shell_backend (shell_view); + + session = e_mail_backend_get_session (E_MAIL_BACKEND (shell_backend)); em_utils_clear_get_password_canceled_accounts_flag (); @@ -1166,17 +1171,24 @@ e_mail_shell_view_send_receive (EMailShellView *mail_shell_view, EMailSendReceiv } else { /* allow only receive on individual accounts */ EAccount *account; + const gchar *source_url = NULL; account = e_get_account_by_uid (account_uid); g_return_if_fail (account != NULL); - if (account->enabled && account->source && account->source->url && *account->source->url) - mail_receive_uri (session, account->source->url, account->source->keep_on_server); + if (account->enabled && account->source != NULL) + source_url = account->source->url; + + if (source_url != NULL && *source_url != '\0') + mail_receive_uri ( + session, source_url, + account->source->keep_on_server); } } static GtkMenuItem * -send_receive_find_account_menu_item (GtkMenuShell *menu, EAccount *account) +send_receive_find_account_menu_item (GtkMenuShell *menu, + EAccount *account) { GList *children, *child; @@ -1225,17 +1237,37 @@ send_receive_get_account_index (EAccount *account) for (iterator = e_list_get_iterator (E_LIST (accounts)); e_iterator_is_valid (iterator); e_iterator_next (iterator)) { - EAccount *acc = (EAccount *) e_iterator_get (iterator); + EAccount *candidate; const gchar *name; - if (!acc || !acc->enabled || !acc->source || !acc->source->url || !*acc->source->url) + candidate = (EAccount *) e_iterator_get (iterator); + + if (candidate == NULL) continue; - name = e_account_get_string (acc, E_ACCOUNT_NAME); - if (!name || !*name || !acc->uid || !*acc->uid) + if (!candidate->enabled) continue; - if (g_strcmp0 (acc->uid, account->uid) == 0) { + if (candidate->source == NULL) + continue; + + if (candidate->source->url == NULL) + continue; + + if (*candidate->source->url == '\0') + continue; + + name = e_account_get_string (candidate, E_ACCOUNT_NAME); + if (name == NULL || *name == '\0') + continue; + + if (candidate->uid == NULL) + continue; + + if (*candidate->uid == '\0') + continue; + + if (g_strcmp0 (candidate->uid, account->uid) == 0) { g_object_unref (iterator); return res; } @@ -1249,7 +1281,8 @@ send_receive_get_account_index (EAccount *account) } static void -send_receive_account_item_activate_cb (GtkMenuItem *item, GtkMenuShell *menu) +send_receive_account_item_activate_cb (GtkMenuItem *item, + GtkMenuShell *menu) { EMailShellView *mail_shell_view; const gchar *account_uid; @@ -1263,11 +1296,14 @@ send_receive_account_item_activate_cb (GtkMenuItem *item, GtkMenuShell *menu) account_uid = g_object_get_data (G_OBJECT (item), "e-account-uid"); g_return_if_fail (account_uid != NULL); - e_mail_shell_view_send_receive (mail_shell_view, E_MAIL_SEND_RECEIVE_RECEIVE, account_uid); + e_mail_shell_view_send_receive ( + mail_shell_view, E_MAIL_SEND_RECEIVE_RECEIVE, account_uid); } static void -send_receive_add_to_menu (GtkMenuShell *menu, EAccount *account, gint insert_index) +send_receive_add_to_menu (GtkMenuShell *menu, + EAccount *account, + gint insert_index) { const gchar *name; GtkWidget *item; @@ -1278,27 +1314,45 @@ send_receive_add_to_menu (GtkMenuShell *menu, EAccount *account, gint insert_ind if (send_receive_find_account_menu_item (menu, account) != NULL) return; - if (!account->source || !account->source->url || !*account->source->url) + if (account->source == NULL) + return; + + if (account->source->url == NULL) + return; + + if (*account->source->url == '\0') return; name = e_account_get_string (account, E_ACCOUNT_NAME); - if (!name || !*name || !account->uid || !*account->uid) + if (name == NULL || *name == '\0') + return; + + if (account->uid == NULL) + return; + + if (*account->uid == '\0') return; item = gtk_menu_item_new_with_label (name); gtk_widget_show (item); - g_object_set_data_full (G_OBJECT (item), "e-account-uid", g_strdup (account->uid), g_free); - g_signal_connect (item, "activate", G_CALLBACK (send_receive_account_item_activate_cb), menu); + g_object_set_data_full ( + G_OBJECT (item), "e-account-uid", + g_strdup (account->uid), g_free); + g_signal_connect ( + item, "activate", + G_CALLBACK (send_receive_account_item_activate_cb), menu); /* it's index between accounts, not in the menu */ if (insert_index < 0) gtk_menu_shell_append (GTK_MENU_SHELL (menu), item); else - gtk_menu_shell_insert (GTK_MENU_SHELL (menu), item, insert_index + 4); + gtk_menu_shell_insert ( + GTK_MENU_SHELL (menu), item, insert_index + 4); } static void -send_receive_remove_from_menu (GtkMenuShell *menu, EAccount *account) +send_receive_remove_from_menu (GtkMenuShell *menu, + EAccount *account) { GtkMenuItem *item; @@ -1306,41 +1360,56 @@ send_receive_remove_from_menu (GtkMenuShell *menu, EAccount *account) g_return_if_fail (account != NULL); item = send_receive_find_account_menu_item (menu, account); - if (!item) + if (item == NULL) return; gtk_container_remove (GTK_CONTAINER (menu), GTK_WIDGET (item)); } static void -send_receive_menu_account_added_cb (EAccountList *list, EAccount *account, GtkMenuShell *menu) +send_receive_menu_account_added_cb (EAccountList *list, + EAccount *account, + GtkMenuShell *menu) { g_return_if_fail (account != NULL); g_return_if_fail (menu != NULL); if (account->enabled) - send_receive_add_to_menu (menu, account, send_receive_get_account_index (account)); + send_receive_add_to_menu ( + menu, account, + send_receive_get_account_index (account)); } static void -send_receive_menu_account_changed_cb (EAccountList *list, EAccount *account, GtkMenuShell *menu) +send_receive_menu_account_changed_cb (EAccountList *list, + EAccount *account, + GtkMenuShell *menu) { g_return_if_fail (account != NULL); g_return_if_fail (menu != NULL); if (account->enabled) { - GtkMenuItem *item = send_receive_find_account_menu_item (menu, account); + GtkMenuItem *item; + + item = send_receive_find_account_menu_item (menu, account); if (item) { - if (!account->source || !account->source->url || !*account->source->url) { + if (account->source == NULL || + account->source->url == NULL || + *account->source->url == '\0') { send_receive_remove_from_menu (menu, account); } else { - const gchar *name = e_account_get_string (account, E_ACCOUNT_NAME); - if (name && *name) + const gchar *name; + + name = e_account_get_string ( + account, E_ACCOUNT_NAME); + if (name != NULL && *name != '\0') gtk_menu_item_set_label (item, name); } } else { - send_receive_add_to_menu (menu, account, send_receive_get_account_index (account)); + send_receive_add_to_menu ( + menu, account, + send_receive_get_account_index (account)); } } else { send_receive_remove_from_menu (menu, account); @@ -1348,7 +1417,9 @@ send_receive_menu_account_changed_cb (EAccountList *list, EAccount *account, Gtk } static void -send_receive_menu_account_removed_cb (EAccountList *list, EAccount *account, GtkMenuShell *menu) +send_receive_menu_account_removed_cb (EAccountList *list, + EAccount *account, + GtkMenuShell *menu) { g_return_if_fail (account != NULL); g_return_if_fail (menu != NULL); @@ -1357,16 +1428,20 @@ send_receive_menu_account_removed_cb (EAccountList *list, EAccount *account, Gtk } static void -menu_weak_ref_cb (gpointer accounts, GObject *freed_menu) +menu_weak_ref_cb (gpointer accounts, + GObject *where_the_object_was) { g_return_if_fail (accounts != NULL); - g_signal_handlers_disconnect_matched (accounts, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, freed_menu); + g_signal_handlers_disconnect_matched ( + accounts, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, where_the_object_was); } static GtkWidget * create_send_receive_submenu (EMailShellView *mail_shell_view) { + EShellView *shell_view; EShellWindow *shell_window; EAccountList *accounts; GtkWidget *menu; @@ -1376,7 +1451,8 @@ create_send_receive_submenu (EMailShellView *mail_shell_view) g_return_val_if_fail (mail_shell_view != NULL, NULL); - shell_window = e_shell_view_get_shell_window (E_SHELL_VIEW (mail_shell_view)); + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); accounts = e_get_account_list (); menu = gtk_menu_new (); @@ -1385,17 +1461,27 @@ create_send_receive_submenu (EMailShellView *mail_shell_view) action = e_shell_window_get_action (shell_window, "mail-send-receive"); gtk_action_set_accel_group (action, accel_group); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_action_create_menu_item (action)); + gtk_menu_shell_append ( + GTK_MENU_SHELL (menu), + gtk_action_create_menu_item (action)); - action = e_shell_window_get_action (shell_window, "mail-send-receive-receive-all"); + action = e_shell_window_get_action ( + shell_window, "mail-send-receive-receive-all"); gtk_action_set_accel_group (action, accel_group); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_action_create_menu_item (action)); + gtk_menu_shell_append ( + GTK_MENU_SHELL (menu), + gtk_action_create_menu_item (action)); - action = e_shell_window_get_action (shell_window, "mail-send-receive-send-all"); + action = e_shell_window_get_action ( + shell_window, "mail-send-receive-send-all"); gtk_action_set_accel_group (action, accel_group); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_action_create_menu_item (action)); + gtk_menu_shell_append ( + GTK_MENU_SHELL (menu), + gtk_action_create_menu_item (action)); - gtk_menu_shell_append (GTK_MENU_SHELL (menu), gtk_separator_menu_item_new ()); + gtk_menu_shell_append ( + GTK_MENU_SHELL (menu), + gtk_separator_menu_item_new ()); if (accounts) { EIterator *iterator; @@ -1403,21 +1489,34 @@ create_send_receive_submenu (EMailShellView *mail_shell_view) for (iterator = e_list_get_iterator (E_LIST (accounts)); e_iterator_is_valid (iterator); e_iterator_next (iterator)) { - EAccount *account = (EAccount *) e_iterator_get (iterator); + EAccount *account; + + account = (EAccount *) e_iterator_get (iterator); - if (!account || !account->enabled) + if (account == NULL) continue; - send_receive_add_to_menu (GTK_MENU_SHELL (menu), account, -1); + if (!account->enabled) + continue; + + send_receive_add_to_menu ( + GTK_MENU_SHELL (menu), account, -1); } g_object_unref (iterator); - g_signal_connect (accounts, "account-added", G_CALLBACK (send_receive_menu_account_added_cb), menu); - g_signal_connect (accounts, "account-changed", G_CALLBACK (send_receive_menu_account_changed_cb), menu); - g_signal_connect (accounts, "account-removed", G_CALLBACK (send_receive_menu_account_removed_cb), menu); - - g_object_weak_ref (G_OBJECT (menu), menu_weak_ref_cb, accounts); + g_signal_connect ( + accounts, "account-added", + G_CALLBACK (send_receive_menu_account_added_cb), menu); + g_signal_connect ( + accounts, "account-changed", + G_CALLBACK (send_receive_menu_account_changed_cb), menu); + g_signal_connect ( + accounts, "account-removed", + G_CALLBACK (send_receive_menu_account_removed_cb), menu); + + g_object_weak_ref ( + G_OBJECT (menu), menu_weak_ref_cb, accounts); } gtk_widget_show_all (menu); @@ -1432,24 +1531,31 @@ e_mail_shell_view_update_send_receive_menus (EMailShellView *mail_shell_view) { EMailShellViewPrivate *priv; EShellWindow *shell_window; + EShellView *shell_view; GtkWidget *widget; + const gchar *widget_path; - g_return_if_fail (mail_shell_view != NULL); + g_return_if_fail (E_IS_MAIL_SHELL_VIEW (mail_shell_view)); priv = E_MAIL_SHELL_VIEW_GET_PRIVATE (mail_shell_view); - g_return_if_fail (priv != NULL); - if (!e_shell_view_is_active (E_SHELL_VIEW (mail_shell_view))) { + shell_view = E_SHELL_VIEW (mail_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + + if (!e_shell_view_is_active (shell_view)) { if (priv->send_receive_tool_item) { GtkWidget *toolbar; - shell_window = e_shell_view_get_shell_window (E_SHELL_VIEW (mail_shell_view)); - - toolbar = e_shell_window_get_managed_widget (shell_window, "/main-toolbar"); + toolbar = e_shell_window_get_managed_widget ( + shell_window, "/main-toolbar"); g_return_if_fail (toolbar != NULL); - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (priv->send_receive_tool_item)); - gtk_container_remove (GTK_CONTAINER (toolbar), GTK_WIDGET (priv->send_receive_tool_separator)); + gtk_container_remove ( + GTK_CONTAINER (toolbar), + GTK_WIDGET (priv->send_receive_tool_item)); + gtk_container_remove ( + GTK_CONTAINER (toolbar), + GTK_WIDGET (priv->send_receive_tool_separator)); priv->send_receive_tool_item = NULL; priv->send_receive_tool_separator = NULL; @@ -1458,31 +1564,40 @@ e_mail_shell_view_update_send_receive_menus (EMailShellView *mail_shell_view) return; } - shell_window = e_shell_view_get_shell_window (E_SHELL_VIEW (mail_shell_view)); - - widget = e_shell_window_get_managed_widget (shell_window, "/main-menu/file-menu/mail-send-receiver/mail-send-receive-submenu"); - if (widget) - gtk_menu_item_set_submenu (GTK_MENU_ITEM (widget), create_send_receive_submenu (mail_shell_view)); + widget_path = + "/main-menu/file-menu" + "/mail-send-receiver/mail-send-receive-submenu"; + widget = e_shell_window_get_managed_widget (shell_window, widget_path); + if (widget != NULL) + gtk_menu_item_set_submenu ( + GTK_MENU_ITEM (widget), + create_send_receive_submenu (mail_shell_view)); if (!priv->send_receive_tool_item) { GtkWidget *toolbar; GtkToolItem *tool_item; gint index; - toolbar = e_shell_window_get_managed_widget (shell_window, "/main-toolbar"); + toolbar = e_shell_window_get_managed_widget ( + shell_window, "/main-toolbar"); g_return_if_fail (toolbar != NULL); - widget = e_shell_window_get_managed_widget (shell_window, "/main-toolbar/toolbar-actions/mail-send-receiver"); + widget_path = + "/main-toolbar/toolbar-actions/mail-send-receiver"; + widget = e_shell_window_get_managed_widget ( + shell_window, widget_path); g_return_if_fail (widget != NULL); - index = gtk_toolbar_get_item_index (GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (widget)); + index = gtk_toolbar_get_item_index ( + GTK_TOOLBAR (toolbar), GTK_TOOL_ITEM (widget)); tool_item = gtk_separator_tool_item_new (); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), tool_item, index); gtk_widget_show (GTK_WIDGET (tool_item)); priv->send_receive_tool_separator = tool_item; - tool_item = GTK_TOOL_ITEM (e_menu_tool_button_new (_("Send / Receive"))); + tool_item = GTK_TOOL_ITEM ( + e_menu_tool_button_new (_("Send / Receive"))); gtk_tool_item_set_is_important (tool_item, TRUE); gtk_toolbar_insert (GTK_TOOLBAR (toolbar), tool_item, index); gtk_widget_show (GTK_WIDGET (tool_item)); @@ -1495,5 +1610,7 @@ e_mail_shell_view_update_send_receive_menus (EMailShellView *mail_shell_view) } if (priv->send_receive_tool_item) - gtk_menu_tool_button_set_menu (GTK_MENU_TOOL_BUTTON (priv->send_receive_tool_item), create_send_receive_submenu (mail_shell_view)); + gtk_menu_tool_button_set_menu ( + GTK_MENU_TOOL_BUTTON (priv->send_receive_tool_item), + create_send_receive_submenu (mail_shell_view)); } diff --git a/plugins/caldav/caldav-source.c b/plugins/caldav/caldav-source.c index 8c99c81567..6f50ae4dcb 100644 --- a/plugins/caldav/caldav-source.c +++ b/plugins/caldav/caldav-source.c @@ -252,7 +252,9 @@ oge_caldav (EPlugin *epl, g_free (username); mail = e_plugin_util_add_entry (parent, _("User e-_mail:"), source, "usermail"); - autoschedule = e_plugin_util_add_check (parent, _("Server _handles meeting invitations"), source, "autoschedule", "1", "0"); + autoschedule = e_plugin_util_add_check ( + parent, _("Server _handles meeting invitations"), + source, "autoschedule", "1", "0"); browse_cal = gtk_button_new_with_mnemonic (_("Brows_e server for a calendar")); gtk_widget_show (browse_cal); diff --git a/plugins/google-account-setup/google-contacts-source.c b/plugins/google-account-setup/google-contacts-source.c index 85e52df1c3..46f0d4362c 100644 --- a/plugins/google-account-setup/google-contacts-source.c +++ b/plugins/google-account-setup/google-contacts-source.c @@ -213,8 +213,12 @@ check_username_filled (ESource *source) g_return_val_if_fail (source != NULL, NULL); - if (g_ascii_strncasecmp (GOOGLE_BASE_URI, e_source_group_peek_base_uri (e_source_peek_group (source)), strlen (GOOGLE_BASE_URI)) == 0) { - gchar *username = g_strdup (e_source_get_property (source, "username")); + if (g_ascii_strncasecmp ( + GOOGLE_BASE_URI, e_source_group_peek_base_uri ( + e_source_peek_group (source)), strlen (GOOGLE_BASE_URI)) == 0) { + gchar *username; + + username = g_strdup (e_source_get_property (source, "username")); if (username) username = g_strstrip (username); @@ -238,7 +242,7 @@ plugin_google_contacts_check (EPlugin *epl, EConfigHookPageCheckData *data) t = (EABConfigTargetSource *) data->target; g_return_val_if_fail (t->source != NULL, NULL); - return check_username_filled (t->source); + return check_username_filled (t->source); } struct ui_data { diff --git a/plugins/vcard-inline/vcard-inline.c b/plugins/vcard-inline/vcard-inline.c index dfa19666e9..c4ab567b22 100644 --- a/plugins/vcard-inline/vcard-inline.c +++ b/plugins/vcard-inline/vcard-inline.c @@ -158,14 +158,17 @@ org_gnome_vcard_inline_save_cb (VCardInlinePObject *vcard_object) dialog = e_source_selector_dialog_new (NULL, vcard_object->source_list); - e_source_selector_dialog_select_default_source (E_SOURCE_SELECTOR_DIALOG (dialog)); + e_source_selector_dialog_select_default_source ( + E_SOURCE_SELECTOR_DIALOG (dialog)); if (gtk_dialog_run (GTK_DIALOG (dialog)) != GTK_RESPONSE_OK) { gtk_widget_destroy (dialog); return; } - source = e_source_selector_dialog_peek_primary_selection (E_SOURCE_SELECTOR_DIALOG (dialog)); + source = e_source_selector_dialog_peek_primary_selection ( + E_SOURCE_SELECTOR_DIALOG (dialog)); + gtk_widget_destroy (dialog); g_return_if_fail (source != NULL); diff --git a/shell/main.c b/shell/main.c index bad10a3f5a..f9c9651e49 100644 --- a/shell/main.c +++ b/shell/main.c @@ -360,8 +360,11 @@ static GOptionEntry entries[] = { NULL, NULL }, #endif /* G_OS_WIN32 */ { "component", 'c', 0, G_OPTION_ARG_STRING, &requested_view, - /* Translators: Do NOT translate the five component names, they MUST remain in English! */ - N_("Start Evolution showing the specified component. Available options are 'mail', 'calendar', 'contacts', 'tasks', and 'memos'"), NULL }, + /* Translators: Do NOT translate the five component + * names, they MUST remain in English! */ + N_("Start Evolution showing the specified component. " + "Available options are 'mail', 'calendar', 'contacts', " + "'tasks', and 'memos'"), NULL }, { "geometry", 'g', 0, G_OPTION_ARG_STRING, &geometry, N_("Apply the given geometry to the main window"), "GEOMETRY" }, { "offline", '\0', 0, G_OPTION_ARG_NONE, &start_offline, diff --git a/widgets/misc/e-alert-bar.c b/widgets/misc/e-alert-bar.c index c20a74e4d0..d5c1f953d4 100644 --- a/widgets/misc/e-alert-bar.c +++ b/widgets/misc/e-alert-bar.c @@ -243,33 +243,31 @@ e_alert_bar_new (void) return g_object_new (E_TYPE_ALERT_BAR, NULL); } -struct DuplicateData -{ +typedef struct { gboolean found; EAlert *looking_for; -}; +} DuplicateData; static void -find_duplicate_cb (gpointer data, gpointer user_data) +alert_bar_find_duplicate_cb (EAlert *alert, + DuplicateData *dd) { - EAlert *alert = data; - struct DuplicateData *dd = user_data; - - g_return_if_fail (alert != NULL); - g_return_if_fail (dd != NULL); g_return_if_fail (dd->looking_for != NULL); - dd->found = dd->found || ( - e_alert_get_message_type (alert) == e_alert_get_message_type (dd->looking_for) && - g_strcmp0 (e_alert_get_primary_text (alert), e_alert_get_primary_text (dd->looking_for)) == 0 && - g_strcmp0 (e_alert_get_secondary_text (alert), e_alert_get_secondary_text (dd->looking_for)) == 0); + dd->found |= ( + e_alert_get_message_type (alert) == + e_alert_get_message_type (dd->looking_for) && + g_strcmp0 (e_alert_get_primary_text (alert), + e_alert_get_primary_text (dd->looking_for)) == 0 && + g_strcmp0 (e_alert_get_secondary_text (alert), + e_alert_get_secondary_text (dd->looking_for)) == 0); } void e_alert_bar_add_alert (EAlertBar *alert_bar, EAlert *alert) { - struct DuplicateData dd; + DuplicateData dd; g_return_if_fail (E_IS_ALERT_BAR (alert_bar)); g_return_if_fail (E_IS_ALERT (alert)); @@ -277,7 +275,9 @@ e_alert_bar_add_alert (EAlertBar *alert_bar, dd.found = FALSE; dd.looking_for = alert; - g_queue_foreach (&alert_bar->priv->alerts, find_duplicate_cb, &dd); + g_queue_foreach ( + &alert_bar->priv->alerts, + (GFunc) alert_bar_find_duplicate_cb, &dd); if (dd.found) return; diff --git a/widgets/misc/e-canvas.c b/widgets/misc/e-canvas.c index 70785773a0..cca6d92670 100644 --- a/widgets/misc/e-canvas.c +++ b/widgets/misc/e-canvas.c @@ -278,7 +278,9 @@ pick_current_item (GnomeCanvas *canvas, GdkEvent *event) /* find the closest item */ if (canvas->root->flags & GNOME_CANVAS_ITEM_VISIBLE) - canvas->new_current_item = gnome_canvas_item_invoke_point (canvas->root, x, y, cx, cy); + canvas->new_current_item = + gnome_canvas_item_invoke_point ( + canvas->root, x, y, cx, cy); else canvas->new_current_item = NULL; } else diff --git a/widgets/misc/e-dateedit.c b/widgets/misc/e-dateedit.c index 0a2b744372..d2c7dc200a 100644 --- a/widgets/misc/e-dateedit.c +++ b/widgets/misc/e-dateedit.c @@ -1570,6 +1570,7 @@ static void rebuild_time_popup (EDateEdit *dedit) { EDateEditPrivate *priv; + GtkTreeModel *model; GtkListStore *list_store; GtkTreeIter iter; gchar buffer[40]; @@ -1578,7 +1579,8 @@ rebuild_time_popup (EDateEdit *dedit) priv = dedit->priv; - list_store = GTK_LIST_STORE (gtk_combo_box_get_model (GTK_COMBO_BOX (priv->time_combo))); + model = gtk_combo_box_get_model (GTK_COMBO_BOX (priv->time_combo)); + list_store = GTK_LIST_STORE (model); gtk_list_store_clear (list_store); /* Fill the struct tm with some sane values. */ diff --git a/widgets/misc/e-map.c b/widgets/misc/e-map.c index f4c981b601..405a55d686 100644 --- a/widgets/misc/e-map.c +++ b/widgets/misc/e-map.c @@ -118,9 +118,6 @@ enum { /* Internal prototypes */ -static void e_map_get_current_location (EMap *map, gdouble *longitude, gdouble *latitude); -static void e_map_world_to_render_surface (EMap *map, gdouble world_longitude, gdouble world_latitude, - gdouble *win_x, gdouble *win_y); static void update_render_surface (EMap *map, gboolean render_overlays); static void set_scroll_area (EMap *map, gint width, gint height); static void center_at (EMap *map, gdouble longitude, gdouble latitude); @@ -205,7 +202,11 @@ e_map_start_tweening (EMap *map) } static void -e_map_tween_new (EMap *map, guint msecs, gdouble longitude_offset, gdouble latitude_offset, gdouble zoom_factor) +e_map_tween_new (EMap *map, + guint msecs, + gdouble longitude_offset, + gdouble latitude_offset, + gdouble zoom_factor) { EMapTween *tween; @@ -234,6 +235,37 @@ G_DEFINE_TYPE_WITH_CODE ( G_IMPLEMENT_INTERFACE (GTK_TYPE_SCROLLABLE, NULL)) static void +e_map_get_current_location (EMap *map, + gdouble *longitude, + gdouble *latitude) +{ + GtkAllocation allocation; + + gtk_widget_get_allocation (GTK_WIDGET (map), &allocation); + + e_map_window_to_world ( + map, allocation.width / 2.0, + allocation.height / 2.0, + longitude, latitude); +} + +static void +e_map_world_to_render_surface (EMap *map, + gdouble world_longitude, + gdouble world_latitude, + gdouble *win_x, + gdouble *win_y) +{ + gint width, height; + + width = E_MAP_GET_WIDTH (map); + height = E_MAP_GET_HEIGHT (map); + + *win_x = (width / 2.0 + (width / 2.0) * world_longitude / 180.0); + *win_y = (height / 2.0 - (height / 2.0) * world_latitude / 90.0); +} + +static void e_map_tween_new_from (EMap *map, guint msecs, gdouble longitude, @@ -393,14 +425,18 @@ e_map_set_hadjustment (EMap *map, GtkAdjustment *adjustment) return; if (priv->hadjustment != NULL) { - g_signal_handlers_disconnect_matched (priv->hadjustment, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, map); + g_signal_handlers_disconnect_matched ( + priv->hadjustment, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, map); g_object_unref (priv->hadjustment); } if (!adjustment) adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); - g_signal_connect (adjustment, "value-changed", G_CALLBACK (e_map_adjustment_changed), map); + g_signal_connect ( + adjustment, "value-changed", + G_CALLBACK (e_map_adjustment_changed), map); priv->hadjustment = g_object_ref_sink (adjustment); e_map_set_hadjustment_values (map); @@ -416,14 +452,18 @@ e_map_set_vadjustment (EMap *map, GtkAdjustment *adjustment) return; if (priv->vadjustment != NULL) { - g_signal_handlers_disconnect_matched (priv->vadjustment, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, map); + g_signal_handlers_disconnect_matched ( + priv->vadjustment, G_SIGNAL_MATCH_DATA, + 0, 0, NULL, NULL, map); g_object_unref (priv->vadjustment); } if (!adjustment) adjustment = gtk_adjustment_new (0.0, 0.0, 0.0, 0.0, 0.0, 0.0); - g_signal_connect (adjustment, "value-changed", G_CALLBACK (e_map_adjustment_changed), map); + g_signal_connect ( + adjustment, "value-changed", + G_CALLBACK (e_map_adjustment_changed), map); priv->vadjustment = g_object_ref_sink (adjustment); e_map_set_vadjustment_values (map); @@ -435,7 +475,10 @@ e_map_set_vadjustment (EMap *map, GtkAdjustment *adjustment) * ----------------- */ static void -e_map_set_property (GObject *object, guint prop_id, const GValue *value, GParamSpec *pspec) +e_map_set_property (GObject *object, + guint prop_id, + const GValue *value, + GParamSpec *pspec) { EMap *map; @@ -464,7 +507,10 @@ e_map_set_property (GObject *object, guint prop_id, const GValue *value, GParamS } static void -e_map_get_property (GObject *object, guint prop_id, GValue *value, GParamSpec *pspec) +e_map_get_property (GObject *object, + guint prop_id, + GValue *value, + GParamSpec *pspec) { EMap *map; @@ -750,10 +796,14 @@ e_map_class_init (EMapClass *class) object_class->get_property = e_map_get_property; /* Scrollable interface properties */ - g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment"); - g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment"); - g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); - g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); + g_object_class_override_property ( + object_class, PROP_HADJUSTMENT, "hadjustment"); + g_object_class_override_property ( + object_class, PROP_VADJUSTMENT, "vadjustment"); + g_object_class_override_property ( + object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); + g_object_class_override_property ( + object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); widget_class = GTK_WIDGET_CLASS (class); widget_class->realize = e_map_realize; @@ -772,7 +822,10 @@ static void e_map_init (EMap *map) { GtkWidget *widget; - gchar *map_file_name = g_build_filename (EVOLUTION_IMAGESDIR, "world_map-960.png", NULL); + gchar *map_file_name; + + map_file_name = g_build_filename ( + EVOLUTION_IMAGESDIR, "world_map-960.png", NULL); widget = GTK_WIDGET (map); @@ -812,7 +865,10 @@ e_map_new (void) a11y = gtk_widget_get_accessible (widget); atk_object_set_name (a11y, _("World Map")); atk_object_set_role (a11y, ATK_ROLE_IMAGE); - atk_object_set_description (a11y, _("Mouse-based interactive map widget for selecting timezone. Keyboard users should instead select the timezone from the drop-down combination box below.")); + atk_object_set_description ( + a11y, _("Mouse-based interactive map widget for selecting " + "timezone. Keyboard users should instead select the timezone " + "from the drop-down combination box below.")); return (E_MAP (widget)); } @@ -825,7 +881,11 @@ e_map_new (void) * Latitude E <-90, 90] */ void -e_map_window_to_world (EMap *map, gdouble win_x, gdouble win_y, gdouble *world_longitude, gdouble *world_latitude) +e_map_window_to_world (EMap *map, + gdouble win_x, + gdouble win_y, + gdouble *world_longitude, + gdouble *world_latitude) { gint width, height; @@ -842,33 +902,23 @@ e_map_window_to_world (EMap *map, gdouble win_x, gdouble win_y, gdouble *world_l ((gdouble) height / 2.0) * 90.0; } -static void -e_map_world_to_render_surface (EMap *map, gdouble world_longitude, gdouble world_latitude, gdouble *win_x, gdouble *win_y) -{ - gint width, height; - - width = E_MAP_GET_WIDTH (map); - height = E_MAP_GET_HEIGHT (map); - - *win_x = (width / 2.0 + (width / 2.0) * world_longitude / 180.0); - *win_y = (height / 2.0 - (height / 2.0) * world_latitude / 90.0); -} - void -e_map_world_to_window (EMap *map, gdouble world_longitude, gdouble world_latitude, gdouble *win_x, gdouble *win_y) +e_map_world_to_window (EMap *map, + gdouble world_longitude, + gdouble world_latitude, + gdouble *win_x, + gdouble *win_y) { g_return_if_fail (E_IS_MAP (map)); g_return_if_fail (gtk_widget_get_realized (GTK_WIDGET (map))); g_return_if_fail (world_longitude >= -180.0 && world_longitude <= 180.0); g_return_if_fail (world_latitude >= -90.0 && world_latitude <= 90.0); - e_map_world_to_render_surface (map, world_longitude, world_latitude, win_x, win_y); + e_map_world_to_render_surface ( + map, world_longitude, world_latitude, win_x, win_y); + *win_x -= map->priv->xofs; *win_y -= map->priv->yofs; - -#ifdef DEBUG - printf ("Map size: (%d, %d)\nCoords: (%.1f, %.1f) -> (%.1f, %.1f)\n---\n", width, height, world_longitude, world_latitude, *win_x, *win_y); -#endif } /* --- Zoom --- */ @@ -954,7 +1004,11 @@ e_map_thaw (EMap *map) /* --- Point manipulation --- */ EMapPoint * -e_map_add_point (EMap *map, gchar *name, gdouble longitude, gdouble latitude, guint32 color_rgba) +e_map_add_point (EMap *map, + gchar *name, + gdouble longitude, + gdouble latitude, + guint32 color_rgba) { EMapPoint *point; @@ -994,7 +1048,9 @@ e_map_remove_point (EMap *map, EMapPoint *point) } void -e_map_point_get_location (EMapPoint *point, gdouble *longitude, gdouble *latitude) +e_map_point_get_location (EMapPoint *point, + gdouble *longitude, + gdouble *latitude) { *longitude = point->longitude; *latitude = point->latitude; @@ -1013,7 +1069,9 @@ e_map_point_get_color_rgba (EMapPoint *point) } void -e_map_point_set_color_rgba (EMap *map, EMapPoint *point, guint32 color_rgba) +e_map_point_set_color_rgba (EMap *map, + EMapPoint *point, + guint32 color_rgba) { point->rgba = color_rgba; @@ -1057,7 +1115,10 @@ e_map_point_is_in_view (EMap *map, EMapPoint *point) } EMapPoint * -e_map_get_closest_point (EMap *map, gdouble longitude, gdouble latitude, gboolean in_view) +e_map_get_closest_point (EMap *map, + gdouble longitude, + gdouble latitude, + gboolean in_view) { EMapPoint *point_chosen = NULL, *point; gdouble min_dist = 0.0, dist; @@ -1284,19 +1345,7 @@ scroll_to (EMap *map, gint x, gint y) } static void -e_map_get_current_location (EMap *map, gdouble *longitude, gdouble *latitude) -{ - GtkAllocation allocation; - - gtk_widget_get_allocation (GTK_WIDGET (map), &allocation); - - e_map_window_to_world (map, - allocation.width / 2.0, allocation.height / 2.0, - longitude, latitude); -} - -static void -set_scroll_area (EMap *view, int width, int height) +set_scroll_area (EMap *view, gint width, gint height) { EMapPrivate *priv; GtkAllocation allocation; diff --git a/widgets/table/e-table-click-to-add.h b/widgets/table/e-table-click-to-add.h index 49f8df334c..b92672d387 100644 --- a/widgets/table/e-table-click-to-add.h +++ b/widgets/table/e-table-click-to-add.h @@ -64,7 +64,8 @@ struct _ETableClickToAdd { gchar *message; - GnomeCanvasItem *row; /* If row is NULL, we're sitting with no data and a "Click here" message. */ + GnomeCanvasItem *row; /* If row is NULL, we're sitting with + * no data and a "Click here" message. */ GnomeCanvasItem *text; /* If text is NULL, row shouldn't be. */ GnomeCanvasItem *rect; /* What the heck. Why not. */ diff --git a/widgets/table/e-table-field-chooser-item.c b/widgets/table/e-table-field-chooser-item.c index 411c1b58f4..91a77c83c5 100644 --- a/widgets/table/e-table-field-chooser-item.c +++ b/widgets/table/e-table-field-chooser-item.c @@ -582,7 +582,8 @@ etfci_start_drag (ETableFieldChooserItem *etfci, GdkEvent *event, gdouble x, gdo button_height = e_table_header_compute_height (ecol, widget); window = gtk_widget_get_window (widget); - cs = gdk_window_create_similar_surface (window, CAIRO_CONTENT_COLOR, etfci->width, button_height); + cs = gdk_window_create_similar_surface ( + window, CAIRO_CONTENT_COLOR, etfci->width, button_height); style = gtk_widget_get_style (widget); state = gtk_widget_get_state (widget); diff --git a/widgets/table/e-table-header-item.c b/widgets/table/e-table-header-item.c index b7388fdfaa..0c56b59ea2 100644 --- a/widgets/table/e-table-header-item.c +++ b/widgets/table/e-table-header-item.c @@ -1235,9 +1235,8 @@ ethi_start_drag (ETableHeaderItem *ethi, GdkEvent *event) col_width = ecol->width; s = cairo_image_surface_create (CAIRO_FORMAT_A1, col_width, ethi->height); cr = cairo_create (s); - pixbuf = gdk_pixbuf_get_from_surface(s, - 0, 0, - col_width, ethi->height); + pixbuf = gdk_pixbuf_get_from_surface ( + s, 0, 0, col_width, ethi->height); state = gtk_widget_get_state (widget); diff --git a/widgets/table/e-table-header-item.h b/widgets/table/e-table-header-item.h index 4ab483a4ce..96f167b4e8 100644 --- a/widgets/table/e-table-header-item.h +++ b/widgets/table/e-table-header-item.h @@ -56,25 +56,25 @@ typedef struct _ETableHeaderItem ETableHeaderItem; typedef struct _ETableHeaderItemClass ETableHeaderItemClass; struct _ETableHeaderItem { - GnomeCanvasItem parent; - ETableHeader *eth; + GnomeCanvasItem parent; + ETableHeader *eth; - GdkCursor *change_cursor; - GdkCursor *resize_cursor; + GdkCursor *change_cursor; + GdkCursor *resize_cursor; - gshort height, width; + gshort height, width; PangoFontDescription *font_desc; /* - * Used during resizing; Could be shorts + * Used during resizing; Could be shorts */ - gint resize_col; - gint resize_start_pos; - gint resize_min_width; + gint resize_col; + gint resize_start_pos; + gint resize_min_width; - gpointer resize_guide; + gpointer resize_guide; - gint group_indent_width; + gint group_indent_width; /* * Ids @@ -84,20 +84,25 @@ struct _ETableHeaderItem { /* * For dragging columns */ - guint maybe_drag:1; - guint dnd_ready:1; - gint click_x, click_y; - gint drag_col, drop_col, drag_mark; - guint drag_motion_id, drag_end_id, drag_leave_id, drag_drop_id, drag_data_received_id, drag_data_get_id; - guint sort_info_changed_id, group_info_changed_id; + guint maybe_drag:1; + guint dnd_ready:1; + gint click_x, click_y; + gint drag_col, drop_col, drag_mark; + guint drag_motion_id; + guint drag_end_id; + guint drag_leave_id; + guint drag_drop_id; + guint drag_data_received_id; + guint drag_data_get_id; + guint sort_info_changed_id, group_info_changed_id; GnomeCanvasItem *remove_item; - gchar *dnd_code; + gchar *dnd_code; /* * For column sorting info */ - ETableSortInfo *sort_info; + ETableSortInfo *sort_info; guint scroll_direction : 4; gint last_drop_x; @@ -107,10 +112,10 @@ struct _ETableHeaderItem { gint scroll_idle_id; /* For adding fields. */ - ETableHeader *full_header; - ETable *table; - ETree *tree; - void *config; + ETableHeader *full_header; + ETable *table; + ETree *tree; + gpointer config; union { GtkWidget *widget; diff --git a/widgets/table/e-table-header-utils.c b/widgets/table/e-table-header-utils.c index da60ce03d9..55e90159c6 100644 --- a/widgets/table/e-table-header-utils.c +++ b/widgets/table/e-table-header-utils.c @@ -272,7 +272,8 @@ e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, } cairo_save (cr); - gdk_cairo_set_source_color (cr, >k_widget_get_style (GTK_WIDGET (g_label))->fg[state]); + gdk_cairo_set_source_color ( + cr, >k_widget_get_style (GTK_WIDGET (g_label))->fg[state]); xthick = style->xthickness; ythick = style->ythickness; @@ -321,7 +322,7 @@ e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, } layout = build_header_layout (widget, ecol->text); - pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); + pango_layout_set_ellipsize (layout, PANGO_ELLIPSIZE_END); /* Pixbuf or label */ if (ecol->icon_name != NULL) { @@ -351,10 +352,12 @@ e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, ypos = inner_y; - pango_layout_set_width (layout, (inner_width - (xpos - inner_x)) * PANGO_SCALE); + pango_layout_set_width ( + layout, (inner_width - (xpos - inner_x)) * + PANGO_SCALE); - cairo_move_to (cr, xpos + pwidth + 1, ypos); - pango_cairo_show_layout (cr, layout); + cairo_move_to (cr, xpos + pwidth + 1, ypos); + pango_cairo_show_layout (cr, layout); } /* FIXME: For some reason, under clutter gdk_draw_rgb_image_dithalign crashes @@ -377,14 +380,14 @@ e_table_header_draw_button (cairo_t *cr, ETableCol *ecol, g_object_unref (pixmap); } #endif - gdk_cairo_set_source_pixbuf (cr, ecol->pixbuf, + gdk_cairo_set_source_pixbuf (cr, ecol->pixbuf, xpos, inner_y + (inner_height - clip_height) / 2); - cairo_paint (cr); + cairo_paint (cr); } else { - pango_layout_set_width (layout, inner_width * PANGO_SCALE); + pango_layout_set_width (layout, inner_width * PANGO_SCALE); - cairo_move_to (cr, inner_x, inner_y); - pango_cairo_show_layout (cr, layout); + cairo_move_to (cr, inner_x, inner_y); + pango_cairo_show_layout (cr, layout); } switch (arrow) { diff --git a/widgets/table/e-table-item.c b/widgets/table/e-table-item.c index d5c9c2da14..75a8f44d5d 100644 --- a/widgets/table/e-table-item.c +++ b/widgets/table/e-table-item.c @@ -1743,7 +1743,7 @@ eti_draw (GnomeCanvasItem *item, cairo_t *cr, gint x, gint y, gint width, gint h GtkWidget *canvas = GTK_WIDGET (item->canvas); GtkStyle *style = gtk_widget_get_style (canvas); gint height_extra = eti->horizontal_draw_grid ? 1 : 0; - + /* * Find out our real position after grouping */ diff --git a/widgets/table/e-table.c b/widgets/table/e-table.c index 69e4241a7a..5028a48a6b 100644 --- a/widgets/table/e-table.c +++ b/widgets/table/e-table.c @@ -234,17 +234,21 @@ static void et_get_preferred_width (GtkWidget *widget, gint *minimum, gint *natural) { ETable *et = E_TABLE (widget); - GTK_WIDGET_CLASS (e_table_parent_class)->get_preferred_width (widget, minimum, natural); + + GTK_WIDGET_CLASS (e_table_parent_class)-> + get_preferred_width (widget, minimum, natural); + if (et->horizontal_resize) { - *minimum = MAX (*minimum, et->header_width); - *natural = MAX (*natural, et->header_width); - } + *minimum = MAX (*minimum, et->header_width); + *natural = MAX (*natural, et->header_width); + } } static void et_get_preferred_height (GtkWidget *widget, gint *minimum, gint *natural) { - GTK_WIDGET_CLASS (e_table_parent_class)->get_preferred_height (widget, minimum, natural); + GTK_WIDGET_CLASS (e_table_parent_class)-> + get_preferred_height (widget, minimum, natural); } static void @@ -3538,10 +3542,14 @@ e_table_class_init (ETableClass *class) G_PARAM_STATIC_STRINGS)); /* Scrollable interface */ - g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment"); - g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment"); - g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); - g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); + g_object_class_override_property ( + object_class, PROP_HADJUSTMENT, "hadjustment"); + g_object_class_override_property ( + object_class, PROP_VADJUSTMENT, "vadjustment"); + g_object_class_override_property ( + object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); + g_object_class_override_property ( + object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); gal_a11y_e_table_init (); } diff --git a/widgets/table/e-tree-model.h b/widgets/table/e-tree-model.h index 01c4bf4180..f857e52a49 100644 --- a/widgets/table/e-tree-model.h +++ b/widgets/table/e-tree-model.h @@ -227,24 +227,24 @@ void *e_tree_model_value_at (ETreeModel *etree, void e_tree_model_set_value_at (ETreeModel *etree, ETreePath node, gint col, - const void *val); + gconstpointer val); gboolean e_tree_model_node_is_editable (ETreeModel *etree, ETreePath node, gint col); void *e_tree_model_duplicate_value (ETreeModel *etree, gint col, - const void *value); + gconstpointer value); void e_tree_model_free_value (ETreeModel *etree, gint col, - void *value); + gpointer value); void *e_tree_model_initialize_value (ETreeModel *etree, gint col); gboolean e_tree_model_value_is_empty (ETreeModel *etree, gint col, - const void *value); + gconstpointer value); gchar * e_tree_model_value_to_string (ETreeModel *etree, gint col, - const void *value); + gconstpointer value); /* depth first traversal of path's descendents, calling func on each one */ void e_tree_model_node_traverse (ETreeModel *model, diff --git a/widgets/table/e-tree.c b/widgets/table/e-tree.c index 4471514d68..b77bda8ef7 100644 --- a/widgets/table/e-tree.c +++ b/widgets/table/e-tree.c @@ -1922,25 +1922,33 @@ et_get_property (GObject *object, break; case PROP_HADJUSTMENT: if (etree->priv->table_canvas) - g_object_get_property (G_OBJECT (etree->priv->table_canvas), "hadjustment", value); + g_object_get_property ( + G_OBJECT (etree->priv->table_canvas), + "hadjustment", value); else g_value_set_object (value, NULL); break; case PROP_VADJUSTMENT: if (etree->priv->table_canvas) - g_object_get_property (G_OBJECT (etree->priv->table_canvas), "vadjustment", value); + g_object_get_property ( + G_OBJECT (etree->priv->table_canvas), + "vadjustment", value); else g_value_set_object (value, NULL); break; case PROP_HSCROLL_POLICY: if (etree->priv->table_canvas) - g_object_get_property (G_OBJECT (etree->priv->table_canvas), "hscroll-policy", value); + g_object_get_property ( + G_OBJECT (etree->priv->table_canvas), + "hscroll-policy", value); else g_value_set_enum (value, 0); break; case PROP_VSCROLL_POLICY: if (etree->priv->table_canvas) - g_object_get_property (G_OBJECT (etree->priv->table_canvas), "vscroll-policy", value); + g_object_get_property ( + G_OBJECT (etree->priv->table_canvas), + "vscroll-policy", value); else g_value_set_enum (value, 0); break; @@ -2018,19 +2026,27 @@ et_set_property (GObject *object, case PROP_HADJUSTMENT: if (etree->priv->table_canvas) - g_object_set_property (G_OBJECT (etree->priv->table_canvas), "hadjustment", value); + g_object_set_property ( + G_OBJECT (etree->priv->table_canvas), + "hadjustment", value); break; case PROP_VADJUSTMENT: if (etree->priv->table_canvas) - g_object_set_property (G_OBJECT (etree->priv->table_canvas), "vadjustment", value); + g_object_set_property ( + G_OBJECT (etree->priv->table_canvas), + "vadjustment", value); break; case PROP_HSCROLL_POLICY: if (etree->priv->table_canvas) - g_object_set_property (G_OBJECT (etree->priv->table_canvas), "hscroll-policy", value); + g_object_set_property ( + G_OBJECT (etree->priv->table_canvas), + "hscroll-policy", value); break; case PROP_VSCROLL_POLICY: if (etree->priv->table_canvas) - g_object_set_property (G_OBJECT (etree->priv->table_canvas), "vscroll-policy", value); + g_object_set_property ( + G_OBJECT (etree->priv->table_canvas), + "vscroll-policy", value); break; } } @@ -3548,10 +3564,14 @@ e_tree_class_init (ETreeClass *class) G_PARAM_STATIC_STRINGS)); /* Scrollable interface */ - g_object_class_override_property (object_class, PROP_HADJUSTMENT, "hadjustment"); - g_object_class_override_property (object_class, PROP_VADJUSTMENT, "vadjustment"); - g_object_class_override_property (object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); - g_object_class_override_property (object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); + g_object_class_override_property ( + object_class, PROP_HADJUSTMENT, "hadjustment"); + g_object_class_override_property ( + object_class, PROP_VADJUSTMENT, "vadjustment"); + g_object_class_override_property ( + object_class, PROP_HSCROLL_POLICY, "hscroll-policy"); + g_object_class_override_property ( + object_class, PROP_VSCROLL_POLICY, "vscroll-policy"); gal_a11y_e_tree_init (); } diff --git a/widgets/text/e-text.c b/widgets/text/e-text.c index 8070416b9a..edd0a74fcc 100644 --- a/widgets/text/e-text.c +++ b/widgets/text/e-text.c @@ -181,7 +181,8 @@ disconnect_im_context (EText *text) if (!text || !text->im_context) return; - g_signal_handlers_disconnect_matched (text->im_context, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, text); + g_signal_handlers_disconnect_matched ( + text->im_context, G_SIGNAL_MATCH_DATA, 0, 0, NULL, NULL, text); text->im_context_signals_registered = FALSE; } @@ -1123,25 +1124,28 @@ e_text_update (GnomeCanvasItem *item, const cairo_matrix_t *i2c, gint flags) if ( text->needs_recalc_bounds || (flags & GNOME_CANVAS_UPDATE_AFFINE)) { - get_bounds (text, &x1, &y1, &x2, &y2); - if ( item->x1 != x1 || - item->x2 != x2 || - item->y1 != y1 || - item->y2 != y2 ) { - gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2); - item->x1 = x1; - item->y1 = y1; - item->x2 = x2; - item->y2 = y2; - text->needs_redraw = 1; - item->canvas->need_repick = TRUE; - } - if (!text->fill_clip_rectangle) - item->canvas->need_repick = TRUE; + get_bounds (text, &x1, &y1, &x2, &y2); + if ( item->x1 != x1 || + item->x2 != x2 || + item->y1 != y1 || + item->y2 != y2 ) { + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, + item->x2, item->y2); + item->x1 = x1; + item->y1 = y1; + item->x2 = x2; + item->y2 = y2; + text->needs_redraw = 1; + item->canvas->need_repick = TRUE; + } + if (!text->fill_clip_rectangle) + item->canvas->need_repick = TRUE; text->needs_recalc_bounds = 0; } if (text->needs_redraw) { - gnome_canvas_request_redraw (item->canvas, item->x1, item->y1, item->x2, item->y2); + gnome_canvas_request_redraw ( + item->canvas, item->x1, item->y1, item->x2, item->y2); text->needs_redraw = 0; } } @@ -1201,12 +1205,16 @@ draw_pango_rectangle (cairo_t *cr, { gint width = rect.width / PANGO_SCALE; gint height = rect.height / PANGO_SCALE; + if (width <= 0) width = 1; if (height <= 0) height = 1; - cairo_rectangle (cr, x1 + rect.x / PANGO_SCALE, y1 + rect.y / PANGO_SCALE, width, height); - cairo_fill (cr); + + cairo_rectangle ( + cr, x1 + rect.x / PANGO_SCALE, + y1 + rect.y / PANGO_SCALE, width, height); + cairo_fill (cr); } static gboolean @@ -1456,11 +1464,11 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, cairo_save (cr); if (text->clip) { - cairo_rectangle (cr, - xpos, ypos, - text->clip_cwidth - text->xofs, - text->clip_cheight - text->yofs); - cairo_clip (cr); + cairo_rectangle (cr, + xpos, ypos, + text->clip_cwidth - text->xofs, + text->clip_cheight - text->yofs); + cairo_clip (cr); } if (text->editing) { @@ -1468,16 +1476,19 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, ypos -= text->yofs_edit; } - cairo_move_to (cr, xpos, ypos); - pango_cairo_show_layout (cr, text->layout); + cairo_move_to (cr, xpos, ypos); + pango_cairo_show_layout (cr, text->layout); if (text->editing) { if (text->selection_start != text->selection_end) { cairo_region_t *clip_region = cairo_region_create (); gint indices[2]; - GtkStateType state; + GtkStateType state; - state = text->has_selection ? GTK_STATE_SELECTED : GTK_STATE_ACTIVE; + if (text->has_selection) + state = GTK_STATE_SELECTED; + else + state = GTK_STATE_ACTIVE; indices[0] = MIN (text->selection_start, text->selection_end); indices[1] = MAX (text->selection_start, text->selection_end); @@ -1486,19 +1497,19 @@ e_text_draw (GnomeCanvasItem *item, cairo_t *cr, indices[0] = g_utf8_offset_to_pointer (text->text, indices[0]) - text->text; indices[1] = g_utf8_offset_to_pointer (text->text, indices[1]) - text->text; - clip_region = gdk_pango_layout_get_clip_region (text->layout, - xpos, ypos, - indices, 1); - gdk_cairo_region (cr, clip_region); - cairo_clip (cr); + clip_region = gdk_pango_layout_get_clip_region (text->layout, + xpos, ypos, + indices, 1); + gdk_cairo_region (cr, clip_region); + cairo_clip (cr); cairo_region_destroy (clip_region); - gdk_cairo_set_source_color (cr, &style->base[state]); - cairo_paint (cr); + gdk_cairo_set_source_color (cr, &style->base[state]); + cairo_paint (cr); - gdk_cairo_set_source_color (cr, &style->text[state]); - cairo_move_to (cr, xpos, ypos); - pango_cairo_show_layout (cr, text->layout); + gdk_cairo_set_source_color (cr, &style->text[state]); + cairo_move_to (cr, xpos, ypos); + pango_cairo_show_layout (cr, text->layout); } else { if (text->show_cursor) { PangoRectangle strong_pos, weak_pos; |