Skip to content
Permalink
Browse files

Merge pull request #6604 from 3nids/prefixpath

fix QgsApplication::setPrefixPath
  • Loading branch information
m-kuhn committed Apr 10, 2018
2 parents 405d8f2 + 810241f commit 1aa7bbc2853a2a8124f53b4e08671287fd929379
Showing with 21 additions and 18 deletions.
  1. +21 −18 src/core/qgsapplication.cpp
@@ -211,29 +211,32 @@ void QgsApplication::init( QString profileFolder )
char *prefixPath = getenv( "QGIS_PREFIX_PATH" );
if ( !prefixPath )
{
if ( ABISYM( mPrefixPath ).isNull() )
{
#if defined(Q_OS_MACX) || defined(Q_OS_WIN)
setPrefixPath( applicationDirPath(), true );
setPrefixPath( applicationDirPath(), true );
#elif defined(ANDROID)
// this is "/data/data/org.qgis.qgis" in android
QDir myDir( QDir::homePath() );
myDir.cdUp();
QString myPrefix = myDir.absolutePath();
setPrefixPath( myPrefix, true );
// this is "/data/data/org.qgis.qgis" in android
QDir myDir( QDir::homePath() );
myDir.cdUp();
QString myPrefix = myDir.absolutePath();
setPrefixPath( myPrefix, true );
#else
QDir myDir( applicationDirPath() );
// Fix for server which is one level deeper in /usr/lib/cgi-bin
if ( applicationDirPath().contains( QStringLiteral( "cgi-bin" ) ) )
QDir myDir( applicationDirPath() );
// Fix for server which is one level deeper in /usr/lib/cgi-bin
if ( applicationDirPath().contains( QStringLiteral( "cgi-bin" ) ) )
{
myDir.cdUp();
}
myDir.cdUp(); // Go from /usr/bin or /usr/lib (for server) to /usr
QString myPrefix = myDir.absolutePath();
setPrefixPath( myPrefix, true );
#endif
}
else
{
myDir.cdUp();
setPrefixPath( prefixPath, true );
}
myDir.cdUp(); // Go from /usr/bin or /usr/lib (for server) to /usr
QString myPrefix = myDir.absolutePath();
setPrefixPath( myPrefix, true );
#endif
}
else
{
setPrefixPath( prefixPath, true );
}
}

0 comments on commit 1aa7bbc

Please sign in to comment.
You can’t perform that action at this time.