Skip to content

Commit

Permalink
fix deprecated Q_OS_MACX (#58987)
Browse files Browse the repository at this point in the history
  • Loading branch information
3nids authored Oct 7, 2024
1 parent d7985db commit 96855dc
Show file tree
Hide file tree
Showing 15 changed files with 25 additions and 25 deletions.
2 changes: 1 addition & 1 deletion src/app/layout/qgslayoutdesignerdialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@
#include <QPrintDialog>
#endif

#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
#include <ApplicationServices/ApplicationServices.h>
#endif

Expand Down
4 changes: 2 additions & 2 deletions src/app/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@
#include <getopt.h>
#endif

#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
#include <ApplicationServices/ApplicationServices.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
typedef SInt32 SRefCon;
Expand Down Expand Up @@ -1358,7 +1358,7 @@ int main( int argc, char *argv[] )
QgsCustomization::instance()->setSettings( customizationsettings );
QgsCustomization::instance()->loadDefault();

#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
if ( !getenv( "GDAL_DRIVER_PATH" ) )
{
// If the GDAL plugins are bundled with the application and GDAL_DRIVER_PATH
Expand Down
6 changes: 3 additions & 3 deletions src/app/pluginmanager/qgspluginmanager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@
// This doesn't work on windows and causes problems with plugins
// on OS X (the code doesn't cause a problem but including dlfcn.h
// renders plugins unloadable)
#if !defined(Q_OS_WIN) && !defined(Q_OS_MACX)
#if !defined(Q_OS_WIN) && !defined(Q_OS_MACOS)
#include <dlfcn.h>
#endif
#endif
Expand Down Expand Up @@ -385,7 +385,7 @@ void QgsPluginManager::getCppPluginsMetadata()
// This doesn't work on windows and causes problems with plugins
// on OS X (the code doesn't cause a problem but including dlfcn.h
// renders plugins unloadable)
#if !defined(Q_OS_WIN) && !defined(Q_OS_MACX)
#if !defined(Q_OS_WIN) && !defined(Q_OS_MACOS)
// test code to help debug loading problems
// This doesn't work on windows and causes problems with plugins
// on OS X (the code doesn't cause a problem but including dlfcn.h
Expand All @@ -403,7 +403,7 @@ void QgsPluginManager::getCppPluginsMetadata()
QgsDebugMsgLevel( "dlopen succeeded for " + lib, 2 );
dlclose( handle );
}
#endif //#ifndef Q_OS_WIN && Q_OS_MACX
#endif //#ifndef Q_OS_WIN && Q_OS_MACOS
#endif //#ifdef TESTLIB

QgsDebugMsgLevel( "Examining: " + lib, 2 );
Expand Down
4 changes: 2 additions & 2 deletions src/app/qgisapp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@
// Mac OS X Includes
// Must include before GEOS 3 due to unqualified use of 'Point'
//
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
#include <ApplicationServices/ApplicationServices.h>
#include "qgsmacnative.h"

Expand Down Expand Up @@ -13018,7 +13018,7 @@ void QgisApp::openURL( QString url, bool useQgisDocDirectory )
{
url = "file://" + QgsApplication::pkgDataPath() + "/doc/" + url;
}
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
/* Use Mac OS X Launch Services which uses the user's default browser
* and will just open a new window if that browser is already running.
* QProcess creates a new browser process for each invocation and expects a
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgsabout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
#include <QUrl>
#include <QRegularExpression>

#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
// Modeless dialog with close button only
constexpr Qt::WindowFlags kAboutWindowFlags = Qt::WindowSystemMenuHint;
#else
Expand Down
2 changes: 1 addition & 1 deletion src/app/qgscustomization.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ bool isInternalWidget( const QString &name )
return false;
}

#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent, QSettings *settings )
: QMainWindow( parent, Qt::WindowSystemMenuHint ) // Modeless dialog with close button only
#else
Expand Down
8 changes: 4 additions & 4 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -350,7 +350,7 @@ void QgsApplication::init( QString profileFolder )
{
if ( sPrefixPath()->isNull() )
{
#if defined(Q_OS_MACX) || defined(Q_OS_WIN)
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
setPrefixPath( applicationDirPath(), true );
#elif defined(ANDROID)
// this is "/data/data/org.qgis.qgis" in android
Expand Down Expand Up @@ -428,14 +428,14 @@ void QgsApplication::init( QString profileFolder )
// append local user-writable folder as a proj search path
QStringList currentProjSearchPaths = QgsProjUtils::searchPaths();
currentProjSearchPaths.append( qgisSettingsDirPath() + QStringLiteral( "proj" ) );
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
// append bundled proj lib for MacOS
QString projLib( QDir::cleanPath( pkgDataPath().append( "/proj" ) ) );
if ( QFile::exists( projLib ) )
{
currentProjSearchPaths.append( projLib );
}
#endif // Q_OS_MACX
#endif // Q_OS_MACOS

char **newPaths = new char *[currentProjSearchPaths.length()];
for ( int i = 0; i < currentProjSearchPaths.count(); ++i )
Expand Down Expand Up @@ -1007,7 +1007,7 @@ QString QgsApplication::resolvePkgPath()
prefixPath = dir.absolutePath();
#else

#if defined(Q_OS_MACX)
#if defined(Q_OS_MACOS)
prefixPath = appPath;
#elif defined(Q_OS_WIN)
prefixPath = appPath;
Expand Down
4 changes: 2 additions & 2 deletions src/gui/layertree/qgslayertreeviewdefaultactions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionCheckAndAllChildren( QObject *par
QgsLayerTreeNode *node = mView->currentNode();
if ( !node || !QgsLayerTree::isGroup( node ) || node->isItemVisibilityCheckedRecursive() )
return nullptr;
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
QAction *a = new QAction( tr( "Check and All its Children (⌘-click)" ), parent );
#else
QAction *a = new QAction( tr( "Check and All its Children (Ctrl-click)" ), parent );
Expand All @@ -195,7 +195,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionUncheckAndAllChildren( QObject *p
QgsLayerTreeNode *node = mView->currentNode();
if ( !node || !QgsLayerTree::isGroup( node ) || node->isItemVisibilityUncheckedRecursive() )
return nullptr;
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
QAction *a = new QAction( tr( "Uncheck and All its Children (⌘-click)" ), parent );
#else
QAction *a = new QAction( tr( "Uncheck and All its Children (Ctrl-click)" ), parent );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/locator/qgslocatorwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ QgsLocatorWidget::QgsLocatorWidget( QWidget *parent )
{
setObjectName( QStringLiteral( "LocatorWidget" ) );
mLineEdit->setShowClearButton( true );
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
mLineEdit->setPlaceholderText( tr( "Type to locate (⌘K)" ) );
#else
mLineEdit->setPlaceholderText( tr( "Type to locate (Ctrl+K)" ) );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsabstractdatasourcewidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ QgsBrowserModel *QgsAbstractDataSourceWidget::browserModel()
void QgsAbstractDataSourceWidget::setupButtons( QDialogButtonBox *buttonBox )
{
buttonBox->setStandardButtons( QDialogButtonBox::Apply | QDialogButtonBox::Close | QDialogButtonBox::Help );
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
buttonBox->setStyleSheet( "* { button-layout: 2 }" );
#endif
mAddButton = buttonBox->button( QDialogButtonBox::Apply );
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgsgui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
#include "qgsadvanceddigitizingtoolsregistry.h"
#include "qgscalloutsregistry.h"
#include "callouts/qgscalloutwidget.h"
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
#include "qgsmacnative.h"
#elif defined (Q_OS_WIN)
#ifndef __MINGW32__
Expand Down
2 changes: 1 addition & 1 deletion src/gui/qgspropertyoverridebutton.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ QgsPropertyOverrideButton::QgsPropertyOverrideButton( QWidget *parent,
setFocusPolicy( Qt::StrongFocus );

QString ss = QStringLiteral( "QgsPropertyOverrideButton { background: none; border: 1px solid rgba(0, 0, 0, 0%); } QgsPropertyOverrideButton:focus { border: 1px solid palette(highlight); }" );
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
ss += QLatin1String( "QgsPropertyOverrideButton::menu-indicator { width: 5px; }" );
#endif
setStyleSheet( ss );
Expand Down
2 changes: 1 addition & 1 deletion src/process/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
#include <getopt.h>
#endif

#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
#include <ApplicationServices/ApplicationServices.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
typedef SInt32 SRefCon;
Expand Down
2 changes: 1 addition & 1 deletion src/providers/grass/qgsgrass.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2691,7 +2691,7 @@ QString QgsGrass::defaultGisbase()
gisbase = shortPath( QCoreApplication::applicationDirPath() + ( QgsApplication::isRunningFromBuildDir() ? + "/.." : "" ) + "/grass" );
#endif
// Use the location specified by WITH_GRASS during configure
#elif defined(Q_OS_MACX)
#elif defined(Q_OS_MACOS)
// check for bundled GRASS, fall back to configured path
gisbase = QCoreApplication::applicationDirPath().append( "/grass" );
if ( !isValidGrassBaseDir( gisbase ) )
Expand Down
6 changes: 3 additions & 3 deletions tests/bench/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
#include <getopt.h>
#endif

#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
#include <ApplicationServices/ApplicationServices.h>
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
typedef SInt32 SRefCon;
Expand Down Expand Up @@ -391,7 +391,7 @@ int main( int argc, char *argv[] )

QgsProviderRegistry::instance( QgsApplication::pluginPath() );

#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
// If the GDAL plugins are bundled with the application and GDAL_DRIVER_PATH
// is not already defined, use the GDAL plugins in the application bundle.
QString gdalPlugins( QCoreApplication::applicationDirPath().append( "/lib/gdalplugins" ) );
Expand Down Expand Up @@ -429,7 +429,7 @@ int main( int argc, char *argv[] )
QCoreApplication::addLibraryPath( QApplication::applicationDirPath()
+ QDir::separator() + "qtplugins" );
#endif
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
//qDebug("Adding qt image plugins to plugin search path...");
CFURLRef myBundleRef = CFBundleCopyBundleURL( CFBundleGetMainBundle() );
CFStringRef myMacPath = CFURLCopyFileSystemPath( myBundleRef, kCFURLPOSIXPathStyle );
Expand Down

0 comments on commit 96855dc

Please sign in to comment.