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

'general' settings section works incorrectly

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Reported
    • Priority: P3: Somewhat important
    • Resolution: Unresolved
    • Affects Version/s: 5.9.1
    • Fix Version/s: None
    • Component/s: Core: Other
    • Labels:
      None
    • Environment:
      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

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

          Activity

            People

            • Assignee:
              thiago Thiago Macieira
              Reporter:
              dmitriano Dmitry Efimov
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:

                Gerrit Reviews

                There are no open Gerrit changes