From e3e04c94352282f43d26513f4720b7c8ad96ad2a Mon Sep 17 00:00:00 2001 From: Tor Lillqvist Date: Thu, 27 Apr 2006 12:18:34 +0000 Subject: Fix crash: Should use a GdkColor struct as such here, not a pointer. 2006-04-27 Tor Lillqvist * gui/e-day-view-main-item.c (e_day_view_main_item_draw_long_events_in_vbars): Fix crash: Should use a GdkColor struct as such here, not a pointer. * gui/dialogs/event-editor.c (event_editor_init): Construct pathname to query-free-busy.png at run-time. Fixes Win32 build broken by the fix for #321832 below. svn path=/trunk/; revision=31917 --- calendar/ChangeLog | 10 ++++++++++ calendar/gui/dialogs/event-editor.c | 19 +++++++++++++++++-- calendar/gui/e-day-view-main-item.c | 11 +++++------ 3 files changed, 32 insertions(+), 8 deletions(-) (limited to 'calendar') diff --git a/calendar/ChangeLog b/calendar/ChangeLog index 4dd9c92df3..4c6611b4b3 100644 --- a/calendar/ChangeLog +++ b/calendar/ChangeLog @@ -1,3 +1,13 @@ +2006-04-27 Tor Lillqvist + + * gui/e-day-view-main-item.c + (e_day_view_main_item_draw_long_events_in_vbars): Fix crash: + Should use a GdkColor struct as such here, not a pointer. + + * gui/dialogs/event-editor.c (event_editor_init): Construct + pathname to query-free-busy.png at run-time. Fixes Win32 build + broken by the fix for #321832 below. + 2006-04-26 Srinivasa Ragavan ** Fixes bug #328194 diff --git a/calendar/gui/dialogs/event-editor.c b/calendar/gui/dialogs/event-editor.c index 672e0aadb9..818b425a00 100644 --- a/calendar/gui/dialogs/event-editor.c +++ b/calendar/gui/dialogs/event-editor.c @@ -386,6 +386,11 @@ static BonoboUIVerb verbs [] = { }; static EPixmap pixmaps[] = { + /* NOTE: If adding removing elements in this array, make sure + * the indexes of the two elements where the pathname to the + * icons is filled in at run-time in event_editor_init() are + * updated, too. + */ E_PIXMAP ("/Toolbar/ActionAlarm", "stock_alarm", E_ICON_SIZE_LARGE_TOOLBAR), E_PIXMAP ("/menu/Options/ActionAlarm", "stock_alarm", E_ICON_SIZE_MENU), E_PIXMAP ("/Toolbar/ActionAllDayEvent", "stock_new-24h-appointment", E_ICON_SIZE_LARGE_TOOLBAR), @@ -393,8 +398,11 @@ static EPixmap pixmaps[] = { E_PIXMAP ("/Toolbar/ActionRecurrence", "stock_task-recurring", E_ICON_SIZE_LARGE_TOOLBAR), E_PIXMAP ("/menu/Options/ActionRecurrence", "stock_task-recurring", E_ICON_SIZE_MENU), E_PIXMAP ("/commands/ActionRecurrence", "stock_task-recurring", E_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/Toolbar/ActionFreeBusy", EVOLUTION_ICONSDIR"/query-free-busy.png", E_ICON_SIZE_LARGE_TOOLBAR), - E_PIXMAP ("/menu/Options/ActionFreeBusy", EVOLUTION_ICONSDIR"/query-free-busy.png", E_ICON_SIZE_MENU), + /* These two will have an absolute path to the png file filled + * in at run-time, see event_editor_init(). + */ + E_PIXMAP ("/Toolbar/ActionFreeBusy", NULL, E_ICON_SIZE_LARGE_TOOLBAR), + E_PIXMAP ("/menu/Options/ActionFreeBusy", NULL, E_ICON_SIZE_MENU), E_PIXMAP_END }; @@ -516,6 +524,13 @@ event_editor_init (EventEditor *ee) editor->uic, "ActionFreeBusy", menu_action_freebusy_cb, editor); + /* NOTE: Make sure the 7 and 8 below correspond to the correct + * elements in the pixmaps array. + */ + if (!pixmaps[7].name) { + pixmaps[7].name = g_build_filename (EVOLUTION_ICONSDIR, "query-free-busy.png", NULL); + pixmaps[8].name = g_build_filename (EVOLUTION_ICONSDIR, "query-free-busy.png", NULL); + } e_pixmaps_update (editor->uic, pixmaps); bonobo_ui_component_thaw (editor->uic, NULL); diff --git a/calendar/gui/e-day-view-main-item.c b/calendar/gui/e-day-view-main-item.c index 27f7c552ad..cc6390ebd8 100644 --- a/calendar/gui/e-day-view-main-item.c +++ b/calendar/gui/e-day-view-main-item.c @@ -481,7 +481,7 @@ e_day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *dvmitem, gint event_num, start_day, end_day, day, bar_y1, bar_y2, grid_x; ECalComponentTransparency transparency; cairo_t *cr; - GdkColor *bg_color; + GdkColor bg_color; day_view = dvmitem->day_view; @@ -499,12 +499,11 @@ e_day_view_main_item_draw_long_events_in_vbars (EDayViewMainItem *dvmitem, event_num); if (gdk_color_parse (e_cal_model_get_color_for_component (e_calendar_view_get_model (E_CALENDAR_VIEW (day_view)), event->comp_data), &bg_color)) { - GdkColormap *colormap; + GdkColormap *colormap; - colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); - if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE)) { - gdk_cairo_set_source_color (cr, - &bg_color); + colormap = gtk_widget_get_colormap (GTK_WIDGET (day_view)); + if (gdk_colormap_alloc_color (colormap, &bg_color, TRUE, TRUE)) { + gdk_cairo_set_source_color (cr, &bg_color); } } -- cgit