← Back to team overview

ubuntu-phone team mailing list archive

Re: Click packages and U1db.Database

 

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 08/22/2013 07:33 PM, Jamie Strandboge wrote:
> @{APP_PKGNAME} is set to the "name" field in the manifest file. I'm
> not sure if there is a Qt API to give you the XDG_ paths, but
> upstart-app-launch will make sure that the XDG environment
> variables are set, so you can use 
> QProcessEnvironment::systemEnvironment() to query for them and then
> append "/<your app package name>" to what you find to have a
> writable directory.

The QStandardPaths::writableLocation() method should return exactly
what you need. The only thing to pay attention to, is that you'll have
to set your organization name to the click package name (using
QCoreApplication::setOrganizationName()).
note that for the .config location the organization name is not
appended, so you must take care of it yourself.
Having a look at the implementation will probably clarify how it works:

https://qt.gitorious.org/qt/qtbase/blobs/stable/src/corelib/io/qstandardpaths_unix.cpp#line59

Ciao,
  Alberto
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlIW+jwACgkQVLQegMXeCFJ2lACfRnpVoSAPyPG2zF4CrOFCrBRV
m+gAnR6sv5mkrRQZ0iJyGMnL//QXW5Ui
=yP83
-----END PGP SIGNATURE-----


Follow ups

References