From ff1409d8bf3622e4bcad11bb79184aa350f04f45 Mon Sep 17 00:00:00 2001 From: Chris Hennes Date: Sun, 18 Aug 2024 08:29:40 -0500 Subject: [PATCH] MacOS: Modify OS detection macro (#15924) * Fixes #15904 * MacOS: Always use Q_OS_MACOS to detect MacOS because the Conda builds do not define Q_OS_APPLE --- src/Gui/Assistant.cpp | 2 +- src/Gui/PythonConsole.cpp | 2 +- src/Gui/SoFCCSysDragger.cpp | 6 +++--- src/Gui/ToolHandler.cpp | 4 ++-- 4 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Gui/Assistant.cpp b/src/Gui/Assistant.cpp index 22558b8f5451..947d40c6c028 100644 --- a/src/Gui/Assistant.cpp +++ b/src/Gui/Assistant.cpp @@ -80,7 +80,7 @@ bool Assistant::startAssistant() QString app; app = QDir::toNativeSeparators(QString::fromStdString (App::Application::getHomePath()) + QLatin1String("bin/")); -#elif defined(Q_OS_APPLE) +#elif defined(Q_OS_MACOS) QString app = QCoreApplication::applicationDirPath() + QDir::separator(); #else #if QT_VERSION < QT_VERSION_CHECK(6,0,0) diff --git a/src/Gui/PythonConsole.cpp b/src/Gui/PythonConsole.cpp index b79e16506490..0722240e80cb 100644 --- a/src/Gui/PythonConsole.cpp +++ b/src/Gui/PythonConsole.cpp @@ -1264,7 +1264,7 @@ void PythonConsole::runSourceFromMimeData(const QString& source) #elif defined(Q_OS_WIN32) // Need to convert CRLF to LF text.replace(QLatin1String("\r\n"), QLatin1String("\n")); -#elif defined(Q_OS_APPLE) +#elif defined(Q_OS_MACOS) //need to convert CR to LF text.replace(QLatin1Char('\r'), QLatin1Char('\n')); #endif diff --git a/src/Gui/SoFCCSysDragger.cpp b/src/Gui/SoFCCSysDragger.cpp index 8bf56efb17ef..d057ea31bd43 100644 --- a/src/Gui/SoFCCSysDragger.cpp +++ b/src/Gui/SoFCCSysDragger.cpp @@ -96,7 +96,7 @@ TDragger::TDragger() { SO_KIT_CONSTRUCTOR(TDragger); -#if defined(Q_OS_APPLE) +#if defined(Q_OS_MACOS) this->ref(); #endif @@ -400,7 +400,7 @@ void TPlanarDragger::initClass() TPlanarDragger::TPlanarDragger() { SO_KIT_CONSTRUCTOR(TPlanarDragger); -#if defined(Q_OS_APPLE) +#if defined(Q_OS_MACOS) this->ref(); #endif @@ -698,7 +698,7 @@ void RDragger::initClass() RDragger::RDragger() { SO_KIT_CONSTRUCTOR(RDragger); -#if defined(Q_OS_APPLE) +#if defined(Q_OS_MACOS) this->ref(); #endif diff --git a/src/Gui/ToolHandler.cpp b/src/Gui/ToolHandler.cpp index 51c6d8f36fd0..bb20296449f7 100644 --- a/src/Gui/ToolHandler.cpp +++ b/src/Gui/ToolHandler.cpp @@ -123,7 +123,7 @@ void ToolHandler::setSvgCursor(const QString& cursorName, qreal defaultCursorSize = isRatioOne ? 64 : 32; qreal hotX = x; qreal hotY = y; -#if !defined(Q_OS_WIN32) && !defined(Q_OS_APPLE) +#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACOS) if (qGuiApp->platformName() == QLatin1String("xcb")) { hotX *= pRatio; hotY *= pRatio; @@ -157,7 +157,7 @@ void ToolHandler::setCursor(const QPixmap& p, int x, int y, bool autoScale) p1.setDevicePixelRatio(pRatio); qreal hotX = x; qreal hotY = y; -#if !defined(Q_OS_WIN32) && !defined(Q_OS_APPLE) +#if !defined(Q_OS_WIN32) && !defined(Q_OS_MACOS) if (qGuiApp->platformName() == QLatin1String("xcb")) { hotX *= pRatio; hotY *= pRatio;