diff options
author | Matthew Barnes <mbarnes@redhat.com> | 2010-01-03 12:46:23 +0800 |
---|---|---|
committer | Matthew Barnes <mbarnes@redhat.com> | 2010-01-04 02:15:01 +0800 |
commit | e77ee5d5d38ad95bce550db62bf4105f43cf88c6 (patch) | |
tree | 3b4c275b086d3f49360c551e686f62140a8ee4d4 /calendar/gui/e-memo-table.c | |
parent | 3cfd5d640908b6441769341c764de70006262c6e (diff) | |
download | gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.gz gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.tar.zst gsoc2013-evolution-e77ee5d5d38ad95bce550db62bf4105f43cf88c6.zip |
Coding style and whitespace cleanup.
Diffstat (limited to 'calendar/gui/e-memo-table.c')
-rw-r--r-- | calendar/gui/e-memo-table.c | 89 |
1 files changed, 48 insertions, 41 deletions
diff --git a/calendar/gui/e-memo-table.c b/calendar/gui/e-memo-table.c index 8461734164..94174efc3b 100644 --- a/calendar/gui/e-memo-table.c +++ b/calendar/gui/e-memo-table.c @@ -84,8 +84,6 @@ enum { LAST_SIGNAL }; -static struct tm e_memo_table_get_current_time (ECellDateEdit *ecde, gpointer data); - static gpointer parent_class; static guint signals[LAST_SIGNAL]; @@ -133,6 +131,37 @@ memo_table_emit_user_created (EMemoTable *memo_table) g_signal_emit (memo_table, signal_id, 0); } +/* Returns the current time, for the ECellDateEdit items. + FIXME: Should probably use the timezone of the item rather than the + current timezone, though that may be difficult to get from here. */ +static struct tm +memo_table_get_current_time (ECellDateEdit *ecde, + gpointer user_data) +{ + EMemoTable *memo_table = user_data; + ECalModel *model; + icaltimezone *zone; + struct tm tmp_tm = { 0 }; + struct icaltimetype tt; + + /* Get the current timezone. */ + model = e_memo_table_get_model (memo_table); + zone = e_cal_model_get_timezone (model); + + tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone); + + /* Now copy it to the struct tm and return it. */ + tmp_tm.tm_year = tt.year - 1900; + tmp_tm.tm_mon = tt.month - 1; + tmp_tm.tm_mday = tt.day; + tmp_tm.tm_hour = tt.hour; + tmp_tm.tm_min = tt.minute; + tmp_tm.tm_sec = tt.second; + tmp_tm.tm_isdst = -1; + + return tmp_tm; +} + static gint memo_table_date_compare_cb (gconstpointer a, gconstpointer b) @@ -364,7 +393,7 @@ memo_table_constructed (GObject *object) e_cell_date_edit_set_get_time_callback ( E_CELL_DATE_EDIT (popup_cell), - e_memo_table_get_current_time, memo_table, NULL); + memo_table_get_current_time, memo_table, NULL); /* Sorting */ e_table_extras_add_compare ( @@ -515,11 +544,15 @@ memo_table_query_tooltip (GtkWidget *widget, if (ptr) { ptr++; - /* To Translators: It will display "Organizer: NameOfTheUser <email@ofuser.com>" */ - tmp = g_strdup_printf (_("Organizer: %s <%s>"), organizer.cn, ptr); + /* Translators: It will display + * "Organizer: NameOfTheUser <email@ofuser.com>" */ + tmp = g_strdup_printf ( + _("Organizer: %s <%s>"), organizer.cn, ptr); } else { - /* With SunOne accounts, there may be no ':' in organiser.value */ - tmp = g_strdup_printf (_("Organizer: %s"), organizer.cn); + /* With SunOne accounts, there may be no ':' in + * organizer.value */ + tmp = g_strdup_printf ( + _("Organizer: %s"), organizer.cn); } l = gtk_label_new (tmp); @@ -535,7 +568,9 @@ memo_table_query_tooltip (GtkWidget *widget, default_zone = e_cal_model_get_timezone (model); if (dtstart.tzid) { - zone = icalcomponent_get_timezone (e_cal_component_get_icalcomponent (new_comp), dtstart.tzid); + zone = icalcomponent_get_timezone ( + e_cal_component_get_icalcomponent (new_comp), + dtstart.tzid); if (!zone) e_cal_get_timezone ( comp_data->client, dtstart.tzid, &zone, NULL); @@ -1186,11 +1221,13 @@ e_memo_table_delete_selected (EMemoTable *memo_table) if (comp_data) { comp = e_cal_component_new (); - e_cal_component_set_icalcomponent (comp, icalcomponent_new_clone (comp_data->icalcomp)); + e_cal_component_set_icalcomponent ( + comp, icalcomponent_new_clone (comp_data->icalcomp)); } - if (delete_component_dialog (comp, FALSE, n_selected, E_CAL_COMPONENT_JOURNAL, - GTK_WIDGET (memo_table))) + if (delete_component_dialog ( + comp, FALSE, n_selected, E_CAL_COMPONENT_JOURNAL, + GTK_WIDGET (memo_table))) delete_selected_components (memo_table); /* free memory */ @@ -1220,33 +1257,3 @@ e_memo_table_get_selected (EMemoTable *memo_table) return closure.objects; } - -/* Returns the current time, for the ECellDateEdit items. - FIXME: Should probably use the timezone of the item rather than the - current timezone, though that may be difficult to get from here. */ -static struct tm -e_memo_table_get_current_time (ECellDateEdit *ecde, gpointer data) -{ - EMemoTable *memo_table = data; - ECalModel *model; - icaltimezone *zone; - struct tm tmp_tm = { 0 }; - struct icaltimetype tt; - - /* Get the current timezone. */ - model = e_memo_table_get_model (memo_table); - zone = e_cal_model_get_timezone (model); - - tt = icaltime_from_timet_with_zone (time (NULL), FALSE, zone); - - /* Now copy it to the struct tm and return it. */ - tmp_tm.tm_year = tt.year - 1900; - tmp_tm.tm_mon = tt.month - 1; - tmp_tm.tm_mday = tt.day; - tmp_tm.tm_hour = tt.hour; - tmp_tm.tm_min = tt.minute; - tmp_tm.tm_sec = tt.second; - tmp_tm.tm_isdst = -1; - - return tmp_tm; -} |