Skip to content
Permalink
Browse files

Set the default format as INI when using custom settings path

  • Loading branch information
NathanW2 committed Jun 25, 2012
1 parent b6bf12a commit a2d857fd9348862bd8a0f16d1ba68382b52ab50c
Showing with 3 additions and 0 deletions.
  1. +3 −0 src/app/main.cpp
@@ -315,6 +315,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] );
}
else if ( i + 1 < argc && ( arg == "--configpath" || arg == "-c" ) )
@@ -417,6 +418,7 @@ int main( int argc, char *argv[] )
break;

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

@@ -479,6 +481,7 @@ int main( int argc, char *argv[] )
if ( !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 );
}

0 comments on commit a2d857f

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