Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
4.4.1
-
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.