diff --git a/.kde-ci.yml b/.kde-ci.yml index 1528e158b..7fbfa54cb 100644 --- a/.kde-ci.yml +++ b/.kde-ci.yml @@ -28,7 +28,6 @@ Dependencies: 'frameworks/qqc2-desktop-style': '@latest-kf6' 'frameworks/kio': '@latest-kf6' 'frameworks/kwindowsystem': '@latest-kf6' - 'frameworks/kstatusnotifieritem': '@latest-kf6' - 'on': ['Linux', 'FreeBSD'] 'require': 'frameworks/kdbusaddons': '@latest-kf6' diff --git a/CMakeLists.txt b/CMakeLists.txt index a5648c0a3..8233c05f8 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -88,7 +88,7 @@ if(ANDROID) ) else() find_package(Qt6 ${QT_MIN_VERSION} COMPONENTS Widgets) - find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle KIO WindowSystem StatusNotifierItem) + find_package(KF6 ${KF_MIN_VERSION} REQUIRED COMPONENTS QQC2DesktopStyle KIO WindowSystem) find_package(KF6SyntaxHighlighting ${KF_MIN_VERSION} REQUIRED) set_package_properties(KF6QQC2DesktopStyle PROPERTIES TYPE RUNTIME diff --git a/src/app/CMakeLists.txt b/src/app/CMakeLists.txt index 5ec13ae1d..ac4bc702d 100644 --- a/src/app/CMakeLists.txt +++ b/src/app/CMakeLists.txt @@ -171,12 +171,7 @@ ecm_add_app_icon(NEOCHAT_ICON ICONS ${CMAKE_SOURCE_DIR}/128-logo.png) target_sources(neochat-app PRIVATE ${NEOCHAT_ICON}) if(NOT ANDROID) - if (NOT WIN32 AND NOT APPLE) - target_sources(neochat PRIVATE trayicon_sni.cpp trayicon_sni.h) - target_link_libraries(neochat PRIVATE KF6::StatusNotifierItem) - else() - target_sources(neochat PRIVATE trayicon.cpp trayicon.h) - endif() + target_sources(neochat PRIVATE trayicon.cpp trayicon.h) target_link_libraries(neochat PUBLIC KF6::WindowSystem) target_compile_definitions(neochat PUBLIC -DHAVE_WINDOWSYSTEM) endif() diff --git a/src/app/controller.cpp b/src/app/controller.cpp index c08083b0c..93f0b99c6 100644 --- a/src/app/controller.cpp +++ b/src/app/controller.cpp @@ -29,10 +29,8 @@ #include "proxycontroller.h" #include "roommanager.h" -#if defined(Q_OS_WIN) || defined(Q_OS_MAC) +#if !defined(Q_OS_ANDROID) #include "trayicon.h" -#elif !defined(Q_OS_ANDROID) -#include "trayicon_sni.h" #endif #ifdef HAVE_KUNIFIEDPUSH diff --git a/src/app/trayicon_sni.cpp b/src/app/trayicon_sni.cpp deleted file mode 100644 index ff44afbcb..000000000 --- a/src/app/trayicon_sni.cpp +++ /dev/null @@ -1,32 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez -// SPDX-License-Identifier: GPL-3.0-only - -#include "trayicon_sni.h" -#include - -#include "windowcontroller.h" - -using namespace Qt::StringLiterals; - -TrayIcon::TrayIcon(QObject *parent) - : KStatusNotifierItem(parent) -{ - setCategory(KStatusNotifierItem::ItemCategory::Communications); - setIconByName(u"org.kde.neochat.tray"_s); - - connect(&WindowController::instance(), &WindowController::windowChanged, this, [this] { - setAssociatedWindow(WindowController::instance().window()); - }); -} - -void TrayIcon::show() -{ - setStatus(Active); -} - -void TrayIcon::hide() -{ - setStatus(Passive); -} - -#include "moc_trayicon_sni.cpp" diff --git a/src/app/trayicon_sni.h b/src/app/trayicon_sni.h deleted file mode 100644 index eb1fe008d..000000000 --- a/src/app/trayicon_sni.h +++ /dev/null @@ -1,30 +0,0 @@ -// SPDX-FileCopyrightText: 2021 Aleix Pol Gonzalez -// SPDX-License-Identifier: GPL-3.0-only - -#pragma once - -#include - -/** - * @class TrayIcon - * - * A class inheriting KStatusNotifierItem to provide a tray icon. - * - * @sa KStatusNotifierItem - */ -class TrayIcon : public KStatusNotifierItem -{ - Q_OBJECT -public: - explicit TrayIcon(QObject *parent = nullptr); - - /** - * @brief Show the tray icon. - */ - void show(); - - /** - * @brief Hide the tray icon. - */ - void hide(); -};