[collectd] [patch for] collectd and libnotify 0.7 API

Samuli Suominen ssuominen at gentoo.org
Mon Mar 28 00:11:53 CEST 2011


The current code in src/notify_desktop.c is not compatible with the new
libnotify 0.7 API

This:

notification = notify_notification_new (summary, n->message, NULL, NULL);

Should now be:

notification = notify_notification_new (summary, n->message, NULL;

As in, one argument less for notify_notification_new.

But we can't just remove it or it'll break compability with libnotify
0.4.x and 0.5.x.

This piece of code sets dummy NOTIFY_CHECK_VERSION for libnotify-0.4.x,
because NOTIFY_CHECK_VERSION was added only in 0.5.x:

#ifndef NOTIFY_CHECK_VERSION
#define NOTIFY_CHECK_VERSION(x,y,z) 0
#endif

Then we can freely use NOTIFY_CHECK_VERSION, and it will work with all
of 0.4, 0.5 and 0.7 series:

#if NOTIFY_CHECK_VERSION (0, 7, 0)
do something cool
#endif


I'm attaching the working patch.  It's been tested with all of the
mentioned versions, as well as it's in active use at Gentoo Linux.

Thanks, Samuli
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: collectd-4.10.2-libnotify-0.7.patch
URL: <http://mailman.verplant.org/pipermail/collectd/attachments/20110328/a1da5a3c/attachment.txt>


More information about the collectd mailing list