aboutsummaryrefslogtreecommitdiffstats
path: root/widgets/misc
diff options
context:
space:
mode:
Diffstat (limited to 'widgets/misc')
-rw-r--r--widgets/misc/ChangeLog8
-rw-r--r--widgets/misc/e-calendar-item.c34
-rw-r--r--widgets/misc/e-calendar-item.h3
3 files changed, 16 insertions, 29 deletions
diff --git a/widgets/misc/ChangeLog b/widgets/misc/ChangeLog
index 93934b2bbc..a4b449c7d9 100644
--- a/widgets/misc/ChangeLog
+++ b/widgets/misc/ChangeLog
@@ -1,3 +1,11 @@
+2007-12-03 Matthew Barnes <mbarnes@redhat.com>
+
+ ** Fixes part of bug #392747
+
+ * e-calendar-item.h (struct _ECalendarItem):
+ * e-calendar-item.c (e_calendar_item_init), (e_calendar_item_draw):
+ Lose the local weekday name cache and just call e_get_weekday_name().
+
2007-12-01 Matthew Barnes <mbarnes@redhat.com>
** Fixes part of bug #495123
diff --git a/widgets/misc/e-calendar-item.c b/widgets/misc/e-calendar-item.c
index 7cbfc2f958..f023e89850 100644
--- a/widgets/misc/e-calendar-item.c
+++ b/widgets/misc/e-calendar-item.c
@@ -411,10 +411,6 @@ e_calendar_item_init (ECalendarItem *calitem)
calitem->time_callback_data = NULL;
calitem->time_callback_destroy = NULL;
- /* Translators: These are the first characters of each day of the
- week, 'M' for 'Monday', 'T' for Tuesday etc. */
- calitem->days = _("MTWTFSS");
-
calitem->signal_emission_idle_id = 0;
}
@@ -964,18 +960,11 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item,
static void
layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, int day_index)
{
- char *day;
- int char_size = 0;
-
- day = g_utf8_offset_to_pointer (calitem->days, day_index);
-
- /* we use strlen because we actually want to count bytes */
- if (day_index == 6)
- char_size = strlen (day);
- else
- char_size = strlen (day) - strlen (g_utf8_find_next_char (day, NULL));
+ const gchar *abbr_name;
- pango_layout_set_text (layout, day, char_size);
+ /* day_index: 0 = Monday ... 6 = Sunday */
+ abbr_name = e_get_weekday_name (day_index + 1, TRUE);
+ pango_layout_set_text (layout, abbr_name, -1);
}
static void
@@ -1611,18 +1600,11 @@ e_calendar_item_draw (GnomeCanvasItem *canvas_item,
static void
layout_set_day_text (ECalendarItem *calitem, PangoLayout *layout, int day_index)
{
- char *day;
- int char_size = 0;
-
- day = g_utf8_offset_to_pointer (calitem->days, day_index);
-
- /* we use strlen because we actually want to count bytes */
- if (day_index == 6)
- char_size = strlen (day);
- else
- char_size = strlen (day) - strlen (g_utf8_find_next_char (day, NULL));
+ const gchar *abbr_name;
- pango_layout_set_text (layout, day, char_size);
+ /* day_index: 0 = Monday ... 6 = Sunday */
+ abbr_name = e_get_weekday_name (day_index + 1, TRUE);
+ pango_layout_set_text (layout, abbr_name, -1);
}
static void
diff --git a/widgets/misc/e-calendar-item.h b/widgets/misc/e-calendar-item.h
index efd6d60a73..c78d9d14ec 100644
--- a/widgets/misc/e-calendar-item.h
+++ b/widgets/misc/e-calendar-item.h
@@ -216,9 +216,6 @@ struct _ECalendarItem
gint selection_real_start_month_offset;
gint selection_real_start_day;
- /* The first character of each day of the week, e.g. 'MTWTFSS'. */
- gchar *days;
-
/* Widths of the day characters. */
gint day_widths[7];