Bug #44
Fix libnotify compatibility across its versions
Status: | Approved | Start date: | 03/08/2011 | |
---|---|---|---|---|
Priority: | High | Due date: | ||
Assignee: | Jan Dolinár | % Done: | 100% | |
Category: | - | Spent time: | - | |
Target version: | - |
Description
Hi,
I noticed that since libnotify-0.7.0, the API has changed and more specifically the prototype of notify_notification_new()
.
The attached patch attempts to make the code in TrayIconX11.cpp
compatible with both APIs.
I only tested it with libnotify-0.7.1, so I'd like someone to check if it still compiles with an older libnotify (0.6 or 0.5 branch).
Thanks,
Lionel
History
#1 Updated by Miroslav Fidler about 14 years ago
- Assignee changed from Miroslav Fidler to Jan Dolinár
Patch applied, I ask Jan to provide the final check (like try to compile it with natty and some older ubuntu :) and approve.
#2 Updated by Lionel Orry about 14 years ago
Note: fixed by revision r3272
#3 Updated by Jan Dolinár about 14 years ago
Tested on Arch with libnotify 0.5.2 and it fails to compile. I believe that the check in TrayIconX11 should look like this:
#if !defined(flagNOGTK) #include <glib.h> #include <libnotify/notify.h> #if NOTIFY_CHECK_VERSION(0,7,0) #define NOTIFY_VERSION_GT_0_7_0 #endif #endif
Natty has the same version (I will test in few minutes), some of the previous versions of Ubuntu go as deep as 4.5 :) We will see detailed results for each tomorrow morning in launchpad ;) Mirek, it would be great if you can commit the above snippet tonight, otherwise the NOGTK builds will most probably fail.
#4 Updated by Jan Dolinár about 14 years ago
- Status changed from New to In Progress
- Assignee changed from Jan Dolinár to Miroslav Fidler
#5 Updated by Jan Dolinár about 14 years ago
Jan Dolinár wrote:
Mirek, it would be great if you can commit the above snippet tonight, otherwise the NOGTK builds will most probably fail.
Meh, talking nonsense here :) Actually the non-NOGTK (that is normal) builds would fail :)
Also, since the check is at one place only the #if NOTIFY_CHECK_VERSION(0,7,0)
could be directly at the place where is it used...
#6 Updated by Sender Ghost about 14 years ago
#7 Updated by Jan Dolinár about 14 years ago
Upon further inspection I found I was also wrong about the ubuntu version. I must have been really tired yesterday :-/ In Natty there is 0.5.0, which differs from 0.5.2 in one signifact detail - it lacks the NOTIFY_CHECK_VERSION macro, so original code from Lionel would actually work there and my correction wouldn't. So for best compatibility across all versions I think it must be
#if !defined(flagNOGTK) #include <glib.h> #include <libnotify/notify.h> #ifdef NOTIFY_CHECK_VERSION #if NOTIFY_CHECK_VERSION(0,7,0) #define NOTIFY_VERSION_GT_0_7_0 #endif #endif #endif
This works in Natty (libnotify 0.5.0) and in Arch both with 0.5.2 and 0.7.1.
Sorry for the mistakes yesterday...
Sender Ghost: Thanks for confirmation ;)
#8 Updated by Lionel Orry about 14 years ago
MY first fix was the same as Jan, then I noticed the lack of the macro. I must have looked at the code from 0.5.0 and not 0.5.2...
So the last fix from Jan fits in perfectly IMO :)
Thanks for testing,
Lionel
#9 Updated by Miroslav Fidler about 14 years ago
- Status changed from In Progress to Ready for QA
- Assignee changed from Miroslav Fidler to Jan Dolinár
#10 Updated by Jan Dolinár about 14 years ago
- Status changed from Ready for QA to Approved
- % Done changed from 0 to 100
Works fine on every version I tested.