mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-25 12:38:48 +03:00
Use macos define everywhere
This commit is contained in:
parent
7b2d04cdd8
commit
eaea788a7f
3 changed files with 11 additions and 11 deletions
|
@ -98,7 +98,7 @@ MsgCountComposedIcon::pixmap(const QSize &size, QIcon::Mode mode, QIcon::State s
|
||||||
TrayIcon::TrayIcon(const QString &filename, QWindow *parent)
|
TrayIcon::TrayIcon(const QString &filename, QWindow *parent)
|
||||||
: QSystemTrayIcon(parent)
|
: QSystemTrayIcon(parent)
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_MAC) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
|
||||||
setIcon(QIcon(filename));
|
setIcon(QIcon(filename));
|
||||||
#else
|
#else
|
||||||
icon_ = new MsgCountComposedIcon(filename);
|
icon_ = new MsgCountComposedIcon(filename);
|
||||||
|
|
|
@ -465,7 +465,7 @@ class UserSettingsModel : public QAbstractListModel
|
||||||
Theme,
|
Theme,
|
||||||
MobileMode,
|
MobileMode,
|
||||||
DisableSwipe,
|
DisableSwipe,
|
||||||
#ifndef Q_OS_MAC
|
#ifndef Q_OS_MACOS
|
||||||
ScaleFactor,
|
ScaleFactor,
|
||||||
#endif
|
#endif
|
||||||
Font,
|
Font,
|
||||||
|
@ -551,7 +551,7 @@ class UserSettingsModel : public QAbstractListModel
|
||||||
COUNT,
|
COUNT,
|
||||||
// hidden for now
|
// hidden for now
|
||||||
AccessToken,
|
AccessToken,
|
||||||
#ifdef Q_OS_MAC
|
#ifdef Q_OS_MACOS
|
||||||
ScaleFactor,
|
ScaleFactor,
|
||||||
#endif
|
#endif
|
||||||
#ifndef NHEKO_DBUS_SYS
|
#ifndef NHEKO_DBUS_SYS
|
||||||
|
|
16
src/main.cpp
16
src/main.cpp
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
// in theory we can enable this everywhere, but the header is missing on some of our CI systems and
|
// in theory we can enable this everywhere, but the header is missing on some of our CI systems and
|
||||||
// it is too much effort to install.
|
// it is too much effort to install.
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
#include <QtGui/qpa/qplatformwindow_p.h>
|
#include <QtGui/qpa/qplatformwindow_p.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
||||||
#include "Utils.h"
|
#include "Utils.h"
|
||||||
#include "config/nheko.h"
|
#include "config/nheko.h"
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MACOS)
|
||||||
#include "emoji/MacHelper.h"
|
#include "emoji/MacHelper.h"
|
||||||
#include "notifications/Manager.h"
|
#include "notifications/Manager.h"
|
||||||
#endif
|
#endif
|
||||||
|
@ -114,7 +114,7 @@ registerSignalHandlers()
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if defined(GSTREAMER_AVAILABLE) && (defined(Q_OS_MAC) || defined(Q_OS_WINDOWS))
|
#if defined(GSTREAMER_AVAILABLE) && (defined(Q_OS_MACOS) || defined(Q_OS_WINDOWS))
|
||||||
GMainLoop *gloop = 0;
|
GMainLoop *gloop = 0;
|
||||||
GThread *gthread = 0;
|
GThread *gthread = 0;
|
||||||
|
|
||||||
|
@ -168,7 +168,7 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
// this needs to be after setting the application name. Or how would we find our settings
|
// this needs to be after setting the application name. Or how would we find our settings
|
||||||
// file then?
|
// file then?
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
if (qgetenv("QT_SCALE_FACTOR").size() == 0) {
|
if (qgetenv("QT_SCALE_FACTOR").size() == 0) {
|
||||||
float factor = utils::scaleFactor();
|
float factor = utils::scaleFactor();
|
||||||
|
|
||||||
|
@ -254,7 +254,7 @@ main(int argc, char *argv[])
|
||||||
if (!singleapp.isPrimaryInstance()) {
|
if (!singleapp.isPrimaryInstance()) {
|
||||||
auto token = qgetenv("XDG_ACTIVATION_TOKEN");
|
auto token = qgetenv("XDG_ACTIVATION_TOKEN");
|
||||||
|
|
||||||
#if defined(Q_OS_UNIX) && !defined(Q_OS_MAC)
|
#if defined(Q_OS_UNIX) && !defined(Q_OS_MACOS)
|
||||||
// getting a valid activation token on wayland is a bit of a pain, it works most reliably
|
// getting a valid activation token on wayland is a bit of a pain, it works most reliably
|
||||||
// when you have an actual window, that has the focus...
|
// when you have an actual window, that has the focus...
|
||||||
auto waylandApp = app.nativeInterface<QNativeInterface::QWaylandApplication>();
|
auto waylandApp = app.nativeInterface<QNativeInterface::QWaylandApplication>();
|
||||||
|
@ -304,7 +304,7 @@ main(int argc, char *argv[])
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#if !defined(Q_OS_MAC)
|
#if !defined(Q_OS_MACOS)
|
||||||
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("nheko"), QIcon{":/logos/nheko.png"}));
|
app.setWindowIcon(QIcon::fromTheme(QStringLiteral("nheko"), QIcon{":/logos/nheko.png"}));
|
||||||
#endif
|
#endif
|
||||||
#ifdef NHEKO_FLATPAK
|
#ifdef NHEKO_FLATPAK
|
||||||
|
@ -320,7 +320,7 @@ main(int argc, char *argv[])
|
||||||
|
|
||||||
registerSignalHandlers();
|
registerSignalHandlers();
|
||||||
|
|
||||||
#if defined(GSTREAMER_AVAILABLE) && (defined(Q_OS_MAC) || defined(Q_OS_WINDOWS))
|
#if defined(GSTREAMER_AVAILABLE) && (defined(Q_OS_MACOS) || defined(Q_OS_WINDOWS))
|
||||||
// If the version of Qt we're running in does not use GLib, we need to
|
// If the version of Qt we're running in does not use GLib, we need to
|
||||||
// start a GMainLoop so that gstreamer can dispatch events.
|
// start a GMainLoop so that gstreamer can dispatch events.
|
||||||
const QMetaObject *mo = QAbstractEventDispatcher::instance(qApp->thread())->metaObject();
|
const QMetaObject *mo = QAbstractEventDispatcher::instance(qApp->thread())->metaObject();
|
||||||
|
@ -469,7 +469,7 @@ main(int argc, char *argv[])
|
||||||
QDesktopServices::setUrlHandler(
|
QDesktopServices::setUrlHandler(
|
||||||
QStringLiteral("matrix"), ChatPage::instance(), "handleMatrixUri");
|
QStringLiteral("matrix"), ChatPage::instance(), "handleMatrixUri");
|
||||||
|
|
||||||
#if defined(Q_OS_MAC)
|
#if defined(Q_OS_MACOS)
|
||||||
// Temporary solution for the emoji picker until
|
// Temporary solution for the emoji picker until
|
||||||
// nheko has a proper menu bar with more functionality.
|
// nheko has a proper menu bar with more functionality.
|
||||||
MacHelper::initializeMenus();
|
MacHelper::initializeMenus();
|
||||||
|
|
Loading…
Reference in a new issue