diff --git a/CMakeLists.txt b/CMakeLists.txt index 7e9fae2..41df0fd 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -18,10 +18,9 @@ find_package(Qt5 CONFIG REQUIRED COMPONENTS WebEngineWidgets ) -option(KF5NOTIFICATIONS "Use KF5Notifications for enhanced system notifications" ON) -if(KF5NOTIFICATIONS) - add_definitions( -DKF5NOTIFICATIONS ) - find_package(KF5Notifications) +find_package(KF5Notifications) +if(KF5Notifications_FOUND) + add_definitions( -DKNOTIFICATIONS ) endif() set(discord-screenaudio_SRC @@ -59,7 +58,7 @@ add_executable(discord-screenaudio ${discord-screenaudio_SRC}) target_link_libraries(discord-screenaudio Qt5::Widgets Qt5::WebEngineWidgets rohrkabel) -if(KF5NOTIFICATIONS) +if(KF5Notifications_FOUND) target_link_libraries(discord-screenaudio KF5::Notifications) install(FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/knotifications5) endif() diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index a7e5444..c44e458 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -1,7 +1,7 @@ #include "mainwindow.h" #include "virtmic.h" -#ifdef KF5NOTIFICATIONS +#ifdef KNOTIFICATIONS #include #endif @@ -36,7 +36,7 @@ void MainWindow::setupWebView() { m_webView = new QWebEngineView(this); m_webView->setPage(page); -#ifdef KF5NOTIFICATIONS +#ifdef KNOTIFICATIONS QWebEngineProfile::defaultProfile()->setNotificationPresenter( [&](std::unique_ptr notificationInfo) { KNotification *notification = new KNotification("discordNotification");