diff --git a/src/osd_x11.cpp b/src/osd_x11.cpp index a23ec3431..76ba58c1e 100644 --- a/src/osd_x11.cpp +++ b/src/osd_x11.cpp @@ -1,10 +1,10 @@ // Libnotify headers need to go before Qt ones because they use "signals" as // a variable name -#ifndef NOLIBNOTIFY +#ifdef HAVE_LIBNOTIFY # include # include # include -#endif // NOLIBNOTIFY +#endif // HAVE_LIBNOTIFY #include "osd.h" @@ -15,16 +15,16 @@ void OSD::Init() { notification_ = NULL; pixbuf_ = NULL; -#ifndef NOLIBNOTIFY +#ifdef HAVE_LIBNOTIFY notify_init(QCoreApplication::applicationName().toUtf8().constData()); #endif } bool OSD::SupportsNativeNotifications() { -#ifdef NOLIBNOTIFY - return false; -#else +#ifdef HAVE_LIBNOTIFY return true; +#else + return false; #endif } @@ -34,7 +34,7 @@ bool OSD::SupportsTrayPopups() { void OSD::ShowMessageNative(const QString& summary, const QString& message, const QString& icon) { -#ifndef NOLIBNOTIFY +#ifdef HAVE_LIBNOTIFY if (summary.isNull()) return; @@ -60,12 +60,12 @@ void OSD::ShowMessageNative(const QString& summary, const QString& message, } pixbuf_ = NULL; -#endif // NOLIBNOTIFY +#endif // HAVE_LIBNOTIFY } void OSD::ShowMessageNative(const QString& summary, const QString& message, const QImage& image) { -#ifndef NOLIBNOTIFY +#ifdef HAVE_LIBNOTIFY QImage happy_gdk_image = image.convertToFormat(QImage::Format_RGB888).scaledToHeight(100); pixbuf_ = gdk_pixbuf_new_from_data( happy_gdk_image.bits(), @@ -78,5 +78,5 @@ void OSD::ShowMessageNative(const QString& summary, const QString& message, NULL, NULL); ShowMessageNative(summary, message, QString()); -#endif // NOLIBNOTIFY +#endif // HAVE_LIBNOTIFY } diff --git a/src/src.pro b/src/src.pro index 03300b226..5dc396016 100644 --- a/src/src.pro +++ b/src/src.pro @@ -179,9 +179,9 @@ win32|fedora-win32-cross:LIBS += -ltag \ # OSD unix:!macx { - nolibnotify:DEFINES += NOLIBNOTIFY SOURCES += osd_x11.cpp !nolibnotify { + DEFINES += HAVE_LIBNOTIFY QMAKE_CXXFLAGS += $$system(pkg-config --cflags libnotify) LIBS += $$system(pkg-config --libs libnotify) }