fix deprecated Q_OS_MACX (#58987)

This commit is contained in:
Denis Rouzaud 2024-10-07 18:39:59 +02:00 committed by GitHub
parent d7985db12b
commit 96855dcb9f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
15 changed files with 25 additions and 25 deletions

View File

@ -103,7 +103,7 @@
#include <QPrintDialog>
#endif
#ifdef Q_OS_MACX
#ifdef Q_OS_MACOS
#include <ApplicationServices/ApplicationServices.h>
#endif

View File

@ -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;
@ -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

View File

@ -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
@ -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
@ -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 );

View File

@ -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"
@ -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

View File

@ -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

View File

@ -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

View File

@ -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
@ -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 )
@ -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;

View File

@ -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 );
@ -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 );

View File

@ -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)" ) );

View File

@ -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 );

View File

@ -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__

View File

@ -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 );

View File

@ -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;

View File

@ -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 ) )

View File

@ -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;
@ -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" ) );
@ -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 );