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

QSettings should have also setOrganization domain

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • P3: Somewhat important
    • Some future release
    • 4.4.1
    • Core: Plugins
    • None

    Description

      Condider the case where a plugin developer wants to use QSettings to store application settings on MacOS and they use a QSettings object.

      They pass in the plugin name and company to the constructor of the QSettings object with the intention of reading some settings.

      This does not work as expected, because the developer of the host application set QCoreApplication::setOrganizationDomain which overwrites the filename set in any QSettings object in the whole application (On Mac OS).

      This prevents the plugin to access its own config files because it is not possible to overwrite that domain when creating an own QSettings object.

      So there is a problem in the API because the behaviour is highly different on Mac OS than on any other plattform. On all other plattforms, QCoreApplication::organizationDomain is not used.

      It would be nice if QSettings also had setOrganizationDomain so this was not a problem for plugin developers.

      Note: Developers can call setOrganizationDomain themselves. You can pass your domain as part of the organization name and QSettings will do the right thing (it shouldn't grap the domain from the application). It's probably not a good idea to just specify a QSettings object for a plugin without explictly passing the correct information.

      Attachments

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

        Activity

          People

            biochimia João Abecasis
            dettman Dean Dettman (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes