Import of pkgsrc-2016Q3

This commit is contained in:
2016-10-14 07:49:11 +02:00
committed by Lionel Sambuc
parent 9d819b6d54
commit 1242aa1e36
35952 changed files with 949749 additions and 377083 deletions

View File

@@ -1,15 +1,41 @@
$NetBSD: patch-src_core_qgsapplication.cpp,v 1.1 2012/02/26 23:19:02 adam Exp $
$NetBSD: patch-src_core_qgsapplication.cpp,v 1.2 2016/02/02 04:33:58 dbj Exp $
Use UNIX prefix path on Mac OS X.
Only assume we are running from a Mac OS application bundle
if the binary is in a directory ending in "/Contents/MacOS"
--- src/core/qgsapplication.cpp.orig 2012-02-26 22:09:01.000000000 +0000
--- src/core/qgsapplication.cpp.orig 2016-01-15 12:00:55.000000000 +0000
+++ src/core/qgsapplication.cpp
@@ -60,7 +60,7 @@ QString QgsApplication::mConfigPath = QD
QgsApplication::QgsApplication( int & argc, char ** argv, bool GUIenabled, QString customConfigPath )
: QApplication( argc, argv, GUIenabled )
@@ -159,8 +159,18 @@ void QgsApplication::init( QString custo
char *prefixPath = getenv( "QGIS_PREFIX_PATH" );
if ( !prefixPath )
{
-#if defined(Q_OS_MACX) || defined(Q_OS_WIN)
+#if defined(Q_OS_WIN)
setPrefixPath( applicationDirPath(), true );
+#elif defined(Q_OS_MACX)
+ QString myPrefix = applicationDirPath();
+ if ( myPrefix.endsWith( "/Contents/MacOS" ) ) {
+ setPrefixPath( myPrefix, true );
+ } else {
+ QDir myDir( applicationDirPath() );
+ myDir.cdUp();
+ myPrefix = myDir.absolutePath();
+ setPrefixPath( myPrefix, true );
+ }
#elif defined(ANDROID)
// this is "/data/data/org.qgis.qgis" in android
QDir myDir( QDir::homePath() );
@@ -577,7 +587,12 @@ QString QgsApplication::helpAppPath()
{
-#if defined(Q_WS_MACX) || defined(Q_WS_WIN32) || defined(WIN32)
+#if defined(Q_WS_WIN32) || defined(WIN32)
setPrefixPath( applicationDirPath(), true );
QString helpAppPath;
#ifdef Q_OS_MACX
- helpAppPath = applicationDirPath() + "/bin/qgis_help.app/Contents/MacOS";
+ helpAppPath = applicationDirPath();
+ if ( helpAppPath.endsWith( "/Contents/MacOS" ) ) {
+ helpAppPath += "/bin/qgis_help.app/Contents/MacOS";
+ } else {
+ helpAppPath = libexecPath();
+ }
#else
QDir myDir( applicationDirPath() );
helpAppPath = libexecPath();
#endif