Skip to content

Commit

Permalink
MacOS: Modify OS detection macro (FreeCAD#15924)
Browse files Browse the repository at this point in the history
* Fixes FreeCAD#15904
* MacOS: Always use Q_OS_MACOS to detect MacOS because the Conda builds do not define Q_OS_APPLE
  • Loading branch information
chennes authored Aug 18, 2024
1 parent 95c514f commit ff1409d
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Gui/Assistant.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)

Check warning on line 86 in src/Gui/Assistant.cpp

View workflow job for this annotation

GitHub Actions / Lint / Lint

Missing space after , [whitespace/comma] [3]
Expand Down
2 changes: 1 addition & 1 deletion src/Gui/PythonConsole.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions src/Gui/SoFCCSysDragger.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ TDragger::TDragger()
{
SO_KIT_CONSTRUCTOR(TDragger);

#if defined(Q_OS_APPLE)
#if defined(Q_OS_MACOS)
this->ref();
#endif

Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions src/Gui/ToolHandler.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit ff1409d

Please sign in to comment.