Skip to content

Commit a2d857f

Browse files
committedJun 25, 2012
Set the default format as INI when using custom settings path
1 parent b6bf12a commit a2d857f

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed
 

‎src/app/main.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -315,6 +315,7 @@ int main( int argc, char *argv[] )
315315
}
316316
else if ( i + 1 < argc && ( arg == "--optionspath" || arg == "-o" ) )
317317
{
318+
QSettings::setDefaultFormat( QSettings::IniFormat );
318319
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, argv[++i] );
319320
}
320321
else if ( i + 1 < argc && ( arg == "--configpath" || arg == "-c" ) )
@@ -417,6 +418,7 @@ int main( int argc, char *argv[] )
417418
break;
418419

419420
case 'o':
421+
QSettings::setDefaultFormat( QSettings::IniFormat );
420422
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, optarg );
421423
break;
422424

@@ -479,6 +481,7 @@ int main( int argc, char *argv[] )
479481
if ( !configpath.isEmpty() )
480482
{
481483
// tell QSettings to use INI format and save the file in custom config path
484+
QSettings::setDefaultFormat( QSettings::IniFormat );
482485
QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, configpath );
483486
}
484487

0 commit comments

Comments
 (0)
Please sign in to comment.