aboutsummaryrefslogtreecommitdiffstats
path: root/calendar/alarm-notify
diff options
context:
space:
mode:
authorMatthew Barnes <mbarnes@redhat.com>2012-11-10 11:40:00 +0800
committerMatthew Barnes <mbarnes@redhat.com>2012-11-11 04:54:43 +0800
commit2c4ae5e7685c462f8d464448e4617b8dea029e72 (patch)
treec34f0cbb7c500ff70f10fce846631b0a948b341c /calendar/alarm-notify
parent583da46b8caf4b2a8b548b03c38fe0e84164abfb (diff)
downloadgsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.gz
gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.tar.zst
gsoc2013-evolution-2c4ae5e7685c462f8d464448e4617b8dea029e72.zip
Coding style and whitespace cleanup.
Diffstat (limited to 'calendar/alarm-notify')
-rw-r--r--calendar/alarm-notify/alarm-notify-dialog.c16
-rw-r--r--calendar/alarm-notify/alarm-notify.c15
-rw-r--r--calendar/alarm-notify/alarm-queue.c37
-rw-r--r--calendar/alarm-notify/alarm.c5
-rw-r--r--calendar/alarm-notify/config-data.c14
5 files changed, 54 insertions, 33 deletions
diff --git a/calendar/alarm-notify/alarm-notify-dialog.c b/calendar/alarm-notify/alarm-notify-dialog.c
index cf94366ae9..e59080d14e 100644
--- a/calendar/alarm-notify/alarm-notify-dialog.c
+++ b/calendar/alarm-notify/alarm-notify-dialog.c
@@ -327,11 +327,13 @@ notified_alarms_dialog_new (void)
gtk_window_set_keep_above (GTK_WINDOW (an->dialog), TRUE);
- column = gtk_tree_view_column_new_with_attributes (_("Start time"),
- renderer, "text", ALARM_DISPLAY_COLUMN, NULL);
+ column = gtk_tree_view_column_new_with_attributes (
+ _("Start time"),
+ renderer, "text", ALARM_DISPLAY_COLUMN, NULL);
- gtk_tree_view_column_set_attributes (column, renderer,
- "markup", ALARM_DISPLAY_COLUMN, NULL);
+ gtk_tree_view_column_set_attributes (
+ column, renderer,
+ "markup", ALARM_DISPLAY_COLUMN, NULL);
gtk_tree_view_append_column (GTK_TREE_VIEW (an->treeview), column);
@@ -458,11 +460,13 @@ add_alarm_to_notified_alarms_dialog (AlarmNotificationsDialog *na,
start = timet_to_str_with_zone (occur_start, current_zone);
end = timet_to_str_with_zone (occur_end, current_zone);
str_time = calculate_time (occur_start, occur_end);
- to_display = g_markup_printf_escaped ("<big><b>%s</b></big>\n%s %s",
+ to_display = g_markup_printf_escaped (
+ "<big><b>%s</b></big>\n%s %s",
summary, start, str_time);
g_free (start);
g_free (end);
- gtk_list_store_set (GTK_LIST_STORE (model), &iter,
+ gtk_list_store_set (
+ GTK_LIST_STORE (model), &iter,
ALARM_DISPLAY_COLUMN, to_display, -1);
g_free (to_display);
g_free (str_time);
diff --git a/calendar/alarm-notify/alarm-notify.c b/calendar/alarm-notify/alarm-notify.c
index dc588b726c..54242f2049 100644
--- a/calendar/alarm-notify/alarm-notify.c
+++ b/calendar/alarm-notify/alarm-notify.c
@@ -235,10 +235,17 @@ client_opened_cb (GObject *source_object,
e_client_utils_open_new_finish (source, result, &client, &error);
- if (client == NULL) {
- debug (("Failed to open '%s' (%s): %s", e_source_get_display_name (source),
- e_source_get_uid (source), error ? error->message : "Unknown error"));
- g_clear_error (&error);
+ /* Sanity check. */
+ g_return_if_fail (
+ ((client != NULL) && (error == NULL)) ||
+ ((client == NULL) && (error != NULL)));
+
+ if (error != NULL) {
+ debug (
+ ("Failed to open '%s' (%s): %s",
+ e_source_get_display_name (source),
+ e_source_get_uid (source), error->message));
+ g_error_free (error);
return;
}
diff --git a/calendar/alarm-notify/alarm-queue.c b/calendar/alarm-notify/alarm-queue.c
index 788988be72..7fc308f482 100644
--- a/calendar/alarm-notify/alarm-queue.c
+++ b/calendar/alarm-notify/alarm-queue.c
@@ -663,7 +663,7 @@ load_alarms_for_today (ClientAlarms *ca)
from = MAX (from, day_start);
/* Add one hour after midnight, just to cover the delay in 30 minutes
- midnight checking. */
+ * midnight checking. */
day_end = time_day_end_with_zone (now, zone) + (60 * 60);
debug (("From %s to %s", e_ctime (&from), e_ctime (&day_end)));
load_alarms (ca, from, day_end);
@@ -1054,11 +1054,12 @@ static void
print_component (ECalClient *cal_client,
ECalComponent *comp)
{
- print_comp (comp,
- cal_client,
- config_data_get_timezone (),
- config_data_get_24_hour_format (),
- GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
+ print_comp (
+ comp,
+ cal_client,
+ config_data_get_timezone (),
+ config_data_get_24_hour_format (),
+ GTK_PRINT_OPERATION_ACTION_PRINT_DIALOG);
}
typedef struct {
@@ -1643,8 +1644,9 @@ display_notification (time_t trigger,
end_str = timet_to_str_with_zone (qa->instance->occur_end, current_zone);
time_str = calculate_time (qa->instance->occur_start, qa->instance->occur_end);
- str = g_strdup_printf ("%s\n%s %s",
- summary, start_str, time_str);
+ str = g_strdup_printf (
+ "%s\n%s %s",
+ summary, start_str, time_str);
/* create the private structure */
tray_data = g_new0 (TrayIconData, 1);
@@ -1747,8 +1749,9 @@ popup_notification (time_t trigger,
end_str = timet_to_str_with_zone (qa->instance->occur_end, current_zone);
time_str = calculate_time (qa->instance->occur_start, qa->instance->occur_end);
- str = g_strdup_printf ("%s %s",
- start_str, time_str);
+ str = g_strdup_printf (
+ "%s %s",
+ start_str, time_str);
if (organiser.cn) {
if (location)
@@ -2075,7 +2078,7 @@ alarm_queue_init (gpointer data)
g_timeout_add_seconds (1800, check_midnight_refresh, NULL);
/* monotonic time doesn't change during hibernation, while the wall clock time does,
- thus check for wall clock time changes and reschedule alarms when it changes */
+ * thus check for wall clock time changes and reschedule alarms when it changes */
g_timeout_add_seconds (60, check_wall_clock_time_changed, NULL);
#ifdef HAVE_LIBNOTIFY
@@ -2319,8 +2322,9 @@ alarm_queue_remove_async (struct _alarm_client_msg *msg)
if (ca->cal_client) {
debug (("Disconnecting Client"));
- g_signal_handlers_disconnect_matched (ca->cal_client, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, ca);
+ g_signal_handlers_disconnect_matched (
+ ca->cal_client, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, ca);
g_object_unref (ca->cal_client);
ca->cal_client = NULL;
}
@@ -2328,8 +2332,9 @@ alarm_queue_remove_async (struct _alarm_client_msg *msg)
if (ca->view) {
debug (("Disconnecting Query"));
- g_signal_handlers_disconnect_matched (ca->view, G_SIGNAL_MATCH_DATA,
- 0, 0, NULL, NULL, ca);
+ g_signal_handlers_disconnect_matched (
+ ca->view, G_SIGNAL_MATCH_DATA,
+ 0, 0, NULL, NULL, ca);
g_object_unref (ca->view);
ca->view = NULL;
}
@@ -2419,7 +2424,7 @@ update_cqa (CompQueuedAlarms *cqa,
/* Update the actual component stored in CompQueuedAlarms structure */
g_object_unref (cqa->alarms->comp);
cqa->alarms->comp = newcomp;
- if (alarms != NULL )
+ if (alarms != NULL)
e_cal_component_alarms_free (alarms);
}
diff --git a/calendar/alarm-notify/alarm.c b/calendar/alarm-notify/alarm.c
index cf586dfea2..99d3dd669b 100644
--- a/calendar/alarm-notify/alarm.c
+++ b/calendar/alarm-notify/alarm.c
@@ -152,8 +152,9 @@ setup_timeout (void)
now = time (NULL);
/* Add the time out */
- debug (("Setting timeout for %d.%2d (from now) %lu %lu",
- diff / 60, diff % 60, ar->trigger, now));
+ debug (
+ ("Setting timeout for %d.%2d (from now) %lu %lu",
+ diff / 60, diff % 60, ar->trigger, now));
debug ((" %s", ctime (&ar->trigger)));
debug ((" %s", ctime (&now)));
timeout_id = g_timeout_add_seconds (diff, alarm_ready_cb, NULL);
diff --git a/calendar/alarm-notify/config-data.c b/calendar/alarm-notify/config-data.c
index b9f9b7a07d..84a2e38265 100644
--- a/calendar/alarm-notify/config-data.c
+++ b/calendar/alarm-notify/config-data.c
@@ -110,14 +110,18 @@ config_data_get_notify_with_tray (void)
static void
source_written_cb (GObject *source_object,
- GAsyncResult *result,
- gpointer user_data)
+ GAsyncResult *result,
+ gpointer user_data)
{
GError *error = NULL;
- if (!e_source_write_finish (E_SOURCE (source_object), result, &error)) {
- g_warning ("Failed to write source changes: %s", error ? error->message : "Unknown error");
- g_clear_error (&error);
+ e_source_write_finish (E_SOURCE (source_object), result, &error);
+
+ if (error != NULL) {
+ g_warning (
+ "Failed to write source changes: %s",
+ error->message);
+ g_error_free (error);
}
}