Created
May 21, 2012 21:43
-
-
Save NathanW2/2764906 to your computer and use it in GitHub Desktop.
QSettings
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/src/app/main.cpp b/src/app/main.cpp | |
index 3253a34..b202b46 100644 | |
--- a/src/app/main.cpp | |
+++ b/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 ); | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment