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

QSettings initialization is not correct for QSettings::UserScope

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P3: Somewhat important
    • 4.8.6
    • 4.8.5
    • None
    • BlackBerry 10.2 Gold NDK
    • 7982a378c7058ca6b1ee29f5f5039cb62d2dcfd5

    Description

      QSettings works incorrectly if QSettings::UserScope is used. This was initially reported in QTBUG-37173. The sample code in QTBUG-37173 shows that if

      settings.setPath(QSettings::NativeFormat, QSettings::UserScope, QDir::homePath())

      the resulting actual settings file is set to:

      <APP_HOME>data/Settings/PUBLISHER/settingsTest.conf

      if the same call is made on another QSettings object in the same app, the same file is set to

      <APP_HOME>/data/PUBLISHER/settingsTest.conf

      which should be the same as for the first object, but it is not. Actually, even that is not fully correct either. The correct one should be

      <APP_HOME>/data/<APP_NAME>.conf

      where <APP_NAME> is QCoreApplication::applicationName(). The user might decide to set another path inside QDir::homePath(), QSettings has to follow accordingly.

      Additionally, the documentation does not mention this aspect at all:

      http://qt-project.org/doc/qt-4.8/qsettings.html

      This has be to correct as well.

      Please verify the Qt5 implementation of the same use case.

      Attachments

        Issue Links

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

          Activity

            People

              bweimer Bernd Weimer
              vminenko Vladimir Minenko
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes