From cb97c2dc8fd97b381af048f206333d5e557892ae Mon Sep 17 00:00:00 2001 From: Matthew Barnes Date: Sat, 21 May 2011 10:02:58 -0400 Subject: Coding style and whitespace cleanup. --- calendar/gui/alarm-notify/alarm-notify-dialog.h | 36 +++++++++++++------------ calendar/gui/alarm-notify/alarm-queue.c | 24 ++++++++--------- calendar/gui/alarm-notify/alarm.c | 9 +++++-- calendar/gui/alarm-notify/config-data.h | 34 +++++++++++++---------- 4 files changed, 58 insertions(+), 45 deletions(-) (limited to 'calendar/gui/alarm-notify') diff --git a/calendar/gui/alarm-notify/alarm-notify-dialog.h b/calendar/gui/alarm-notify/alarm-notify-dialog.h index ae523cb1ad..ad7db99432 100644 --- a/calendar/gui/alarm-notify/alarm-notify-dialog.h +++ b/calendar/gui/alarm-notify/alarm-notify-dialog.h @@ -27,8 +27,6 @@ #include #include - - typedef enum { ALARM_NOTIFY_CLOSE, ALARM_NOTIFY_SNOOZE, @@ -37,24 +35,28 @@ typedef enum { } AlarmNotifyResult; typedef struct _AlarmNotificationsDialog AlarmNotificationsDialog; -struct _AlarmNotificationsDialog -{ + +struct _AlarmNotificationsDialog { GtkWidget *dialog; GtkWidget *treeview; }; -typedef void (* AlarmNotifyFunc) (AlarmNotifyResult result, gint snooze_mins, gpointer data); +typedef void (*AlarmNotifyFunc) (AlarmNotifyResult result, + gint snooze_mins, + gpointer data); AlarmNotificationsDialog * -notified_alarms_dialog_new (void); - -GtkTreeIter -add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na, time_t trigger, - time_t occur_start, time_t occur_end, - ECalComponentVType vtype, const gchar *summary, - const gchar *description, const gchar *location, - AlarmNotifyFunc func, gpointer func_data); - - - -#endif + notified_alarms_dialog_new (void); +GtkTreeIter add_alarm_to_notified_alarms_dialog + (AlarmNotificationsDialog *na, + time_t trigger, + time_t occur_start, + time_t occur_end, + ECalComponentVType vtype, + const gchar *summary, + const gchar *description, + const gchar *location, + AlarmNotifyFunc func, + gpointer func_data); + +#endif /* ALARM_NOTIFY_DIALOG_H */ diff --git a/calendar/gui/alarm-notify/alarm-queue.c b/calendar/gui/alarm-notify/alarm-queue.c index fd79d1f80c..816183dc4a 100644 --- a/calendar/gui/alarm-notify/alarm-queue.c +++ b/calendar/gui/alarm-notify/alarm-queue.c @@ -187,10 +187,11 @@ create_thread_pool (void) static void message_push (Message *msg) { - /* This used be pushed through the thread pool. This fix is made to work-around - the crashers in dbus due to threading. The threading is not completely removed as - its better to have alarm daemon running in a thread rather than blocking main thread. - This is the reason the creation of thread pool is commented out */ + /* This used be pushed through the thread pool. This fix is made to + * work-around the crashers in dbus due to threading. The threading + * is not completely removed as its better to have alarm daemon + * running in a thread rather than blocking main thread. This is + * the reason the creation of thread pool is commented out. */ msg->func (msg); } @@ -784,7 +785,8 @@ query_objects_changed_async (struct _query_msg *msg) * remove it after updating the cqa structure. */ if (alarms == NULL || alarms->alarms == NULL) { - /* update the cqa and its queued alarms for changes in summary and alarm_uid */ + /* Update the cqa and its queued alarms + * for changes in summary and alarm_uid. */ update_cqa (cqa, comp); if (alarms) @@ -805,16 +807,12 @@ query_objects_changed_async (struct _query_msg *msg) instance = sl->data; - if (!has_known_notification (cqa->alarms->comp, instance->auid)) { - g_debug ("Could not recognize alarm's notification type, discarding."); + if (!has_known_notification (cqa->alarms->comp, instance->auid)) continue; - } alarm_id = alarm_add (instance->trigger, alarm_trigger_cb, cqa, NULL); - if (!alarm_id) { - debug (("Unable to schedule trigger for %s", e_ctime (&(instance->trigger)))); + if (!alarm_id) continue; - } qa = g_new (QueuedAlarm, 1); qa->alarm_id = alarm_id; @@ -1149,7 +1147,9 @@ tray_list_remove_async (Message *msg) gboolean status; tray_icons_list = g_list_remove_link (tray_icons_list, list); - status = remove_queued_alarm (tray_data->cqa, tray_data->alarm_id, FALSE, TRUE); + status = remove_queued_alarm ( + tray_data->cqa, + tray_data->alarm_id, FALSE, TRUE); if (status) { g_hash_table_remove ( tray_data->cqa->parent_client->uid_alarms_hash, diff --git a/calendar/gui/alarm-notify/alarm.c b/calendar/gui/alarm-notify/alarm.c index 2765c25183..a19f363460 100644 --- a/calendar/gui/alarm-notify/alarm.c +++ b/calendar/gui/alarm-notify/alarm.c @@ -104,7 +104,9 @@ alarm_ready_cb (gpointer data) ar_copy = *ar; ar = &ar_copy; - pop_alarm (); /* This will free the original AlarmRecord; that's why we copy it */ + /* This will free the original AlarmRecord; + * that's why we copy it. */ + pop_alarm (); (* ar->alarm_fn) (notify_id, ar->trigger, ar->data); @@ -260,7 +262,10 @@ alarm_remove (gpointer alarm) if (old_head == ar) { ar_copy = *ar; ar = &ar_copy; - pop_alarm (); /* This will free the original AlarmRecord; that's why we copy it */ + + /* This will free the original AlarmRecord; + * that's why we copy it. */ + pop_alarm (); } else { alarms = g_list_delete_link (alarms, l); } diff --git a/calendar/gui/alarm-notify/config-data.h b/calendar/gui/alarm-notify/config-data.h index 2a40950a00..3e09220102 100644 --- a/calendar/gui/alarm-notify/config-data.h +++ b/calendar/gui/alarm-notify/config-data.h @@ -32,21 +32,27 @@ #include #include -GConfClient *config_data_get_conf_client (void); +GConfClient * config_data_get_conf_client (void); +icaltimezone * config_data_get_timezone (void); +gboolean config_data_get_24_hour_format (void); +gboolean config_data_get_notify_with_tray + (void); +void config_data_set_last_notification_time + (ECal *cal, + time_t t); +time_t config_data_get_last_notification_time + (ECal *cal); +void config_data_save_blessed_program + (const gchar *program); +gboolean config_data_is_blessed_program (const gchar *program); +ESourceList * config_data_get_calendars (const gchar *); +void config_data_replace_string_list (const gchar *, + const gchar *, + const gchar *); -icaltimezone *config_data_get_timezone (void); -gboolean config_data_get_24_hour_format (void); -gboolean config_data_get_notify_with_tray (void); -void config_data_set_last_notification_time (ECal *cal, time_t t); -time_t config_data_get_last_notification_time (ECal *cal); -void config_data_save_blessed_program (const gchar *program); -gboolean config_data_is_blessed_program (const gchar *program); -ESourceList *config_data_get_calendars (const gchar *); -void config_data_replace_string_list (const gchar *, const gchar *, const gchar *); - -void config_data_init_debugging (void); -gboolean config_data_start_debugging (void); -void config_data_stop_debugging (void); +void config_data_init_debugging (void); +gboolean config_data_start_debugging (void); +void config_data_stop_debugging (void); #define debug(x) G_STMT_START { \ if (config_data_start_debugging ()) { \ -- cgit v1.2.3