Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-63694

'general' settings section works incorrectly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • P3: Somewhat important
    • None
    • 5.9.1
    • Core: Other
    • None
    • Ubuntu 14.04

    Description

       
      If I set general/serviceMode key to 'true' using QSettings in this way:

      static const char * serviceModeKey = "general/serviceMode";
      
      QSettings qSettings(settingsFileName(), QSettings::IniFormat);
      
      bool val =  qSettings.value(serviceModeKey, false).value<bool>();
      
      bool other_val = true;
      
      qSettings.setValue(serviceModeKey, other_val);
      
      

      'general' section is duplicated, so settings file looks like this:

      [%General]
       serviceMode=true
      ...
      [%General]
       serviceMode=true
      ...
      

      and the value is false when the app starts next time.

      if I rename the key with 'app/serviceMode', for example, it seems to work fine.

      The fact that 'general' is prepended with % is not a bug, but normal behaviour, the bug it that it is duplicated and returns false.

       

      Attachments

        Issue Links

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              thiago Thiago Macieira
              dmitriano Dmitry Efimov
              Votes:
              2 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes