Remove mac extras

This commit is contained in:
Nicolas Werner 2022-04-16 03:18:56 +02:00
parent da96558bb9
commit dadaa10b93
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
4 changed files with 1 additions and 62 deletions

View file

@ -219,10 +219,6 @@ else()
find_package(Qt6Keychain REQUIRED) find_package(Qt6Keychain REQUIRED)
endif() endif()
if (APPLE)
find_package(Qt6MacExtras REQUIRED)
endif(APPLE)
if (Qt5Widgets_FOUND) if (Qt5Widgets_FOUND)
if (Qt5Widgets_VERSION VERSION_LESS 5.15.0) if (Qt5Widgets_VERSION VERSION_LESS 5.15.0)
message(STATUS "Qt version ${Qt5Widgets_VERSION}") message(STATUS "Qt version ${Qt5Widgets_VERSION}")
@ -585,10 +581,6 @@ endif()
if (APPLE) if (APPLE)
set(CMAKE_EXE_LINKER_FLAGS "${CMAKE_EXE_LINKER_FLAGS} -framework Foundation -framework Cocoa -framework UserNotifications") 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) elseif (WIN32)
file(DOWNLOAD file(DOWNLOAD
"https://raw.githubusercontent.com/mohabouje/WinToast/41ed1c58d5dce0ee9c01dbdeac05be45358d4f57/src/wintoastlib.cpp" "https://raw.githubusercontent.com/mohabouje/WinToast/41ed1c58d5dce0ee9c01dbdeac05be45358d4f57/src/wintoastlib.cpp"
@ -752,9 +744,7 @@ if (NOT COMPILE_QML)
endif() endif()
if(APPLE) if(WIN32)
target_link_libraries (nheko PRIVATE Qt5::MacExtras)
elseif(WIN32)
target_compile_definitions(nheko PRIVATE WIN32_LEAN_AND_MEAN) target_compile_definitions(nheko PRIVATE WIN32_LEAN_AND_MEAN)
target_link_libraries (nheko PRIVATE ${NTDLIB} Qt5::WinMain) target_link_libraries (nheko PRIVATE ${NTDLIB} Qt5::WinMain)
if(MSVC) if(MSVC)

View file

@ -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();
};

View file

@ -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"];
}
}

View file

@ -31,10 +31,6 @@
#include "config/nheko.h" #include "config/nheko.h"
#include "singleapplication.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)) #if defined(GSTREAMER_AVAILABLE) && (defined(Q_OS_MAC) || defined(Q_OS_WINDOWS))
#include <QAbstractEventDispatcher> #include <QAbstractEventDispatcher>
#include <gst/gst.h> #include <gst/gst.h>
@ -343,12 +339,6 @@ main(int argc, char *argv[])
QDesktopServices::setUrlHandler( QDesktopServices::setUrlHandler(
QStringLiteral("matrix"), ChatPage::instance(), "handleMatrixUri"); 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); nhlog::ui()->info("starting nheko {}", nheko::version);
return app.exec(); return app.exec();