mirror of
https://github.com/qgis/QGIS.git
synced 2025-10-09 00:08:52 -04:00
fix deprecated Q_OS_MACX (#58987)
This commit is contained in:
parent
d7985db12b
commit
96855dcb9f
@ -103,7 +103,7 @@
|
|||||||
#include <QPrintDialog>
|
#include <QPrintDialog>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -54,7 +54,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||||
typedef SInt32 SRefCon;
|
typedef SInt32 SRefCon;
|
||||||
@ -1358,7 +1358,7 @@ int main( int argc, char *argv[] )
|
|||||||
QgsCustomization::instance()->setSettings( customizationsettings );
|
QgsCustomization::instance()->setSettings( customizationsettings );
|
||||||
QgsCustomization::instance()->loadDefault();
|
QgsCustomization::instance()->loadDefault();
|
||||||
|
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
if ( !getenv( "GDAL_DRIVER_PATH" ) )
|
if ( !getenv( "GDAL_DRIVER_PATH" ) )
|
||||||
{
|
{
|
||||||
// If the GDAL plugins are bundled with the application and GDAL_DRIVER_PATH
|
// If the GDAL plugins are bundled with the application and GDAL_DRIVER_PATH
|
||||||
|
@ -61,7 +61,7 @@
|
|||||||
// This doesn't work on windows and causes problems with plugins
|
// 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
|
// on OS X (the code doesn't cause a problem but including dlfcn.h
|
||||||
// renders plugins unloadable)
|
// renders plugins unloadable)
|
||||||
#if !defined(Q_OS_WIN) && !defined(Q_OS_MACX)
|
#if !defined(Q_OS_WIN) && !defined(Q_OS_MACOS)
|
||||||
#include <dlfcn.h>
|
#include <dlfcn.h>
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
@ -385,7 +385,7 @@ void QgsPluginManager::getCppPluginsMetadata()
|
|||||||
// This doesn't work on windows and causes problems with plugins
|
// 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
|
// on OS X (the code doesn't cause a problem but including dlfcn.h
|
||||||
// renders plugins unloadable)
|
// 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
|
// test code to help debug loading problems
|
||||||
// This doesn't work on windows and causes problems with plugins
|
// 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
|
// 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 );
|
QgsDebugMsgLevel( "dlopen succeeded for " + lib, 2 );
|
||||||
dlclose( handle );
|
dlclose( handle );
|
||||||
}
|
}
|
||||||
#endif //#ifndef Q_OS_WIN && Q_OS_MACX
|
#endif //#ifndef Q_OS_WIN && Q_OS_MACOS
|
||||||
#endif //#ifdef TESTLIB
|
#endif //#ifdef TESTLIB
|
||||||
|
|
||||||
QgsDebugMsgLevel( "Examining: " + lib, 2 );
|
QgsDebugMsgLevel( "Examining: " + lib, 2 );
|
||||||
|
@ -182,7 +182,7 @@
|
|||||||
// Mac OS X Includes
|
// Mac OS X Includes
|
||||||
// Must include before GEOS 3 due to unqualified use of 'Point'
|
// Must include before GEOS 3 due to unqualified use of 'Point'
|
||||||
//
|
//
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
#include "qgsmacnative.h"
|
#include "qgsmacnative.h"
|
||||||
|
|
||||||
@ -13018,7 +13018,7 @@ void QgisApp::openURL( QString url, bool useQgisDocDirectory )
|
|||||||
{
|
{
|
||||||
url = "file://" + QgsApplication::pkgDataPath() + "/doc/" + url;
|
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
|
/* 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.
|
* 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
|
* QProcess creates a new browser process for each invocation and expects a
|
||||||
|
@ -30,7 +30,7 @@
|
|||||||
#include <QUrl>
|
#include <QUrl>
|
||||||
#include <QRegularExpression>
|
#include <QRegularExpression>
|
||||||
|
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
// Modeless dialog with close button only
|
// Modeless dialog with close button only
|
||||||
constexpr Qt::WindowFlags kAboutWindowFlags = Qt::WindowSystemMenuHint;
|
constexpr Qt::WindowFlags kAboutWindowFlags = Qt::WindowSystemMenuHint;
|
||||||
#else
|
#else
|
||||||
|
@ -52,7 +52,7 @@ bool isInternalWidget( const QString &name )
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent, QSettings *settings )
|
QgsCustomizationDialog::QgsCustomizationDialog( QWidget *parent, QSettings *settings )
|
||||||
: QMainWindow( parent, Qt::WindowSystemMenuHint ) // Modeless dialog with close button only
|
: QMainWindow( parent, Qt::WindowSystemMenuHint ) // Modeless dialog with close button only
|
||||||
#else
|
#else
|
||||||
|
@ -350,7 +350,7 @@ void QgsApplication::init( QString profileFolder )
|
|||||||
{
|
{
|
||||||
if ( sPrefixPath()->isNull() )
|
if ( sPrefixPath()->isNull() )
|
||||||
{
|
{
|
||||||
#if defined(Q_OS_MACX) || defined(Q_OS_WIN)
|
#if defined(Q_OS_MACOS) || defined(Q_OS_WIN)
|
||||||
setPrefixPath( applicationDirPath(), true );
|
setPrefixPath( applicationDirPath(), true );
|
||||||
#elif defined(ANDROID)
|
#elif defined(ANDROID)
|
||||||
// this is "/data/data/org.qgis.qgis" in 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
|
// append local user-writable folder as a proj search path
|
||||||
QStringList currentProjSearchPaths = QgsProjUtils::searchPaths();
|
QStringList currentProjSearchPaths = QgsProjUtils::searchPaths();
|
||||||
currentProjSearchPaths.append( qgisSettingsDirPath() + QStringLiteral( "proj" ) );
|
currentProjSearchPaths.append( qgisSettingsDirPath() + QStringLiteral( "proj" ) );
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
// append bundled proj lib for MacOS
|
// append bundled proj lib for MacOS
|
||||||
QString projLib( QDir::cleanPath( pkgDataPath().append( "/proj" ) ) );
|
QString projLib( QDir::cleanPath( pkgDataPath().append( "/proj" ) ) );
|
||||||
if ( QFile::exists( projLib ) )
|
if ( QFile::exists( projLib ) )
|
||||||
{
|
{
|
||||||
currentProjSearchPaths.append( projLib );
|
currentProjSearchPaths.append( projLib );
|
||||||
}
|
}
|
||||||
#endif // Q_OS_MACX
|
#endif // Q_OS_MACOS
|
||||||
|
|
||||||
char **newPaths = new char *[currentProjSearchPaths.length()];
|
char **newPaths = new char *[currentProjSearchPaths.length()];
|
||||||
for ( int i = 0; i < currentProjSearchPaths.count(); ++i )
|
for ( int i = 0; i < currentProjSearchPaths.count(); ++i )
|
||||||
@ -1007,7 +1007,7 @@ QString QgsApplication::resolvePkgPath()
|
|||||||
prefixPath = dir.absolutePath();
|
prefixPath = dir.absolutePath();
|
||||||
#else
|
#else
|
||||||
|
|
||||||
#if defined(Q_OS_MACX)
|
#if defined(Q_OS_MACOS)
|
||||||
prefixPath = appPath;
|
prefixPath = appPath;
|
||||||
#elif defined(Q_OS_WIN)
|
#elif defined(Q_OS_WIN)
|
||||||
prefixPath = appPath;
|
prefixPath = appPath;
|
||||||
|
@ -181,7 +181,7 @@ QAction *QgsLayerTreeViewDefaultActions::actionCheckAndAllChildren( QObject *par
|
|||||||
QgsLayerTreeNode *node = mView->currentNode();
|
QgsLayerTreeNode *node = mView->currentNode();
|
||||||
if ( !node || !QgsLayerTree::isGroup( node ) || node->isItemVisibilityCheckedRecursive() )
|
if ( !node || !QgsLayerTree::isGroup( node ) || node->isItemVisibilityCheckedRecursive() )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
QAction *a = new QAction( tr( "Check and All its Children (⌘-click)" ), parent );
|
QAction *a = new QAction( tr( "Check and All its Children (⌘-click)" ), parent );
|
||||||
#else
|
#else
|
||||||
QAction *a = new QAction( tr( "Check and All its Children (Ctrl-click)" ), parent );
|
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();
|
QgsLayerTreeNode *node = mView->currentNode();
|
||||||
if ( !node || !QgsLayerTree::isGroup( node ) || node->isItemVisibilityUncheckedRecursive() )
|
if ( !node || !QgsLayerTree::isGroup( node ) || node->isItemVisibilityUncheckedRecursive() )
|
||||||
return nullptr;
|
return nullptr;
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
QAction *a = new QAction( tr( "Uncheck and All its Children (⌘-click)" ), parent );
|
QAction *a = new QAction( tr( "Uncheck and All its Children (⌘-click)" ), parent );
|
||||||
#else
|
#else
|
||||||
QAction *a = new QAction( tr( "Uncheck and All its Children (Ctrl-click)" ), parent );
|
QAction *a = new QAction( tr( "Uncheck and All its Children (Ctrl-click)" ), parent );
|
||||||
|
@ -39,7 +39,7 @@ QgsLocatorWidget::QgsLocatorWidget( QWidget *parent )
|
|||||||
{
|
{
|
||||||
setObjectName( QStringLiteral( "LocatorWidget" ) );
|
setObjectName( QStringLiteral( "LocatorWidget" ) );
|
||||||
mLineEdit->setShowClearButton( true );
|
mLineEdit->setShowClearButton( true );
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
mLineEdit->setPlaceholderText( tr( "Type to locate (⌘K)" ) );
|
mLineEdit->setPlaceholderText( tr( "Type to locate (⌘K)" ) );
|
||||||
#else
|
#else
|
||||||
mLineEdit->setPlaceholderText( tr( "Type to locate (Ctrl+K)" ) );
|
mLineEdit->setPlaceholderText( tr( "Type to locate (Ctrl+K)" ) );
|
||||||
|
@ -38,7 +38,7 @@ QgsBrowserModel *QgsAbstractDataSourceWidget::browserModel()
|
|||||||
void QgsAbstractDataSourceWidget::setupButtons( QDialogButtonBox *buttonBox )
|
void QgsAbstractDataSourceWidget::setupButtons( QDialogButtonBox *buttonBox )
|
||||||
{
|
{
|
||||||
buttonBox->setStandardButtons( QDialogButtonBox::Apply | QDialogButtonBox::Close | QDialogButtonBox::Help );
|
buttonBox->setStandardButtons( QDialogButtonBox::Apply | QDialogButtonBox::Close | QDialogButtonBox::Help );
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
buttonBox->setStyleSheet( "* { button-layout: 2 }" );
|
buttonBox->setStyleSheet( "* { button-layout: 2 }" );
|
||||||
#endif
|
#endif
|
||||||
mAddButton = buttonBox->button( QDialogButtonBox::Apply );
|
mAddButton = buttonBox->button( QDialogButtonBox::Apply );
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
#include "qgsadvanceddigitizingtoolsregistry.h"
|
#include "qgsadvanceddigitizingtoolsregistry.h"
|
||||||
#include "qgscalloutsregistry.h"
|
#include "qgscalloutsregistry.h"
|
||||||
#include "callouts/qgscalloutwidget.h"
|
#include "callouts/qgscalloutwidget.h"
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
#include "qgsmacnative.h"
|
#include "qgsmacnative.h"
|
||||||
#elif defined (Q_OS_WIN)
|
#elif defined (Q_OS_WIN)
|
||||||
#ifndef __MINGW32__
|
#ifndef __MINGW32__
|
||||||
|
@ -43,7 +43,7 @@ QgsPropertyOverrideButton::QgsPropertyOverrideButton( QWidget *parent,
|
|||||||
setFocusPolicy( Qt::StrongFocus );
|
setFocusPolicy( Qt::StrongFocus );
|
||||||
|
|
||||||
QString ss = QStringLiteral( "QgsPropertyOverrideButton { background: none; border: 1px solid rgba(0, 0, 0, 0%); } QgsPropertyOverrideButton:focus { border: 1px solid palette(highlight); }" );
|
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; }" );
|
ss += QLatin1String( "QgsPropertyOverrideButton::menu-indicator { width: 5px; }" );
|
||||||
#endif
|
#endif
|
||||||
setStyleSheet( ss );
|
setStyleSheet( ss );
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||||
typedef SInt32 SRefCon;
|
typedef SInt32 SRefCon;
|
||||||
|
@ -2691,7 +2691,7 @@ QString QgsGrass::defaultGisbase()
|
|||||||
gisbase = shortPath( QCoreApplication::applicationDirPath() + ( QgsApplication::isRunningFromBuildDir() ? + "/.." : "" ) + "/grass" );
|
gisbase = shortPath( QCoreApplication::applicationDirPath() + ( QgsApplication::isRunningFromBuildDir() ? + "/.." : "" ) + "/grass" );
|
||||||
#endif
|
#endif
|
||||||
// Use the location specified by WITH_GRASS during configure
|
// 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
|
// check for bundled GRASS, fall back to configured path
|
||||||
gisbase = QCoreApplication::applicationDirPath().append( "/grass" );
|
gisbase = QCoreApplication::applicationDirPath().append( "/grass" );
|
||||||
if ( !isValidGrassBaseDir( gisbase ) )
|
if ( !isValidGrassBaseDir( gisbase ) )
|
||||||
|
@ -32,7 +32,7 @@
|
|||||||
#include <getopt.h>
|
#include <getopt.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
#include <ApplicationServices/ApplicationServices.h>
|
#include <ApplicationServices/ApplicationServices.h>
|
||||||
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
#if MAC_OS_X_VERSION_MAX_ALLOWED < 1050
|
||||||
typedef SInt32 SRefCon;
|
typedef SInt32 SRefCon;
|
||||||
@ -391,7 +391,7 @@ int main( int argc, char *argv[] )
|
|||||||
|
|
||||||
QgsProviderRegistry::instance( QgsApplication::pluginPath() );
|
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
|
// 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.
|
// is not already defined, use the GDAL plugins in the application bundle.
|
||||||
QString gdalPlugins( QCoreApplication::applicationDirPath().append( "/lib/gdalplugins" ) );
|
QString gdalPlugins( QCoreApplication::applicationDirPath().append( "/lib/gdalplugins" ) );
|
||||||
@ -429,7 +429,7 @@ int main( int argc, char *argv[] )
|
|||||||
QCoreApplication::addLibraryPath( QApplication::applicationDirPath()
|
QCoreApplication::addLibraryPath( QApplication::applicationDirPath()
|
||||||
+ QDir::separator() + "qtplugins" );
|
+ QDir::separator() + "qtplugins" );
|
||||||
#endif
|
#endif
|
||||||
#ifdef Q_OS_MACX
|
#ifdef Q_OS_MACOS
|
||||||
//qDebug("Adding qt image plugins to plugin search path...");
|
//qDebug("Adding qt image plugins to plugin search path...");
|
||||||
CFURLRef myBundleRef = CFBundleCopyBundleURL( CFBundleGetMainBundle() );
|
CFURLRef myBundleRef = CFBundleCopyBundleURL( CFBundleGetMainBundle() );
|
||||||
CFStringRef myMacPath = CFURLCopyFileSystemPath( myBundleRef, kCFURLPOSIXPathStyle );
|
CFStringRef myMacPath = CFURLCopyFileSystemPath( myBundleRef, kCFURLPOSIXPathStyle );
|
||||||
|
Loading…
x
Reference in New Issue
Block a user