From bd31f49bac99f21656dc7d0352d5b3f7385f71b2 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 26 Dec 2009 00:26:18 -0500 Subject: Coding style and whitespace cleanup. --- modules/calendar/e-cal-shell-content.c | 3 +- modules/calendar/e-cal-shell-sidebar.c | 7 +++- modules/calendar/e-cal-shell-view-actions.c | 55 +++++++++++++++++++++------- modules/calendar/e-cal-shell-view-memopad.c | 6 ++- modules/calendar/e-cal-shell-view-private.c | 3 +- modules/calendar/e-cal-shell-view-taskpad.c | 6 ++- modules/calendar/e-memo-shell-sidebar.c | 7 +++- modules/calendar/e-task-shell-sidebar.c | 7 +++- modules/calendar/e-task-shell-view-actions.c | 25 ++++++++++--- modules/calendar/e-task-shell-view-private.c | 3 +- 10 files changed, 89 insertions(+), 33 deletions(-) (limited to 'modules/calendar') diff --git a/modules/calendar/e-cal-shell-content.c b/modules/calendar/e-cal-shell-content.c index 4946972efd..49b2f7f536 100644 --- a/modules/calendar/e-cal-shell-content.c +++ b/modules/calendar/e-cal-shell-content.c @@ -506,7 +506,8 @@ cal_shell_content_constructed (GObject *object) e_table_load_state (E_TABLE (widget), filename); g_free (filename); - e_cal_model_set_default_time_func (e_memo_table_get_model (E_MEMO_TABLE (widget)), gc_get_default_time, calendar); + e_cal_model_set_default_time_func ( + memo_model, gc_get_default_time, calendar); g_signal_connect_swapped ( widget, "open-component", diff --git a/modules/calendar/e-cal-shell-sidebar.c b/modules/calendar/e-cal-shell-sidebar.c index 19c75e3e82..cfe852afed 100644 --- a/modules/calendar/e-cal-shell-sidebar.c +++ b/modules/calendar/e-cal-shell-sidebar.c @@ -529,8 +529,11 @@ cal_shell_sidebar_check_state (EShellSidebar *shell_sidebar) delete = e_source_get_property (source, "delete"); can_delete &= (delete == NULL || strcmp (delete, "no") != 0); - client = g_hash_table_lookup (cal_shell_sidebar->priv->client_table, e_source_peek_uid (source)); - refresh_supported = client && e_cal_get_refresh_supported (client); + client = g_hash_table_lookup ( + cal_shell_sidebar->priv->client_table, + e_source_peek_uid (source)); + refresh_supported = + client && e_cal_get_refresh_supported (client); } if (source != NULL) diff --git a/modules/calendar/e-cal-shell-view-actions.c b/modules/calendar/e-cal-shell-view-actions.c index 117868d646..0e361c5e2c 100644 --- a/modules/calendar/e-cal-shell-view-actions.c +++ b/modules/calendar/e-cal-shell-view-actions.c @@ -170,12 +170,17 @@ action_calendar_jump_to_cb (GtkAction *action, ECalShellView *cal_shell_view) { ECalShellContent *cal_shell_content; + EShellWindow *shell_window; + EShellView *shell_view; GnomeCalendar *calendar; + shell_view = E_SHELL_VIEW (cal_shell_view); + shell_window = e_shell_view_get_shell_window (shell_view); + cal_shell_content = cal_shell_view->priv->cal_shell_content; calendar = e_cal_shell_content_get_calendar (cal_shell_content); - goto_dialog (GTK_WINDOW (gtk_widget_get_toplevel (GTK_WIDGET (cal_shell_content))), calendar); + goto_dialog (GTK_WINDOW (shell_window), calendar); } static void @@ -350,14 +355,22 @@ static void action_calendar_refresh_cb (GtkAction *action, ECalShellView *cal_shell_view) { + ECalShellContent *cal_shell_content; + ECalShellSidebar *cal_shell_sidebar; + ESourceSelector *selector; ECal *client; ECalModel *model; ESource *source; gchar *uri; GError *error = NULL; - model = e_cal_shell_content_get_model (cal_shell_view->priv->cal_shell_content); - source = e_source_selector_peek_primary_selection (e_cal_shell_sidebar_get_selector (cal_shell_view->priv->cal_shell_sidebar)); + cal_shell_content = cal_shell_view->priv->cal_shell_content; + cal_shell_sidebar = cal_shell_view->priv->cal_shell_sidebar; + + model = e_cal_shell_content_get_model (cal_shell_content); + selector = e_cal_shell_sidebar_get_selector (cal_shell_sidebar); + + source = e_source_selector_peek_primary_selection (selector); g_return_if_fail (E_IS_SOURCE (source)); uri = e_source_get_uri (source); @@ -370,7 +383,10 @@ action_calendar_refresh_cb (GtkAction *action, g_return_if_fail (e_cal_get_refresh_supported (client)); if (!e_cal_refresh (client, &error) && error) { - g_warning ("%s: Failed to refresh '%s', %s\n", G_STRFUNC, e_source_peek_name (source), error->message); + g_warning ( + "%s: Failed to refresh '%s', %s\n", + G_STRFUNC, e_source_peek_name (source), + error->message); g_error_free (error); } } @@ -1071,10 +1087,12 @@ action_event_save_as_cb (GtkAction *action, client = event->comp_data->client; icalcomp = event->comp_data->icalcomp; - /* To Translators: Default filename part saving an event to a file when no summary is filed, the '.ics' extension is concatenated to it */ + /* Translators: Default filename part saving an event to a file when + * no summary is filed, the '.ics' extension is concatenated to it. */ string = icalcomp_suggest_filename (icalcomp, _("event")); file = e_shell_run_save_dialog ( - shell, _("Save as iCalendar"), string, "*.ics:text/calendar", NULL, NULL); + shell, _("Save as iCalendar"), string, + "*.ics:text/calendar", NULL, NULL); g_free (string); if (file == NULL) return; @@ -1134,16 +1152,25 @@ edit_event_as (ECalShellView *cal_shell_view, gboolean as_meeting) /* do it on a copy, as user can cancel changes */ icalcomp = icalcomponent_new_clone (icalcomp); - #define remove_all(_kind) \ - while (prop = icalcomponent_get_first_property (icalcomp, _kind), prop != NULL) { \ - icalcomponent_remove_property (icalcomp, prop); \ - icalproperty_free (prop); \ - } + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ATTENDEE_PROPERTY); + while (prop != NULL) { + icalcomponent_remove_property (icalcomp, prop); + icalproperty_free (prop); + + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ATTENDEE_PROPERTY); + } - remove_all (ICAL_ATTENDEE_PROPERTY); - remove_all (ICAL_ORGANIZER_PROPERTY); + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ORGANIZER_PROPERTY); + while (prop != NULL) { + icalcomponent_remove_property (icalcomp, prop); + icalproperty_free (prop); - #undef remove_all + prop = icalcomponent_get_first_property ( + icalcomp, ICAL_ORGANIZER_PROPERTY); + } } e_calendar_view_edit_appointment ( diff --git a/modules/calendar/e-cal-shell-view-memopad.c b/modules/calendar/e-cal-shell-view-memopad.c index a65bf82cdd..e34dac9adb 100644 --- a/modules/calendar/e-cal-shell-view-memopad.c +++ b/modules/calendar/e-cal-shell-view-memopad.c @@ -219,10 +219,12 @@ action_calendar_memopad_save_as_cb (GtkAction *action, comp_data = list->data; g_slist_free (list); - /* To Translators: Default filename part saving a memo to a file when no summary is filed, the '.ics' extension is concatenated to it */ + /* Translators: Default filename part saving a memo to a file when + * no summary is filed, the '.ics' extension is concatenated to it. */ string = icalcomp_suggest_filename (comp_data->icalcomp, _("memo")); file = e_shell_run_save_dialog ( - shell, _("Save as iCalendar"), string, "*.ics:text/calendar", NULL, NULL); + shell, _("Save as iCalendar"), string, + "*.ics:text/calendar", NULL, NULL); g_free (string); if (file == NULL) return; diff --git a/modules/calendar/e-cal-shell-view-private.c b/modules/calendar/e-cal-shell-view-private.c index 46cb825d21..ddf9dd7204 100644 --- a/modules/calendar/e-cal-shell-view-private.c +++ b/modules/calendar/e-cal-shell-view-private.c @@ -868,7 +868,8 @@ e_cal_shell_view_update_sidebar (ECalShellView *cal_shell_view) view_type = gnome_calendar_get_view (calendar); calendar_view = gnome_calendar_get_calendar_view (calendar, view_type); - if (!e_calendar_view_get_visible_time_range (calendar_view, &start_time, &end_time)) { + if (!e_calendar_view_get_visible_time_range ( + calendar_view, &start_time, &end_time)) { e_shell_sidebar_set_secondary_text (shell_sidebar, ""); return; } diff --git a/modules/calendar/e-cal-shell-view-taskpad.c b/modules/calendar/e-cal-shell-view-taskpad.c index f73d5839d1..33b21aeb55 100644 --- a/modules/calendar/e-cal-shell-view-taskpad.c +++ b/modules/calendar/e-cal-shell-view-taskpad.c @@ -287,10 +287,12 @@ action_calendar_taskpad_save_as_cb (GtkAction *action, comp_data = list->data; g_slist_free (list); - /* To Translators: Default filename part saving a task to a file when no summary is filed, the '.ics' extension is concatenated to it */ + /* Translators: Default filename part saving a task to a file when + * no summary is filed, the '.ics' extension is concatenated to it. */ string = icalcomp_suggest_filename (comp_data->icalcomp, _("task")); file = e_shell_run_save_dialog ( - shell, _("Save as iCalendar"), string, "*.ics:text/calendar", NULL, NULL); + shell, _("Save as iCalendar"), string, + "*.ics:text/calendar", NULL, NULL); g_free (string); if (file == NULL) return; diff --git a/modules/calendar/e-memo-shell-sidebar.c b/modules/calendar/e-memo-shell-sidebar.c index fb8ee9b04a..46ff03672a 100644 --- a/modules/calendar/e-memo-shell-sidebar.c +++ b/modules/calendar/e-memo-shell-sidebar.c @@ -474,8 +474,11 @@ memo_shell_sidebar_check_state (EShellSidebar *shell_sidebar) delete = e_source_get_property (source, "delete"); can_delete &= (delete == NULL || strcmp (delete, "no") != 0); - client = g_hash_table_lookup (memo_shell_sidebar->priv->client_table, e_source_peek_uid (source)); - refresh_supported = client && e_cal_get_refresh_supported (client); + client = g_hash_table_lookup ( + memo_shell_sidebar->priv->client_table, + e_source_peek_uid (source)); + refresh_supported = + client && e_cal_get_refresh_supported (client); } if (source != NULL) diff --git a/modules/calendar/e-task-shell-sidebar.c b/modules/calendar/e-task-shell-sidebar.c index 532e8f696b..eb5da18ffd 100644 --- a/modules/calendar/e-task-shell-sidebar.c +++ b/modules/calendar/e-task-shell-sidebar.c @@ -472,8 +472,11 @@ task_shell_sidebar_check_state (EShellSidebar *shell_sidebar) delete = e_source_get_property (source, "delete"); can_delete &= (delete == NULL || strcmp (delete, "no") != 0); - client = g_hash_table_lookup (task_shell_sidebar->priv->client_table, e_source_peek_uid (source)); - refresh_supported = client && e_cal_get_refresh_supported (client); + client = g_hash_table_lookup ( + task_shell_sidebar->priv->client_table, + e_source_peek_uid (source)); + refresh_supported = + client && e_cal_get_refresh_supported (client); } if (source != NULL) diff --git a/modules/calendar/e-task-shell-view-actions.c b/modules/calendar/e-task-shell-view-actions.c index 067bd48370..3d14678f7b 100644 --- a/modules/calendar/e-task-shell-view-actions.c +++ b/modules/calendar/e-task-shell-view-actions.c @@ -282,16 +282,24 @@ action_task_list_properties_cb (GtkAction *action, static void action_task_list_refresh_cb (GtkAction *action, - ETaskShellView *task_shell_view) + ETaskShellView *task_shell_view) { + ETaskShellContent *task_shell_content; + ETaskShellSidebar *task_shell_sidebar; + ESourceSelector *selector; ECal *client; ECalModel *model; ESource *source; gchar *uri; GError *error = NULL; - model = e_task_shell_content_get_task_model (task_shell_view->priv->task_shell_content); - source = e_source_selector_peek_primary_selection (e_task_shell_sidebar_get_selector (task_shell_view->priv->task_shell_sidebar)); + task_shell_content = task_shell_view->priv->task_shell_content; + task_shell_sidebar = task_shell_view->priv->task_shell_sidebar; + + model = e_task_shell_content_get_task_model (task_shell_content); + selector = e_task_shell_sidebar_get_selector (task_shell_sidebar); + + source = e_source_selector_peek_primary_selection (selector); g_return_if_fail (E_IS_SOURCE (source)); uri = e_source_get_uri (source); @@ -304,7 +312,10 @@ action_task_list_refresh_cb (GtkAction *action, g_return_if_fail (e_cal_get_refresh_supported (client)); if (!e_cal_refresh (client, &error) && error) { - g_warning ("%s: Failed to refresh '%s', %s\n", G_STRFUNC, e_source_peek_name (source), error->message); + g_warning ( + "%s: Failed to refresh '%s', %s\n", + G_STRFUNC, e_source_peek_name (source), + error->message); g_error_free (error); } } @@ -608,10 +619,12 @@ action_task_save_as_cb (GtkAction *action, comp_data = list->data; g_slist_free (list); - /* To Translators: Default filename part saving a task to a file when no summary is filed, the '.ics' extension is concatenated to it */ + /* Translators: Default filename part saving a task to a file when + * no summary is filed, the '.ics' extension is concatenated to it */ string = icalcomp_suggest_filename (comp_data->icalcomp, _("task")); file = e_shell_run_save_dialog ( - shell, _("Save as iCalendar"), string, "*.ics:text/calendar", NULL, NULL); + shell, _("Save as iCalendar"), string, + "*.ics:text/calendar", NULL, NULL); g_free (string); if (file == NULL) return; diff --git a/modules/calendar/e-task-shell-view-private.c b/modules/calendar/e-task-shell-view-private.c index 4337f19a79..533a36d3eb 100644 --- a/modules/calendar/e-task-shell-view-private.c +++ b/modules/calendar/e-task-shell-view-private.c @@ -354,7 +354,8 @@ e_task_shell_view_private_constructed (ETaskShellView *task_shell_view) e_task_shell_view_update_search_filter (task_shell_view); e_task_shell_view_update_timezone (task_shell_view); - /* call this when everything is ready, like actions in action groups and such */ + /* Call this when everything is ready, like actions in + * action groups and such. */ task_shell_view_update_timeout_cb (task_shell_view); priv->update_timeout = g_timeout_add_full ( G_PRIORITY_LOW, 60000, (GSourceFunc) -- cgit