[SailfishDevel] Sharing a common OfflineStorage DB between multiple Sailfish apps.

christopher.lamb at thurweb.ch christopher.lamb at thurweb.ch
Wed Jan 15 21:34:40 UTC 2014

Hi all

Is it possible to steer where a QML application stores its  
OfflineStorage Database?

I have a family of applications that share a common OfflineStorage  
Database. This works well on Harmattan, and on the early Sailfish  
Alphas without me having had to do anything special at all.

In the early Sailfish Alphas OfflineStorage DBs were stored in a  
common location, and thus could be easily shared.

Now on the real Jolla, I find that the standard DB storage location  
has changed, and DBs are now put in a subdirectory of the  
application's installation folder. e.g.


This means without some magic, Sailfish apps can no longer share DBs.

In C++ there is a property offlineStoragePath, and a setter method  


I might be able to use this to change the location of the DB, e.g to  
one of the Qt StandardLocations:


But setOfflineStoragePath() appears not to be directly available to QML.


So I guess I could call setOfflineStoragePath in each apps' main cpp file.

Or maybe I could even write a declarative plugin to expose  
setOfflineStoragepath to QML, but that is probably overkill as it  
would instantiate QQmlEngine - just t o set a path.

Or is there a better way? Are there any Harbour entry considerations  
to an app creating / accessing a DB somewhere other than in its own  



More information about the Devel mailing list