summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorPatrick Ohly <patrick.ohly@intel.com>2016-09-20 06:51:11 -0700
committerPatrick Ohly <patrick.ohly@intel.com>2016-09-20 06:51:11 -0700
commit499c1c72d5fcf421c18cf2053b24bfda32c6034d (patch)
treef24c03a1705de598d6995010e96428c796055727 /src
parentbf3c8d5361f5b3b29a7f81235ef9d3d7ff6c5207 (diff)
syncevolution.org: drop binary compatibility hack for old libnotify
syncevolution.org binaries are going to support distros >= Ubuntu Trusty. All of those have libnotify.so.4, so the old binary compatibility hack is no longer needed.
Diffstat (limited to 'src')
-rw-r--r--src/dbus/server/notification-backend-libnotify.cpp64
1 files changed, 1 insertions, 63 deletions
diff --git a/src/dbus/server/notification-backend-libnotify.cpp b/src/dbus/server/notification-backend-libnotify.cpp
index caba91fa..97036d6d 100644
--- a/src/dbus/server/notification-backend-libnotify.cpp
+++ b/src/dbus/server/notification-backend-libnotify.cpp
@@ -33,40 +33,8 @@
#include <boost/algorithm/string/predicate.hpp>
#include <boost/foreach.hpp>
-#ifdef NOTIFY_COMPATIBILITY
-# include <dlfcn.h>
-#endif
-
SE_BEGIN_CXX
-#ifdef NOTIFY_COMPATIBILITY
-/**
- * set to real old C notify_notification_new() (with widget pointer) or new one (without);
- * because of the x86/AMD64 calling conventions, calling the newer function with
- * one extra parameter is okay
- */
-gboolean (*notify_init)(const char *app_name);
-GList *(*notify_get_server_caps)(void);
-NotifyNotification *(*notify_notification_new)(const char *summary, const char *body, const char *icon, void *widget);
-void (*notify_notification_add_action)(NotifyNotification *notification,
- const char *action,
- const char *label,
- NotifyActionCallback callback,
- gpointer user_data,
- GFreeFunc free_func);
-void (*notify_notification_clear_actions)(NotifyNotification *notification);
-gboolean (*notify_notification_close)(NotifyNotification *notification,
- GError **error);
-gboolean (*notify_notification_show)(NotifyNotification *notification,
- GError **error);
-
-static bool NotFound(const char *func)
-{
- SE_LOG_DEBUG(NULL, "%s: not found", func);
- return false;
-}
-#endif
-
NotificationBackendLibnotify::NotificationBackendLibnotify()
: m_initialized(false),
m_acceptsActions(false),
@@ -96,36 +64,6 @@ void NotificationBackendLibnotify::notifyAction(
bool NotificationBackendLibnotify::init()
{
-#ifdef NOTIFY_COMPATIBILITY
- void *dlhandle = NULL;
- int i;
- for (i = 1; i <= 4; i++) {
- dlhandle = dlopen(StringPrintf("libnotify.so.%d", i).c_str(), RTLD_LAZY|RTLD_GLOBAL);
- if (!dlhandle) {
- SE_LOG_DEBUG(NULL, "failed to load libnotify.so.%d: %s", i, dlerror());
- } else {
- break;
- }
- }
- if (!dlhandle) {
- return false;
- }
-
-#define LOOKUP(_x) ((_x = reinterpret_cast<typeof(_x)>(dlsym(dlhandle, #_x))) || \
- NotFound(#_x))
-
- if (!LOOKUP(notify_init) ||
- !LOOKUP(notify_get_server_caps) ||
- !LOOKUP(notify_notification_new) ||
- !LOOKUP(notify_notification_add_action) ||
- !LOOKUP(notify_notification_clear_actions) ||
- !LOOKUP(notify_notification_close) ||
- !LOOKUP(notify_notification_show)) {
- return false;
- }
- SE_LOG_DEBUG(NULL, "using libnotify.so.%d", i);
-#endif
-
m_initialized = notify_init("SyncEvolution");
if(m_initialized) {
GStringListFreeCXX list(notify_get_server_caps());
@@ -154,7 +92,7 @@ void NotificationBackendLibnotify::publish(
#ifndef NOTIFY_CHECK_VERSION
# define NOTIFY_CHECK_VERSION(_x,_y,_z) 0
#endif
-#if !NOTIFY_CHECK_VERSION(0,7,0) || defined(NOTIFY_COMPATIBILITY)
+#if !NOTIFY_CHECK_VERSION(0,7,0)
m_notification = notify_notification_new(summary.c_str(), body.c_str(), NULL, NULL);
#else
m_notification = notify_notification_new(summary.c_str(), body.c_str(), NULL);