Skip to content
Permalink
Browse files
Merge pull request #43381 from elpaso/bugfix-server-standalone-unrepo…
…rted-geopackage-projects

Server standalone: fix unreported project storage not supported with -p
  • Loading branch information
elpaso committed May 27, 2021
2 parents d922be7 + 545dcac commit 10c69b30ce88a7838c76e00493fec939e0e274eb
Showing with 3 additions and 3 deletions.
  1. +3 −3 src/server/qgis_mapserver.cpp
@@ -588,11 +588,13 @@ int main( int argc, char *argv[] )
qputenv( "QGIS_SERVER_LOG_LEVEL", logLevel.toUtf8() );
qputenv( "QGIS_SERVER_LOG_STDERR", "1" );

QgsServer server;

if ( ! parser.value( projectOption ).isEmpty( ) )
{
// Check it!
const QString projectFilePath { parser.value( projectOption ) };
if ( ! QFile::exists( projectFilePath ) )
if ( ! QgsProject::instance()->read( projectFilePath, QgsProject::ReadFlag::FlagDontResolveLayers | QgsProject::ReadFlag::FlagDontLoadLayouts | QgsProject::ReadFlag::FlagDontStoreOriginalStyles ) )
{
std::cout << QObject::tr( "Project file not found, the option will be ignored." ).toStdString() << std::endl;
}
@@ -606,8 +608,6 @@ int main( int argc, char *argv[] )
//qputenv( "QGIS_SERVER_PARALLEL_RENDERING", "0" );


QgsServer server;

#ifdef HAVE_SERVER_PYTHON_PLUGINS
server.initPython();
#endif

0 comments on commit 10c69b3

Please sign in to comment.