diff --git a/src/NotificationManagerFactory.cpp b/src/NotificationManagerFactory.cpp index 9c1f364f..019d6726 100644 --- a/src/NotificationManagerFactory.cpp +++ b/src/NotificationManagerFactory.cpp @@ -39,18 +39,23 @@ boost::shared_ptr NotificationManagerFactory::createMan * libnotify is enabled, we shall use the libnotify backend; * if everything fails, then we'll use the no-op backend. */ - if(access(SYNC_UI_PATH, F_OK) != 0) { // i.e. it does not exist -#if HAS_MLITE + if(access(SYNC_UI_PATH, F_OK) != 0) { + // i.e. it does not exist +#if defined(HAS_MLITE) mgr.reset(new NotificationManager()); +#elif defined(HAS_NOTIFY) + mgr.reset(new NotificationManager()); #endif } else { // it exists -#if HAS_NOTIFY +#if defined(HAS_NOTIFY) mgr.reset(new NotificationManager()); -#else - mgr.reset(new NotificationManager()); #endif } + // Fallback if no manager was created + if(mgr.get() == 0) + mgr.reset(new NotificationManager()); + return mgr; }