Merge pull request #6502 from elpaso/bugfix-18230-server-prefix-path

[bugfix][server] Fix prefix path for server
This commit is contained in:
Alessandro Pasotti 2018-03-01 22:01:29 +01:00 committed by GitHub
commit baeaeace10
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -220,7 +220,12 @@ void QgsApplication::init( QString profileFolder )
setPrefixPath( myPrefix, true );
#else
QDir myDir( applicationDirPath() );
myDir.cdUp();
// 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