Skip to content
Permalink
Browse files

mapserver QGIS_OPTIONS_PATH support, fixes #10327

  • Loading branch information
blazek committed May 25, 2014
1 parent f57d406 commit d652a8099fc5c234eeb3b19e754d91e001f2f956
Showing with 23 additions and 3 deletions.
  1. +3 −3 src/app/main.cpp
  2. +4 −0 src/core/qgsapplication.cpp
  3. +3 −0 src/core/qgsapplication.h
  4. +13 −0 src/mapserver/qgis_map_serv.cpp
@@ -634,9 +634,9 @@ int main( int argc, char *argv[] )

//
// Set up the QSettings environment must be done after qapp is created
QCoreApplication::setOrganizationName( "QGIS" );
QCoreApplication::setOrganizationDomain( "qgis.org" );
QCoreApplication::setApplicationName( "QGIS2" );
QCoreApplication::setOrganizationName( QgsApplication::QGIS_ORGANIZATION_NAME );
QCoreApplication::setOrganizationDomain( QgsApplication::QGIS_ORGANIZATION_DOMAIN );
QCoreApplication::setApplicationName( QgsApplication::QGIS_APPLICATION_NAME );
QCoreApplication::setAttribute( Qt::AA_DontShowIconsInMenus, false );

QSettings* customizationsettings;
@@ -64,6 +64,10 @@ QString ABISYM( QgsApplication::mBuildOutputPath );
QStringList ABISYM( QgsApplication::mGdalSkipList );
int ABISYM( QgsApplication::mMaxThreads );

const char* QgsApplication::QGIS_ORGANIZATION_NAME = "QGIS";
const char* QgsApplication::QGIS_ORGANIZATION_DOMAIN = "qgis.org";
const char* QgsApplication::QGIS_APPLICATION_NAME = "QGIS2";

/*!
\class QgsApplication
\brief The QgsApplication class manages application-wide information.
@@ -35,6 +35,9 @@ class CORE_EXPORT QgsApplication : public QApplication
{
Q_OBJECT
public:
static const char* QGIS_ORGANIZATION_NAME;
static const char* QGIS_ORGANIZATION_DOMAIN;
static const char* QGIS_APPLICATION_NAME;
//! @note customConfigDir parameter added in v1.6
QgsApplication( int & argc, char ** argv, bool GUIenabled, QString customConfigPath = QString() );
virtual ~QgsApplication();
@@ -243,8 +243,20 @@ int main( int argc, char * argv[] )
qInstallMsgHandler( dummyMessageHandler );
#endif

QString optionsPath = getenv( "QGIS_OPTIONS_PATH" );
if ( !optionsPath.isEmpty() )
{
QgsDebugMsg( "Options PATH: " + optionsPath );
QSettings::setDefaultFormat( QSettings::IniFormat );
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, optionsPath );
}

QgsApplication qgsapp( argc, argv, getenv( "DISPLAY" ) );

QCoreApplication::setOrganizationName( QgsApplication::QGIS_ORGANIZATION_NAME );
QCoreApplication::setOrganizationDomain( QgsApplication::QGIS_ORGANIZATION_DOMAIN );
QCoreApplication::setApplicationName( QgsApplication::QGIS_APPLICATION_NAME );

//Default prefix path may be altered by environment variable
QgsApplication::init();
#if !defined(Q_OS_WIN)
@@ -267,6 +279,7 @@ int main( int argc, char * argv[] )
QgsDebugMsg( "Plugin PATH: " + QgsApplication::pluginPath() );
QgsDebugMsg( "PkgData PATH: " + QgsApplication::pkgDataPath() );
QgsDebugMsg( "User DB PATH: " + QgsApplication::qgisUserDbFilePath() );
QgsDebugMsg( "SVG PATHS: " + QgsApplication::svgPaths().join( ":" ) );

QgsDebugMsg( qgsapp.applicationDirPath() + "/qgis_wms_server.log" );
QgsApplication::createDB(); //init qgis.db (e.g. necessary for user crs)

0 comments on commit d652a80

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