rpms/evolution/devel evolution-2.5.4-port-to-new-libnotify-api.patch, NONE, 1.1 evolution.spec, 1.110, 1.111

fedora-cvs-commits at redhat.com fedora-cvs-commits at redhat.com
Wed Jan 11 22:14:41 UTC 2006


Author: dmalcolm

Update of /cvs/dist/rpms/evolution/devel
In directory cvs.devel.redhat.com:/tmp/cvs-serv29368

Modified Files:
	evolution.spec 
Added Files:
	evolution-2.5.4-port-to-new-libnotify-api.patch 
Log Message:
* Wed Jan 11 2006 David Malcolm <dmalcolm at redhat.com> - 2.5.4-4
- ported alarm notification code to the new libnotify API (patch 806, #177546)
- added libnotify_support macro
- added explicit notify-daemon requirement as a workaround for bug #177535



evolution-2.5.4-port-to-new-libnotify-api.patch:
 alarm-queue.c |   39 ++++++++++++++-------------------------
 1 files changed, 14 insertions(+), 25 deletions(-)

--- NEW FILE evolution-2.5.4-port-to-new-libnotify-api.patch ---
--- evolution-2.5.4/calendar/gui/alarm-notify/alarm-queue.c.port-to-new-libnotify-api	2006-01-11 14:21:50.000000000 -0500
+++ evolution-2.5.4/calendar/gui/alarm-notify/alarm-queue.c	2006-01-11 14:36:01.000000000 -0500
@@ -1457,12 +1457,12 @@
 	const char *summary, *location;
 	GtkTooltips *tooltips;
 	ECalComponentText text;
-	char *str, *start_str, *end_str, *alarm_str, *time_str;
+	char *start_str, *end_str, *alarm_str, *time_str;
 	icaltimezone *current_zone;
 	ECalComponentOrganizer organiser;
-	NotifyIcon *icon;
-	char *filename;
+	char *icon_filename;
 	char *body;
+	NotifyNotification *notification;
 	
 	comp = cqa->alarms->comp;
 	qa = lookup_queued_alarm (cqa, alarm_id);
@@ -1470,9 +1470,7 @@
 		return;
 	if (!notify_is_initted ())
 		notify_init("Evolution Alarm Notify");
-	filename = e_icon_factory_get_icon_filename ("stock_appointment-reminder", E_ICON_SIZE_DIALOG);
-	icon = notify_icon_new_from_uri (filename);
-	g_free (filename);
+	icon_filename = e_icon_factory_get_icon_filename ("stock_appointment-reminder", E_ICON_SIZE_DIALOG);
 	
 	/* get a sensible description for the event */
 	e_cal_component_get_summary (comp, &text);
@@ -1495,9 +1493,6 @@
 	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);
-
 	if (organiser.cn) {
 		if (location)
 			body = g_strdup_printf ("<b>%s</b>\n%s %s\n%s %s", organiser.cn, _("Location:"), location, start_str, time_str);
@@ -1508,28 +1503,22 @@
 		if (location)
 			body = g_strdup_printf ("%s %s\n%s %s", _("Location:"), location, start_str, time_str);
 		else
-			body = g_strdup_printf ("%s %s", start_str, time_str);			
-}
+		        body = g_strdup_printf ("%s %s", start_str, time_str);			
+	}
 
-	if (!notify_send_notification (
-					NULL, "device", NOTIFY_URGENCY_NORMAL,
-					summary,
-					body, 	/* body text */
-					icon,			/* icon */
-					TRUE, 0,		/* expiry, server default */
-					NULL,			/* hints */
-					NULL,			/* no user_data */
-					0))			/* no actions */
-					g_warning ("Could not send notification to daemon\n");	
+	notification = notify_notification_new (summary,
+						body,
+						icon_filename,
+						NULL);
+	if (!notify_notification_show_and_forget (notification, NULL))
+	        g_warning ("Error showing notification\n");
 
-	/* create the private structure */
+	g_free (icon_filename);
+	g_free (body);
 	g_free (start_str);
 	g_free (end_str);
 	g_free (alarm_str);
 	g_free (time_str);
-	g_free (str);
-
-
 }
 #endif
 


Index: evolution.spec
===================================================================
RCS file: /cvs/dist/rpms/evolution/devel/evolution.spec,v
retrieving revision 1.110
retrieving revision 1.111
diff -u -r1.110 -r1.111
--- evolution.spec	11 Jan 2006 05:57:14 -0000	1.110
+++ evolution.spec	11 Jan 2006 22:14:37 -0000	1.111
@@ -25,6 +25,7 @@
 %define nntp_support 1
 %define exchange_support 1
 %define nm_support 1
+%define libnotify_support 1
 
 %define redhat_menus_version 5.0.4
 
@@ -32,7 +33,7 @@
 
 Name: evolution
 Version: 2.5.4
-Release: 3
+Release: 4
 License: GPL
 BuildRoot: %{_tmppath}/%{name}-%{version}-root
 URL: http://www.ximian.com/
@@ -91,6 +92,7 @@
 
 Patch804: evolution-2.4.1-fix-missing-declarations.patch
 Patch805: evolution-2.5.4-fix-missing-declarations.patch
+Patch806: evolution-2.5.4-port-to-new-libnotify-api.patch
 
 Summary: GNOME's next-generation groupware suite
 Group: Applications/Productivity
@@ -111,6 +113,11 @@
 Requires: libgnomeprint22 >= %{libgnomeprint22_version}
 Requires: gnome-vfs2 >= %{gnomevfs2_version}
 
+%if %{libnotify_support}
+Requires: libnotify
+Requires: notify-daemon
+%endif
+
 Obsoletes: libgal2 <= %{last_libgal2_version}
 
 BuildRequires: gtkhtml3-devel >= %{gtkhtml_version}
@@ -169,6 +176,11 @@
 BuildRequires: NetworkManager-glib-devel
 %endif
 
+%if %{libnotify_support}
+BuildRequires: libnotify
+#ought to eventually be libnotify-devel, see bug 177484
+%endif
+
 %description
 Evolution is the GNOME mailer, calendar, contact manager and
 communications tool.  The tools which make up Evolution will
@@ -223,6 +235,7 @@
 %patch803 -p1 -b .no-gnome-common
 %patch804 -p1 -b .fix-missing-declarations
 %patch805 -p1 -b .fix-missing-declarations-2-5-4
+%patch806 -p1 -b .port-to-new-libnotify-api
 
 mkdir -p krb5-fakeprefix/include
 mkdir -p krb5-fakeprefix/lib
@@ -499,6 +512,11 @@
 %{_libdir}/evolution/%{evo_major}/*.so
 
 %changelog
+* Wed Jan 11 2006 David Malcolm <dmalcolm at redhat.com> - 2.5.4-4
+- ported alarm notification code to the new libnotify API (patch 806, #177546)
+- added libnotify_support macro
+- added explicit notify-daemon requirement as a workaround for bug #177535
+
 * Tue Jan 10 2006 David Malcolm <dmalcolm at redhat.com> - 2.5.4-3
 - updated patch 800 to include patch for memo conduit (untested at this stage);
   renaming from evolution-2.5.2-fix-conduits.patch to 




More information about the fedora-cvs-commits mailing list