Skip to content

Commit

Permalink
Merge pull request #6604 from 3nids/prefixpath
Browse files Browse the repository at this point in the history
fix QgsApplication::setPrefixPath
  • Loading branch information
m-kuhn authored Apr 10, 2018
2 parents 405d8f2 + 810241f commit 1aa7bbc
Showing 1 changed file with 21 additions and 18 deletions.
39 changes: 21 additions & 18 deletions src/core/qgsapplication.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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 );
}
}

Expand Down

0 comments on commit 1aa7bbc

Please sign in to comment.