[evolution-patches] patch for #62030 (calendar)



On Thu, 2004-08-05 at 10:09 -0400, Jeffrey Stedfast wrote:
> eh? you don't need to g_free() alloca()'d memory.
> 
right, valgrind was bailing about this, and didn't see the g_alloca
call. So, yes, discard this patch.

The real fix for the bug I was trying to fix is attached.
-- 
Rodrigo Moya <rodrigo novell com>
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/evolution/calendar/ChangeLog,v
retrieving revision 1.2475
diff -u -p -r1.2475 ChangeLog
--- ChangeLog	5 Aug 2004 13:28:03 -0000	1.2475
+++ ChangeLog	5 Aug 2004 14:30:05 -0000
@@ -1,6 +1,20 @@
+2004-08-05  Rodrigo Moya <rodrigo novell com>
+
+	Fixes #62030
+
+	* gui/alarm-notify/alarm-queue.c (tray_icon_destroyed_cb):
+	only remove the tray icon blinking timeout if we installed
+	it.
+	(display_notification): only install the tray icon blinking
+	timeout if using the system tray.
+	(tray_icon_blink_cb): keep the pixbufs around.
+
+	* gui/alarm-notify/alarm.c (alarm_add): added missing argument
+	documentation.
+
 2004-08-03  JP Rosevear  <jpr novell com>
  
- 	* gui/gnome-cal.c (gnome_calendar_destroy): clean up all the
+	* gui/gnome-cal.c (gnome_calendar_destroy): clean up all the
  	default clients
  	(default_client_cal_opened_cb): change the if statement to a
  	switch to be consistent with the other code bits and set the
@@ -11,15 +25,15 @@
  	source type
  	(gnome_calendar_new_task): bail out if we have no ecal
  
- 	* gui/gnome-cal.c (set_timezone): set the timezone for all the
+	* gui/gnome-cal.c (set_timezone): set the timezone for all the
  	default clients
  
- 	* gui/calendar-component.c (update_primary_task_selection): look
+	* gui/calendar-component.c (update_primary_task_selection): look
 	in the task source list, not the plain source list
 	
 2004-08-05  JP Rosevear  <jpr novell com>
 
- 	* gui/tasks-control.c (tasks_control_sensitize_commands): kill
+	* gui/tasks-control.c (tasks_control_sensitize_commands): kill
  	warning by checking if there is a default client first (can happen
  	when first starting up)
 	
Index: gui/alarm-notify/alarm-queue.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm-queue.c,v
retrieving revision 1.67
diff -u -p -r1.67 alarm-queue.c
--- gui/alarm-notify/alarm-queue.c	18 May 2004 14:14:14 -0000	1.67
+++ gui/alarm-notify/alarm-queue.c	5 Aug 2004 14:30:15 -0000
@@ -236,7 +236,7 @@ remove_queued_alarm (CompQueuedAlarms *c
 	if (remove_alarm) {
 		cqa->expecting_update = TRUE;
 		e_cal_discard_alarm (cqa->parent_client->client, cqa->alarms->comp,
-					  qa->instance->auid, NULL);
+				     qa->instance->auid, NULL);
 		cqa->expecting_update = FALSE;
 	}
 
@@ -776,7 +776,8 @@ tray_icon_destroyed_cb (GtkWidget *tray,
 		tray_data->message = NULL;
 	}
 
-	g_source_remove (tray_data->blink_id);
+	if (tray_data->blink_id)
+		g_source_remove (tray_data->blink_id);
 
 	g_object_unref (tray_data->comp);
 	g_object_unref (tray_data->client);
@@ -896,16 +897,19 @@ tray_icon_clicked_cb (GtkWidget *widget,
 static gboolean
 tray_icon_blink_cb (gpointer data)
 {
+	static GdkPixbuf *excl_pixbuf = NULL, *normal_pixbuf = NULL;
 	TrayIconData *tray_data = data;
 	GdkPixbuf *pixbuf;
 
+	if (!excl_pixbuf)
+		excl_pixbuf = e_icon_factory_get_icon  ("stock_appointment-reminder-excl", E_ICON_SIZE_LARGE_TOOLBAR);
+	if (!normal_pixbuf)
+		normal_pixbuf = e_icon_factory_get_icon  ("stock_appointment-reminder", E_ICON_SIZE_LARGE_TOOLBAR);
+
 	tray_data->blink_state = tray_data->blink_state == TRUE ? FALSE : TRUE;
-	pixbuf = e_icon_factory_get_icon  (tray_data->blink_state == TRUE ?
-				 	   "stock_appointment-reminder-excl" :
-				 	   "stock_appointment-reminder",
-					   E_ICON_SIZE_LARGE_TOOLBAR);
+	pixbuf = tray_data->blink_state == TRUE ? excl_pixbuf : normal_pixbuf;
+
 	gtk_image_set_from_pixbuf (GTK_IMAGE (tray_data->image), pixbuf);
-	gdk_pixbuf_unref (pixbuf);
 
 	return TRUE;
 }
@@ -1003,13 +1007,13 @@ display_notification (time_t trigger, Co
 	g_signal_connect (G_OBJECT (tray_data->query), "objects_removed",
 			  G_CALLBACK (on_dialog_objs_removed_cb), tray_data);
 
-	tray_data->blink_id = g_timeout_add (500, tray_icon_blink_cb, tray_data);
-
 	if (!config_data_get_notify_with_tray ()) {
+		tray_data->blink_id = -1;
 		open_alarm_dialog (tray_data);
 	} else {
+		tray_data->blink_id = g_timeout_add (500, tray_icon_blink_cb, tray_data);
 		gtk_widget_show (tray_icon);
-	}	
+	}
 }
 
 /* Performs notification of an audio alarm */
Index: gui/alarm-notify/alarm.c
===================================================================
RCS file: /cvs/gnome/evolution/calendar/gui/alarm-notify/alarm.c,v
retrieving revision 1.31
diff -u -p -r1.31 alarm.c
--- gui/alarm-notify/alarm.c	18 May 2004 13:33:40 -0000	1.31
+++ gui/alarm-notify/alarm.c	5 Aug 2004 14:30:15 -0000
@@ -182,6 +182,7 @@ queue_alarm (AlarmRecord *ar)
  * @trigger: Time at which alarm will trigger.
  * @alarm_fn: Callback for trigger.
  * @data: Closure data for callback.
+ * @destroy_notify_fn: destroy notification callback.
  *
  * Adds an alarm to trigger at the specified time.  The @alarm_fn will be called
  * with the provided data and the alarm will be removed from the trigger list.


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]