summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@ymail.com>2022-04-16 03:18:56 +0200
committerNicolas Werner <nicolas.werner@ymail.com>2022-04-23 03:10:27 +0200
commitdadaa10b9375374407bcd9b426568fa74e9ad7a8 (patch)
treea9d76f744a1154cd3170c560edd9a06602febe98
parentda96558bb96678d60b5cc3072e33ad7c3e1ec91c (diff)
Remove mac extras
-rw-r--r--CMakeLists.txt12
-rw-r--r--src/emoji/MacHelper.h15
-rw-r--r--src/emoji/MacHelper.mm26
-rw-r--r--src/main.cpp10
4 files changed, 1 insertions, 62 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 5d6ceb5f..7eab6e9c 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -219,10 +219,6 @@ else()
find_package(Qt6Keychain REQUIRED)
endif()
-if (APPLE)
- find_package(Qt6MacExtras REQUIRED)
-endif(APPLE)
-
if (Qt5Widgets_FOUND)
if (Qt5Widgets_VERSION VERSION_LESS 5.15.0)
message(STATUS "Qt version ${Qt5Widgets_VERSION}")
@@ -585,10 +581,6 @@ endif()
if (APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Foundation -framework Cocoa -framework UserNotifications")
- set(SRC_FILES ${SRC_FILES} src/notifications/ManagerMac.mm src/notifications/ManagerMac.cpp src/emoji/MacHelper.mm)
- if(${CMAKE_VERSION} VERSION_GREATER_EQUAL "3.16.0")
- set_source_files_properties( src/notifications/ManagerMac.mm src/emoji/MacHelper.mm PROPERTIES SKIP_PRECOMPILE_HEADERS ON)
- endif()
elseif (WIN32)
file(DOWNLOAD
"https://raw.githubusercontent.com/mohabouje/WinToast/41ed1c58d5dce0ee9c01dbdeac05be45358d4f57/src/wintoastlib.cpp"
@@ -752,9 +744,7 @@ if (NOT COMPILE_QML)
endif()
-if(APPLE)
- target_link_libraries (nheko PRIVATE Qt5::MacExtras)
-elseif(WIN32)
+if(WIN32)
target_compile_definitions(nheko PRIVATE WIN32_LEAN_AND_MEAN)
target_link_libraries (nheko PRIVATE ${NTDLIB} Qt5::WinMain)
if(MSVC)
diff --git a/src/emoji/MacHelper.h b/src/emoji/MacHelper.h
deleted file mode 100644
index cc3fd645..00000000
--- a/src/emoji/MacHelper.h
+++ /dev/null
@@ -1,15 +0,0 @@
-// SPDX-FileCopyrightText: 2021 Nheko Contributors
-// SPDX-FileCopyrightText: 2022 Nheko Contributors
-//
-// SPDX-License-Identifier: GPL-3.0-or-later
-
-#pragma once
-
-#include <QMenuBar>
-
-class MacHelper
-{
-public:
- static void showEmojiWindow();
- static void initializeMenus();
-};
diff --git a/src/emoji/MacHelper.mm b/src/emoji/MacHelper.mm
deleted file mode 100644
index 11dbd7f4..00000000
--- a/src/emoji/MacHelper.mm
+++ /dev/null
@@ -1,26 +0,0 @@
-#include "MacHelper.h"
-
-#include <Cocoa/Cocoa.h>
-#include <Foundation/Foundation.h>
-#include <Foundation/NSString.h>
-#include <QCoreApplication>
-
-void
-MacHelper::showEmojiWindow()
-{
- NSApplication *theNSApplication = [NSApplication sharedApplication];
- [theNSApplication orderFrontCharacterPalette:nil];
-}
-
-void
-MacHelper::initializeMenus()
-{
- NSApplication *theNSApplication = [NSApplication sharedApplication];
-
- NSArray<NSMenuItem *> *menus = [theNSApplication mainMenu].itemArray;
- NSUInteger size = menus.count;
- for (NSUInteger i = 0; i < size; i++) {
- NSMenuItem *item = [menus objectAtIndex:i];
- [item setTitle:@"Edit"];
- }
-}
diff --git a/src/main.cpp b/src/main.cpp
index 7cc6e1d9..afb00229 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -31,10 +31,6 @@
#include "config/nheko.h"
#include "singleapplication.h"
-#if defined(Q_OS_MAC)
-#include "emoji/MacHelper.h"
-#endif
-
#if defined(GSTREAMER_AVAILABLE) && (defined(Q_OS_MAC) || defined(Q_OS_WINDOWS))
#include <QAbstractEventDispatcher>
#include <gst/gst.h>
@@ -343,12 +339,6 @@ main(int argc, char *argv[])
QDesktopServices::setUrlHandler(
QStringLiteral("matrix"), ChatPage::instance(), "handleMatrixUri");
-#if defined(Q_OS_MAC)
- // Temporary solution for the emoji picker until
- // nheko has a proper menu bar with more functionality.
- MacHelper::initializeMenus();
-#endif
-
nhlog::ui()->info("starting nheko {}", nheko::version);
return app.exec();