From 777c1cbd40eb63365f2c28e38f6a93beb2d1c9d1 Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Tue, 16 Aug 2011 11:25:56 -0400 Subject: Coding style and whitespace cleanup. --- calendar/gui/alarm-notify/alarm-notify-dialog.c | 104 +++++++++++++++--------- calendar/gui/alarm-notify/alarm-notify.c | 2 +- calendar/gui/alarm-notify/alarm-queue.c | 38 +++++---- calendar/gui/alarm-notify/alarm.c | 11 ++- calendar/gui/alarm-notify/config-data.c | 11 +-- calendar/gui/alarm-notify/notify-main.c | 5 +- calendar/gui/alarm-notify/util.c | 6 +- 7 files changed, 111 insertions(+), 66 deletions(-) (limited to 'calendar/gui/alarm-notify') diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.c b/calendar/gui/alarm-notify/alarm-notify-dialog.c index e409432d3f..1e54ccf53c 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.c +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.c @@ -80,21 +80,23 @@ typedef struct { } AlarmNotify; - -static void -tree_selection_changed_cb (GtkTreeSelection *selection, gpointer data); +static void tree_selection_changed_cb (GtkTreeSelection *selection, + gpointer data); +static void fill_in_labels (AlarmNotify *an, + const gchar *summary, + const gchar *description, + const gchar *location, + time_t occur_start, + time_t occur_end); + +static void edit_pressed_cb (GtkButton *button, + gpointer user_data); +static void snooze_pressed_cb (GtkButton *button, + gpointer user_data); static void -fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, - const gchar *location, time_t occur_start, time_t occur_end); -static void -edit_pressed_cb (GtkButton *button, gpointer user_data); - -static void -snooze_pressed_cb (GtkButton *button, gpointer user_data); - -static void -an_update_minutes_label (GtkSpinButton *sb, gpointer data) +an_update_minutes_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_min; @@ -106,7 +108,8 @@ an_update_minutes_label (GtkSpinButton *sb, gpointer data) } static void -an_update_hrs_label (GtkSpinButton *sb, gpointer data) +an_update_hrs_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_hrs; @@ -118,7 +121,8 @@ an_update_hrs_label (GtkSpinButton *sb, gpointer data) } static void -an_update_days_label (GtkSpinButton *sb, gpointer data) +an_update_days_label (GtkSpinButton *sb, + gpointer data) { AlarmNotify *an; gint snooze_timeout_days; @@ -130,7 +134,9 @@ an_update_days_label (GtkSpinButton *sb, gpointer data) } static void -dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) +dialog_response_cb (GtkDialog *dialog, + guint response_id, + gpointer user_data) { AlarmNotify *an = user_data; GtkTreeIter iter; @@ -161,7 +167,8 @@ dialog_response_cb (GtkDialog *dialog, guint response_id, gpointer user_data) } static void -edit_pressed_cb (GtkButton *button, gpointer user_data) +edit_pressed_cb (GtkButton *button, + gpointer user_data) { AlarmNotify *an = user_data; AlarmFuncInfo *funcinfo = NULL; @@ -180,7 +187,8 @@ edit_pressed_cb (GtkButton *button, gpointer user_data) #define DEFAULT_SNOOZE_MINS 5 static void -snooze_pressed_cb (GtkButton *button, gpointer user_data) +snooze_pressed_cb (GtkButton *button, + gpointer user_data) { gint snooze_timeout; AlarmNotify *an = user_data; @@ -205,7 +213,8 @@ snooze_pressed_cb (GtkButton *button, gpointer user_data) } static void -dismiss_pressed_cb (GtkButton *button, gpointer user_data) +dismiss_pressed_cb (GtkButton *button, + gpointer user_data) { AlarmNotify *an = user_data; GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (an->treeview)); @@ -229,7 +238,8 @@ dismiss_pressed_cb (GtkButton *button, gpointer user_data) } static void -dialog_destroyed_cb (GtkWidget *dialog, gpointer user_data) +dialog_destroyed_cb (GtkWidget *dialog, + gpointer user_data) { AlarmNotify *an = user_data; @@ -265,7 +275,7 @@ notified_alarms_dialog_new (void) G_TYPE_POINTER, /* Start */ G_TYPE_POINTER, /* End */ - G_TYPE_POINTER /* FuncInfo*/)); + G_TYPE_POINTER /* FuncInfo */)); an->builder = gtk_builder_new (); e_load_ui_builder_definition (an->builder, "alarm-notify.ui"); @@ -310,7 +320,8 @@ notified_alarms_dialog_new (void) selection = gtk_tree_view_get_selection (GTK_TREE_VIEW (an->treeview)); gtk_tree_selection_set_mode (selection, GTK_SELECTION_SINGLE); - g_signal_connect (G_OBJECT (selection), "changed", + g_signal_connect ( + selection, "changed", G_CALLBACK (tree_selection_changed_cb), an); gtk_widget_realize (an->dialog); @@ -328,8 +339,12 @@ notified_alarms_dialog_new (void) g_signal_connect (edit_btn, "clicked", G_CALLBACK (edit_pressed_cb), an); g_signal_connect (snooze_btn, "clicked", G_CALLBACK (snooze_pressed_cb), an); g_signal_connect (an->dismiss_btn, "clicked", G_CALLBACK (dismiss_pressed_cb), an); - g_signal_connect (G_OBJECT (an->dialog), "response", G_CALLBACK (dialog_response_cb), an); - g_signal_connect (G_OBJECT (an->dialog), "destroy", G_CALLBACK (dialog_destroyed_cb), an); + g_signal_connect ( + an->dialog, "response", + G_CALLBACK (dialog_response_cb), an); + g_signal_connect ( + an->dialog, "destroy", + G_CALLBACK (dialog_destroyed_cb), an); if (!gtk_widget_get_realized (an->dialog)) gtk_widget_realize (an->dialog); @@ -337,16 +352,19 @@ notified_alarms_dialog_new (void) gtk_window_set_icon_name (GTK_WINDOW (an->dialog), "stock_alarm"); /* Set callback for updating the snooze "minutes" label */ - g_signal_connect (G_OBJECT (an->snooze_time_min), "value_changed", - G_CALLBACK (an_update_minutes_label), an); + g_signal_connect ( + an->snooze_time_min, "value_changed", + G_CALLBACK (an_update_minutes_label), an); /* Set callback for updating the snooze "hours" label */ - g_signal_connect (G_OBJECT (an->snooze_time_hrs), "value_changed", - G_CALLBACK (an_update_hrs_label), an); + g_signal_connect ( + an->snooze_time_hrs, "value_changed", + G_CALLBACK (an_update_hrs_label), an); /* Set callback for updating the snooze "days" label */ - g_signal_connect (G_OBJECT (an->snooze_time_days), "value_changed", - G_CALLBACK (an_update_days_label), an); + g_signal_connect ( + an->snooze_time_days, "value_changed", + G_CALLBACK (an_update_days_label), an); na = g_new0 (AlarmNotificationsDialog, 1); @@ -376,11 +394,16 @@ notified_alarms_dialog_new (void) **/ GtkTreeIter -add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, - time_t occur_start, time_t occur_end, - ECalComponentVType vtype, const gchar *summary, - const gchar *description, const gchar *location, - AlarmNotifyFunc func, gpointer func_data) +add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, + time_t trigger, + time_t occur_start, + time_t occur_end, + ECalComponentVType vtype, + const gchar *summary, + const gchar *description, + const gchar *location, + AlarmNotifyFunc func, + gpointer func_data) { GtkTreeIter iter; GtkTreeModel *model = gtk_tree_view_get_model (GTK_TREE_VIEW (na->treeview)); @@ -428,7 +451,8 @@ add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigge } static void -tree_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) +tree_selection_changed_cb (GtkTreeSelection *selection, + gpointer user_data) { GtkTreeModel *model; GtkTreeIter iter; @@ -454,8 +478,12 @@ tree_selection_changed_cb (GtkTreeSelection *selection, gpointer user_data) } static void -fill_in_labels (AlarmNotify *an, const gchar *summary, const gchar *description, - const gchar *location, time_t occur_start, time_t occur_end) +fill_in_labels (AlarmNotify *an, + const gchar *summary, + const gchar *description, + const gchar *location, + time_t occur_start, + time_t occur_end) { GtkTextTagTable *table = gtk_text_tag_table_new (); GtkTextBuffer *buffer = gtk_text_buffer_new (table); diff --git a/calendar/gui/alarm-notify/alarm-notify.c b/calendar/gui/alarm-notify/alarm-notify.c index 9a4a76aa46..8682011e21 100644 --- a/calendar/gui/alarm-notify/alarm-notify.c +++ b/calendar/gui/alarm-notify/alarm-notify.c @@ -42,7 +42,7 @@ struct _AlarmNotifyPrivate { /* Mapping from EUri's to LoadedClient structures */ /* FIXME do we need per source type uri hashes? or perhaps we - just need to hash based on source */ + * just need to hash based on source */ GHashTable *uri_client_hash[E_CAL_CLIENT_SOURCE_TYPE_LAST]; ESourceList *source_lists[E_CAL_CLIENT_SOURCE_TYPE_LAST]; ESourceList *selected_calendars; diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index c143429f8f..d7a1346a8e 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -180,10 +180,10 @@ static void message_proxy (Message *msg) { g_return_if_fail (msg->func != NULL); - + * msg->func (msg); } - + * static gpointer create_thread_pool (void) { @@ -344,7 +344,7 @@ remove_queued_alarm (CompQueuedAlarms *cqa, gboolean free_object, gboolean remove_alarm) { - QueuedAlarm *qa=NULL; + QueuedAlarm *qa = NULL; GSList *l; debug (("...")); @@ -576,7 +576,9 @@ add_component_alarms (ClientAlarms *ca, /* Loads the alarms of a client for a given range of time */ static void -load_alarms (ClientAlarms *ca, time_t start, time_t end) +load_alarms (ClientAlarms *ca, + time_t start, + time_t end) { gchar *str_query, *iso_start, *iso_end; GError *error = NULL; @@ -1609,10 +1611,12 @@ display_notification (time_t trigger, tray_icon = gtk_status_icon_new (); gtk_status_icon_set_from_icon_name ( tray_icon, "appointment-soon"); - g_signal_connect (G_OBJECT (tray_icon), "activate", - G_CALLBACK (icon_activated), NULL); - g_signal_connect (G_OBJECT (tray_icon), "popup-menu", - G_CALLBACK (popup_menu), NULL); + g_signal_connect ( + tray_icon, "activate", + G_CALLBACK (icon_activated), NULL); + g_signal_connect ( + tray_icon, "popup-menu", + G_CALLBACK (popup_menu), NULL); } current_zone = config_data_get_timezone (); @@ -1661,8 +1665,9 @@ display_notification (time_t trigger, g_free (time_str); g_free (str); - g_signal_connect (G_OBJECT (tray_data->view), "objects_removed", - G_CALLBACK (on_dialog_objs_removed_cb), tray_data); + g_signal_connect ( + tray_data->view, "objects_removed", + G_CALLBACK (on_dialog_objs_removed_cb), tray_data); /* FIXME: We should remove this check */ if (!config_data_get_notify_with_tray ()) { @@ -1864,7 +1869,8 @@ mail_notification (time_t trigger, /* Performs notification of a procedure alarm */ static gboolean -procedure_notification_dialog (const gchar *cmd, const gchar *url) +procedure_notification_dialog (const gchar *cmd, + const gchar *url) { GtkWidget *container; GtkWidget *dialog; @@ -2037,7 +2043,9 @@ alarm_queue_init (gpointer data) } static gboolean -free_client_alarms_cb (gpointer key, gpointer value, gpointer user_data) +free_client_alarms_cb (gpointer key, + gpointer value, + gpointer user_data) { ClientAlarms *ca = value; @@ -2101,7 +2109,8 @@ alarm_queue_done (void) } static gboolean -compare_ids (gpointer a, gpointer b) +compare_ids (gpointer a, + gpointer b) { ECalComponentId *id, *id1; @@ -2370,7 +2379,8 @@ update_cqa (CompQueuedAlarms *cqa, } static void -update_qa (ECalComponentAlarms *alarms, QueuedAlarm *qa) +update_qa (ECalComponentAlarms *alarms, + QueuedAlarm *qa) { ECalComponentAlarmInstance *al_inst; GSList *instance_list; diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c index 95d1d7b5a2..968eb95959 100644 --- a/calendar/gui/alarm-notify/alarm.c +++ b/calendar/gui/alarm-notify/alarm.c @@ -167,7 +167,8 @@ setup_timeout (void) /* Used from g_list_insert_sorted(); compares the * trigger times of two AlarmRecord structures. */ static gint -compare_alarm_by_time (gconstpointer a, gconstpointer b) +compare_alarm_by_time (gconstpointer a, + gconstpointer b) { const AlarmRecord *ara = a; const AlarmRecord *arb = b; @@ -187,7 +188,7 @@ queue_alarm (AlarmRecord *ar) old_head = alarms; /* Insert the new alarm in order if the alarm's trigger time is - after the current time */ + * after the current time */ alarms = g_list_insert_sorted (alarms, ar, compare_alarm_by_time); /* If there first item on the list didn't change, the time out is fine */ @@ -215,8 +216,10 @@ queue_alarm (AlarmRecord *ar) * the alarm will not be queued and the function will return NULL. **/ gpointer -alarm_add (time_t trigger, AlarmFunction alarm_fn, gpointer data, - AlarmDestroyNotify destroy_notify_fn) +alarm_add (time_t trigger, + AlarmFunction alarm_fn, + gpointer data, + AlarmDestroyNotify destroy_notify_fn) { AlarmRecord *ar; diff --git a/calendar/gui/alarm-notify/config-data.c b/calendar/gui/alarm-notify/config-data.c index 31425c5985..d056131280 100644 --- a/calendar/gui/alarm-notify/config-data.c +++ b/calendar/gui/alarm-notify/config-data.c @@ -124,7 +124,7 @@ config_data_get_calendars (const gchar *key) state = gconf_client_get_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", NULL); - if (!state) /* Should be old client*/ { + if (!state) /* Should be old client */ { GSList *source; gconf_client_set_bool (conf_client, "/apps/evolution/calendar/notify/notify_with_tray", @@ -158,8 +158,8 @@ config_data_get_calendars (const gchar *key) void config_data_replace_string_list (const gchar *key, - const gchar *old, - const gchar *new) + const gchar *old, + const gchar *new) { GSList *source, *tmp; @@ -259,7 +259,8 @@ config_data_get_notify_with_tray (void) * triggered while it was not running. **/ void -config_data_set_last_notification_time (ECalClient *cal, time_t t) +config_data_set_last_notification_time (ECalClient *cal, + time_t t) { GConfClient *client; time_t current_t, now = time (NULL); @@ -287,7 +288,7 @@ config_data_set_last_notification_time (ECalClient *cal, time_t t) return; /* we only store the new notification time if it is bigger - than the already stored one */ + * than the already stored one */ current_t = gconf_client_get_int (client, KEY_LAST_NOTIFICATION_TIME, NULL); if (t > current_t || current_t > now) gconf_client_set_int (client, KEY_LAST_NOTIFICATION_TIME, t, NULL); diff --git a/calendar/gui/alarm-notify/notify-main.c b/calendar/gui/alarm-notify/notify-main.c index a420074c4d..225dde4c26 100644 --- a/calendar/gui/alarm-notify/notify-main.c +++ b/calendar/gui/alarm-notify/notify-main.c @@ -45,7 +45,8 @@ #include "e-util/e-util-private.h" gint -main (gint argc, gchar **argv) +main (gint argc, + gchar **argv) { AlarmNotify *alarm_notify_service; gint exit_status; @@ -68,7 +69,7 @@ main (gint argc, gchar **argv) p_SetProcessDEPPolicy = GetProcAddress (GetModuleHandle ("kernel32.dll"), "SetProcessDEPPolicy"); if (p_SetProcessDEPPolicy) - (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE|PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); + (*p_SetProcessDEPPolicy) (PROCESS_DEP_ENABLE | PROCESS_DEP_DISABLE_ATL_THUNK_EMULATION); } #endif #endif diff --git a/calendar/gui/alarm-notify/util.c b/calendar/gui/alarm-notify/util.c index d5c6678cc4..891ea131bc 100644 --- a/calendar/gui/alarm-notify/util.c +++ b/calendar/gui/alarm-notify/util.c @@ -34,7 +34,8 @@ /* Converts a time_t to a string, relative to the specified timezone */ gchar * -timet_to_str_with_zone (time_t t, icaltimezone *zone) +timet_to_str_with_zone (time_t t, + icaltimezone *zone) { struct icaltimetype itt; struct tm tm; @@ -52,7 +53,8 @@ timet_to_str_with_zone (time_t t, icaltimezone *zone) } gchar * -calculate_time (time_t start, time_t end) +calculate_time (time_t start, + time_t end) { time_t difference = end - start; gchar *str; -- cgit v1.2.3