From 2a6e3c0adda3f3be893071d39893c14140449106 Mon Sep 17 00:00:00 2001 From: Carl Schwan Date: Fri, 20 Sep 2024 14:19:27 +0200 Subject: [PATCH] Remove global menu support from Android This pull out QtWidgets which we don't need --- src/CMakeLists.txt | 6 ++++-- src/qml/GlobalMenu.qml | 2 +- src/qml/Main.qml | 5 +++-- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 0adab77b5..66e21546a 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -238,7 +238,6 @@ ecm_add_qml_module(neochat URI org.kde.neochat GENERATE_PLUGIN_SOURCE qml/EmojiSas.qml qml/ConfirmDeactivateAccountDialog.qml qml/VerificationCanceled.qml - qml/GlobalMenu.qml qml/EditMenu.qml qml/MessageDelegateContextMenu.qml qml/FileDelegateContextMenu.qml @@ -307,7 +306,10 @@ add_subdirectory(login) add_subdirectory(chatbar) if(NOT ANDROID AND NOT WIN32) - qt_target_qml_sources(neochat QML_FILES qml/ShareAction.qml) + qt_target_qml_sources(neochat QML_FILES + qml/ShareAction.qml + qml/GlobalMenu.qml + ) else() set_source_files_properties(qml/ShareActionStub.qml PROPERTIES QT_RESOURCE_ALIAS qml/ShareAction.qml diff --git a/src/qml/GlobalMenu.qml b/src/qml/GlobalMenu.qml index 89140e99a..b1a5ab0bf 100644 --- a/src/qml/GlobalMenu.qml +++ b/src/qml/GlobalMenu.qml @@ -15,7 +15,7 @@ import org.kde.neochat.settings Labs.MenuBar { id: root - required property NeoChatConnection connection + property NeoChatConnection connection Labs.Menu { title: i18nc("menu", "NeoChat") diff --git a/src/qml/Main.qml b/src/qml/Main.qml index d545973bc..e70e0b046 100644 --- a/src/qml/Main.qml +++ b/src/qml/Main.qml @@ -64,8 +64,9 @@ Kirigami.ApplicationWindow { Loader { active: Kirigami.Settings.hasPlatformMenuBar && !Kirigami.Settings.isMobile - sourceComponent: GlobalMenu { - connection: root.connection + sourceComponent: Qt.createComponent("org.kde.neochat", "GlobalMenu") + onActiveChanged: if (active) { + item.connection = root.connection; } }