Created
June 25, 2012 08:20
-
-
Save NathanW2/2987342 to your computer and use it in GitHub Desktop.
ini patch
This file contains hidden or 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
commit 4da574283857472dccf5f614fada4c62bcefe580 | |
Author: Nathan Woodrow <[email protected]> | |
Date: Tue May 22 00:00:10 2012 +1000 | |
Set the default format as INI when using custom settings path | |
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