Code refactoring - remove Q_OS_MAC (deprecated synonym for Q_OS_DARWIN)
(cherry picked from commit aff1649670aa5ba64f2927933a29c62b06fee21f)
This commit is contained in:
@@ -62,8 +62,7 @@ QVector<CaptureToolButton::ButtonType> ConfigHandler::getButtons()
|
||||
<< CaptureToolButton::TYPE_COPY << CaptureToolButton::TYPE_SAVE
|
||||
<< CaptureToolButton::TYPE_EXIT
|
||||
<< CaptureToolButton::TYPE_IMAGEUPLOADER
|
||||
#if not(defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
#if not(defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX))
|
||||
<< CaptureToolButton::TYPE_OPEN_APP
|
||||
#endif
|
||||
<< CaptureToolButton::TYPE_PIN << CaptureToolButton::TYPE_TEXT
|
||||
@@ -325,8 +324,7 @@ void ConfigHandler::setCheckForUpdates(const bool checkForUpdates)
|
||||
|
||||
bool ConfigHandler::startupLaunchValue()
|
||||
{
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX))
|
||||
bool res = false;
|
||||
#else
|
||||
bool res = true;
|
||||
@@ -365,8 +363,7 @@ void ConfigHandler::setStartupLaunch(const bool start)
|
||||
if (start == m_settings.value(QStringLiteral("startupLaunch")).toBool()) {
|
||||
return;
|
||||
}
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX))
|
||||
/* TODO - there should be more correct way via API, but didn't find it
|
||||
without extra dependencies, there should be something like that:
|
||||
https://stackoverflow.com/questions/3358410/programmatically-run-at-startup-on-mac-os-x
|
||||
|
||||
@@ -62,8 +62,7 @@ const QVector<QStringList>& ConfigShortcuts::captureShortcutsDefault(
|
||||
|
||||
m_shortcuts << (QStringList() << "" << QObject::tr("Quit capture")
|
||||
<< QKeySequence(Qt::Key_Escape).toString());
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX))
|
||||
m_shortcuts << (QStringList()
|
||||
<< "" << QObject::tr("Screenshot history") << "⇧⌘⌥H");
|
||||
m_shortcuts << (QStringList()
|
||||
@@ -132,8 +131,7 @@ const QKeySequence& ConfigShortcuts::captureShortcutDefault(
|
||||
case CaptureToolButton::ButtonType::TYPE_IMAGEUPLOADER:
|
||||
m_ks = QKeySequence(Qt::Key_Return);
|
||||
break;
|
||||
#if not(defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
#if not(defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX))
|
||||
case CaptureToolButton::ButtonType::TYPE_OPEN_APP:
|
||||
m_ks = QKeySequence(Qt::CTRL + Qt::Key_O);
|
||||
break;
|
||||
|
||||
@@ -39,8 +39,7 @@ ScreenGrabber::ScreenGrabber(QObject* parent)
|
||||
QPixmap ScreenGrabber::grabEntireDesktop(bool& ok)
|
||||
{
|
||||
ok = true;
|
||||
#if (defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX))
|
||||
#if (defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX))
|
||||
QScreen* currentScreen = QGuiAppCurrentScreen().currentScreen();
|
||||
QPixmap screenPixmap(
|
||||
currentScreen->grabWindow(QApplication::desktop()->winId(),
|
||||
|
||||
@@ -4,8 +4,8 @@
|
||||
#include <QApplication>
|
||||
#include <QUrl>
|
||||
|
||||
#if not(defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX) || defined(Q_OS_WIN))
|
||||
#if not(defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX) || \
|
||||
defined(Q_OS_WIN))
|
||||
#include <QDBusConnection>
|
||||
#include <QDBusInterface>
|
||||
#include <QDBusMessage>
|
||||
@@ -15,8 +15,8 @@ SystemNotification::SystemNotification(QObject* parent)
|
||||
: QObject(parent)
|
||||
, m_interface(nullptr)
|
||||
{
|
||||
#if not(defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX) || defined(Q_OS_WIN))
|
||||
#if not(defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX) || \
|
||||
defined(Q_OS_WIN))
|
||||
m_interface =
|
||||
new QDBusInterface(QStringLiteral("org.freedesktop.Notifications"),
|
||||
QStringLiteral("/org/freedesktop/Notifications"),
|
||||
@@ -41,8 +41,8 @@ void SystemNotification::sendMessage(const QString& text,
|
||||
return;
|
||||
}
|
||||
|
||||
#if defined(Q_OS_MAC) || defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || \
|
||||
defined(Q_OS_MACX) || defined(Q_OS_WIN)
|
||||
#if defined(Q_OS_MAC64) || defined(Q_OS_MACOS) || defined(Q_OS_MACX) || \
|
||||
defined(Q_OS_WIN)
|
||||
Controller::getInstance()->sendTrayNotification(text, title, timeout);
|
||||
#else
|
||||
QList<QVariant> args;
|
||||
|
||||
Reference in New Issue
Block a user