From ca5bb104db0ce17dbf3aa692e2b7d3c4cc3215a8 Mon Sep 17 00:00:00 2001 From: apa420 Date: Sat, 1 Sep 2018 13:01:54 +0200 Subject: [PATCH] hopefully it will now compile on linux --- dependencies/wintoast.pri | 8 +++++--- src/controllers/notifications/NotificationController.cpp | 4 +++- src/singletons/Toasts.cpp | 3 +++ src/singletons/Toasts.hpp | 2 ++ 4 files changed, 13 insertions(+), 4 deletions(-) diff --git a/dependencies/wintoast.pri b/dependencies/wintoast.pri index 1966436a7..b8a5ee85c 100644 --- a/dependencies/wintoast.pri +++ b/dependencies/wintoast.pri @@ -1,3 +1,5 @@ -INCLUDEPATH += $$PWD/../lib/wintoast/src/ -SOURCES += \ - $$PWD/../lib/WinToast/src/wintoastlib.cpp +win32 { + INCLUDEPATH += $$PWD/../lib/wintoast/src/ + SOURCES += \ + $$PWD/../lib/WinToast/src/wintoastlib.cpp +} diff --git a/src/controllers/notifications/NotificationController.cpp b/src/controllers/notifications/NotificationController.cpp index bab44b76b..2b68b130f 100644 --- a/src/controllers/notifications/NotificationController.cpp +++ b/src/controllers/notifications/NotificationController.cpp @@ -11,7 +11,9 @@ #include "singletons/WindowManager.hpp" #include "widgets/Window.hpp" -#include +#ifdef Q_OS_WIN +# include +#endif #include #include diff --git a/src/singletons/Toasts.cpp b/src/singletons/Toasts.cpp index af342675f..33df8e3b5 100644 --- a/src/singletons/Toasts.cpp +++ b/src/singletons/Toasts.cpp @@ -26,8 +26,11 @@ namespace chatterino { bool Toasts::isEnabled() { +#ifdef Q_OS_WIN return WinToastLib::WinToast::isCompatible() && getSettings()->notificationToast; +#endif + return false; } void Toasts::sendChannelNotification(const QString &channelName, Platform p) diff --git a/src/singletons/Toasts.hpp b/src/singletons/Toasts.hpp index 4ffb8d742..3a245346f 100644 --- a/src/singletons/Toasts.hpp +++ b/src/singletons/Toasts.hpp @@ -15,7 +15,9 @@ public: static bool isEnabled(); private: +#ifdef Q_OS_WIN void sendWindowsNotification(const QString &channelName, Platform p); +#endif static void fetchChannelAvatar( const QString channelName, std::function successCallback);