← Back to team overview

ubuntu-phone team mailing list archive

Re: Click packages and U1db.Database

 

On 08/23/2013 12:59 AM, Alberto Mardegan wrote:
> 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
> 
Cool, I briefly looked at QStandardPaths but not being a long-time Qt developer,
wasn't sure I should recommend it, so I'm glad you did. Thanks!

I wonder, can we set the organization name via an env var? We could then set
that in our sandbox setup to make it even easier for people (of course, the app
would behave differently if it wasn't launched via the sandbox...).

-- 
Jamie Strandboge                 http://www.ubuntu.com/

Attachment: signature.asc
Description: OpenPGP digital signature


References