@@ -92,6 +92,7 @@ void usage( std::string const & appName )
92
92
<< " \t [--project projectfile]\t load the given QGIS project\n "
93
93
<< " \t [--extent xmin,ymin,xmax,ymax]\t set initial map extent\n "
94
94
<< " \t [--nologo]\t hide splash screen\n "
95
+ << " \t [--optionspath path]\t use the given QSettings path\n "
95
96
<< " \t [--help]\t\t this text\n\n "
96
97
<< " FILES:\n "
97
98
<< " Files specified on the command line can include rasters,\n "
@@ -303,13 +304,14 @@ int main( int argc, char *argv[] )
303
304
{" lang" , required_argument, 0 , ' l' },
304
305
{" project" , required_argument, 0 , ' p' },
305
306
{" extent" , required_argument, 0 , ' e' },
307
+ {" optionspath" , required_argument, 0 , ' o' },
306
308
{0 , 0 , 0 , 0 }
307
309
};
308
310
309
311
/* getopt_long stores the option index here. */
310
312
int option_index = 0 ;
311
313
312
- optionChar = getopt_long ( argc, argv, " swhlpe " ,
314
+ optionChar = getopt_long ( argc, argv, " swhlpeo " ,
313
315
long_options, &option_index );
314
316
315
317
/* Detect the end of the options. */
@@ -356,6 +358,10 @@ int main( int argc, char *argv[] )
356
358
myInitialExtent = optarg ;
357
359
break ;
358
360
361
+ case ' o' :
362
+ QSettings::setPath ( QSettings::NativeFormat, QSettings::UserScope, optarg );
363
+ break ;
364
+
359
365
case ' ?' :
360
366
usage ( argv[0 ] );
361
367
return 2 ; // XXX need standard exit codes
@@ -420,6 +426,10 @@ int main( int argc, char *argv[] )
420
426
{
421
427
myInitialExtent = argv[++i];
422
428
}
429
+ else if ( i + 1 < argc && ( arg == " --optionspath" || arg == " -o" ) )
430
+ {
431
+ QSettings::setPath ( QSettings::NativeFormat, QSettings::UserScope, argv[++i] );
432
+ }
423
433
else
424
434
{
425
435
myFileList.append ( QDir::convertSeparators ( QFileInfo ( QFile::decodeName ( argv[i] ) ).absoluteFilePath () ) );
0 commit comments