diff --git a/CMakeLists.txt b/CMakeLists.txt index beebe20..a024335 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -63,6 +63,7 @@ else() find_package(KF6XmlGui QUIET) if(KF6XmlGui_FOUND) + find_package(KF6CoreAddons QUIET REQUIRED) add_definitions( -DKXMLGUI ) else() message(WARNING "KF6XmlGui not found, some UI elements and global shortcuts will not work") @@ -115,17 +116,29 @@ add_executable(discord-screenaudio ${discord-screenaudio_SRC}) target_link_libraries(discord-screenaudio Qt::Widgets Qt::WebEngineWidgets rohrkabel) -if(KF5Notifications_FOUND OR KF6Notifications_FOUND) +if(KF5Notifications_FOUND) target_link_libraries(discord-screenaudio KF5::Notifications) install(FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/knotifications5) endif() -if(KF5XmlGui_FOUND OR KF6XmlGui_FOUND) +if(KF5XmlGui_FOUND) target_link_libraries(discord-screenaudio KF5::XmlGui) endif() -if(KF5GlobalAccel_FOUND OR KF6GlobalAccel_FOUND) +if(KF5GlobalAccel_FOUND) target_link_libraries(discord-screenaudio KF5::GlobalAccel) endif() +if(KF6Notifications_FOUND) + target_link_libraries(discord-screenaudio KF6::Notifications) + install(FILES assets/discord-screenaudio.notifyrc DESTINATION ${CMAKE_INSTALL_PREFIX}/share/knotifications6) +endif() +if(KF6XmlGui_FOUND) + target_link_libraries(discord-screenaudio KF6::CoreAddons) + target_link_libraries(discord-screenaudio KF6::XmlGui) +endif() +if(KF6GlobalAccel_FOUND) + target_link_libraries(discord-screenaudio KF6::GlobalAccel) +endif() + install(TARGETS discord-screenaudio DESTINATION bin) install(FILES assets/de.shorsh.discord-screenaudio.png DESTINATION ${CMAKE_INSTALL_PREFIX}/share/icons/hicolor/256x256/apps) install(PROGRAMS assets/de.shorsh.discord-screenaudio.desktop DESTINATION ${CMAKE_INSTALL_PREFIX}/share/applications) diff --git a/src/centralwidget.cpp b/src/centralwidget.cpp index 4461194..7e77f2f 100644 --- a/src/centralwidget.cpp +++ b/src/centralwidget.cpp @@ -50,8 +50,8 @@ void CentralWidget::setupWebView() { notification->setText(notificationInfo->message()); notification->setPixmap( QPixmap::fromImage(notificationInfo->icon())); - notification->setDefaultAction("View"); - connect(notification, &KNotification::defaultActivated, + notification->addDefaultAction("View"); + connect(notification, &KNotification::defaultAction, [&, notificationInfo = std::move(notificationInfo)]() { notificationInfo->click(); show(); diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp index c773640..d154c00 100644 --- a/src/mainwindow.cpp +++ b/src/mainwindow.cpp @@ -36,7 +36,7 @@ MainWindow::MainWindow(bool useNotifySend, QWidget *parent) setCentralWidget(m_centralWidget); setupTrayIcon(); setMinimumSize(800, 300); - connect(new QShortcut(QKeySequence(Qt::CTRL + Qt::Key_Q), this), + connect(new QShortcut(QKeySequence(Qt::CTRL | Qt::Key_Q), this), &QShortcut::activated, this, &MainWindow::toggleOrCloseWindow); if (m_settings->contains("geometry")) { restoreGeometry(m_settings->value("geometry").toByteArray());