Anyone knows how to make SDK launch projects on the device in sandboxed mode? Because if I configure the project for Sailjail and the SDK launches it in non-sandboxed mode then the app doesn’t have access to any features protected with permissions (Contacts, call log, etc.). This makes testing and debugging very uncomfortable and annoying.
This might help other struggling with the issue.
With this example the app doesn’t need to know anything about being migrated, we just call this before initializing our QSettings instance.
This is not exactly the case. If the settings backend is a custom class that declares orgname and appname the settings from desktop (or main, for that matter) won’t apply.
It’s a bit sordid, but basically if the class delegated to handle settings for QML declares org and app in the global namespace it won’t jive with the desktop file.
To save you from navigating, if you do something init a settings class like:
It doesn’t because that path will be still outside of the sandbox using this, e.i. it will resolve to $XDG_CONFIG_HOME/org.foobar/foobarapp.conf.
But what @vige was saying that libsailffishapp will set the values from the desktop file to the QApplication object and thous all instances that the meta data in it like QSettings.
The issue is that the default path for QSettings lies outside of the sandbox.
PS: The organisation name doesn’t have to include the full url to your github page, its just org.name.
That get’s us .config/harbour-fahrplan2/fahrplan2.conf should, might still be visible in 4.4?
The solution here is? Looks like writing an ifdef for Sailjailed sailfish. Or?
As for the PS, I’m trying to render the only ‘authoritative’ original org there is. And that’s zanetti’s github repo. He’s merging PRs so that seemed like the logical orgname to me?
It can be accessed with the default profile, for the explicit profile the path in ~/.config/appname can be accessed if it already exists.
The issue lies here as I explained:
Same case as for all apps as I explained for your first case in this post. You can access the path in the default profile always and in the explicit profile only if it already exists.
It is not however you should move to one. In case the app had data from before having an explicit profile you can still access the data, you should just move the data to the new paths to it is same for old and new users.
On the basis of reading sailjail code, if we don’t define OrganizationName and ApplicationName in X-Sailjail section, the app can have the same storage arrangement as before. Manuals are not clear on whether it is intended or not. At the same time, I can still set permissions and those would be taken into account. Such .desktop file passes sfdk harbour check as well.
Is this considered as a feature which will stay or there is expected break for it in future?
PS: unless use_compatibility in daemon/sailjailclient.c is false - couldn’t decipher with a fast glance
i did copy over the databases. i can see that copy was successfull, but when app starts it says it is a fresh install
can it be that i have screwed the appname/pkname/orgname settings in main.cpp ?
as usual the issue was between the ears
but should appname contain the displayname or harbour-blba-bla ?
My go-to method is to clear up a test device (or emulator), make a new app installation with supposed old-and-new folder access settings, and see where the new datafile actually lands. It’s a bit more labor to do it that way, but it takes the guesswork off it
sql db works now, but config not
harbour-olive-goes-shopping.conf
[General]
categories=true
categorizeItems=true
categorizeShoppingList=true
migrated=true
[defaultuser@VollaPhone .config]$
you can see that migration did happen but the values are not loaded, nor are manual changes persisted ?
solution: the problem was not the path or appname but the usage of settings
i did copy it from somwhere years ago and it always creates an instance of setting, obviously with the default location which is now wrong
I was hoping the same as you at first glance, but there is a caveat : if the directories already exists under the before-sailjail-paths, then they are mounted inside the jail. So far so good, we keep the same behaviour. But you cannot create directories inside the jail that will be persistant. So, for all new users, their data are lost at each restart of the application.