Skip to content
Permalink
Browse files

fix #5894

  • Loading branch information
jef-n committed Aug 29, 2012
1 parent 2da8543 commit 7a929f1779c24c7756cd9b7cfff889e7121cd361
Showing with 15 additions and 6 deletions.
  1. +12 −6 src/app/main.cpp
  2. +3 −0 src/python/qgspythonutilsimpl.cpp
@@ -264,6 +264,7 @@ int main( int argc, char *argv[] )
// The user can specify a path which will override the default path of custom
// user settings (~/.qgis) and it will be used for QSettings INI file
QString configpath;
QString optionpath;

#if defined(ANDROID)
QgsDebugMsg( QString( "Android: All params stripped" ) );// Param %1" ).arg( argv[0] ) );
@@ -318,8 +319,7 @@ int main( int argc, char *argv[] )
}
else if ( i + 1 < argc && ( arg == "--optionspath" || arg == "-o" ) )
{
QSettings::setDefaultFormat( QSettings::IniFormat );
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, argv[++i] );
optionpath = argv[++i];
}
else if ( i + 1 < argc && ( arg == "--configpath" || arg == "-c" ) )
{
@@ -421,8 +421,7 @@ int main( int argc, char *argv[] )
break;

case 'o':
QSettings::setDefaultFormat( QSettings::IniFormat );
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, optarg );
optionspath = optarg;
break;

case 'c':
@@ -481,11 +480,11 @@ int main( int argc, char *argv[] )
exit( 1 ); //exit for now until a version of qgis is capabable of running non interactive
}

if ( !configpath.isEmpty() )
if ( !optionpath.isEmpty() || !configpath.isEmpty() )
{
// tell QSettings to use INI format and save the file in custom config path
QSettings::setDefaultFormat( QSettings::IniFormat );
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, configpath );
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, optionpath.isEmpty() ? configpath : optionpath );
}

// GUI customization is enabled by default unless --nocustomization argument is used
@@ -505,6 +504,13 @@ int main( int argc, char *argv[] )
QCoreApplication::setApplicationName( "QGIS" );
QCoreApplication::setAttribute( Qt::AA_DontShowIconsInMenus, false );

if ( !optionpath.isEmpty() || !configpath.isEmpty() )
{
// tell QSettings to use INI format and save the file in custom config path
QSettings::setDefaultFormat( QSettings::IniFormat );
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, optionpath.isEmpty() ? configpath : optionpath );
}

// Load and set possible default customization, must be done afterQgsApplication init and QSettings ( QCoreApplication ) init
QgsCustomization::instance()->loadDefault();

@@ -71,6 +71,9 @@ void QgsPythonUtilsImpl::initPython( QgisInterface* interface )
QStringList pluginpaths;
foreach ( QString p, extraPluginsPaths() )
{
#ifdef Q_OS_WIN
p = p.replace( '\\', "\\\\" );
#endif
pluginpaths << '"' + p + '"';
}
pluginpaths << homePluginsPath();

0 comments on commit 7a929f1

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