Guest User

Untitled

a guest
Nov 18th, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. commit 4da574283857472dccf5f614fada4c62bcefe580
  2. Author: Nathan Woodrow <woodrow.nathan@gmail.com>
  3. Date: Tue May 22 00:00:10 2012 +1000
  4.  
  5. Set the default format as INI when using custom settings path
  6.  
  7. diff --git a/src/app/main.cpp b/src/app/main.cpp
  8. index 3253a34..b202b46 100644
  9. --- a/src/app/main.cpp
  10. +++ b/src/app/main.cpp
  11. @@ -315,6 +315,7 @@ int main( int argc, char *argv[] )
  12. }
  13. else if ( i + 1 < argc && ( arg == "--optionspath" || arg == "-o" ) )
  14. {
  15. + QSettings::setDefaultFormat( QSettings::IniFormat );
  16. QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, argv[++i] );
  17. }
  18. else if ( i + 1 < argc && ( arg == "--configpath" || arg == "-c" ) )
  19. @@ -417,6 +418,7 @@ int main( int argc, char *argv[] )
  20. break;
  21.  
  22. case 'o':
  23. + QSettings::setDefaultFormat( QSettings::IniFormat );
  24. QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, optarg );
  25. break;
  26.  
  27. @@ -479,6 +481,7 @@ int main( int argc, char *argv[] )
  28. if ( !configpath.isEmpty() )
  29. {
  30. // tell QSettings to use INI format and save the file in custom config path
  31. + QSettings::setDefaultFormat( QSettings::IniFormat );
  32. QSettings::setPath( QSettings::IniFormat, QSettings::UserScope, configpath );
  33. }
Add Comment
Please, Sign In to add comment