Comment 0 for bug 1241424

Revision history for this message
Michael Zanetti (mzanetti) wrote : [MainView] applicationName in QML is used wrong

MainView has a property applicationName which is set to QApplication::applicationName. The expected value is something like "com.ubuntu.developer.developerName.applicationName". However, the way this is intended to be used by Qt is to combine organisationName and applicationName.

This causes QSettings not to work in confined apps. It is still possible to make it work by doing this in C++:

QCoreApplication::setOrganizationName("com.ubuntu.developer.developerName.appName");
QCoreApplication::setApplicationName("appName");

Next problem is, that the store's automatic checks try to find the applicationName property in QML and if it's not present. I tried setting the applicationName in QML and again overwrite it in C++. This doesn't work. As soon as applicationName in QML is used, the organisationName is cleared and QSettings tries to store the config in

/home/user/.config/Unknown Organization/com.ubuntu.developer.developerName.appName.conf

This obviously breaks when running the app confined.

To solve this, organisationName should be supported in MainView and Ubuntu specific plugins like the LocalStorage should be adjusted to make use of organisationName AND applicationName just in the same way as Qt itself uses it.