← Back to team overview

ubuntu-phone team mailing list archive

Re: Click packages and U1db.Database

 

On 08/22/2013 09:48 AM, Sam Segers wrote:
> Thanks
> 
> It's working now.
> It doesn't show up in the dash. Maybe after a reboot.
> I did have a problem that when making a click package, it includes the .git
> directory which it ofc souldn't. This has write protected files that click
> complains about when installing.
> 
> So about the database, does anyone know if an app gets a folder for storing
> data, or I must just pick one?
> 

Apps are allowed to write to their XDG basedirs. Eg, from the apparmor profile:
  owner @{HOME}/.cache/@{APP_PKGNAME}/                  rw,      # XDG_CACHE_HOME
  owner @{HOME}/.cache/@{APP_PKGNAME}/**                mrwkl,
  owner @{HOME}/.config/@{APP_PKGNAME}/                 rw,      # XDG_CONFIG_HOME
  owner @{HOME}/.config/@{APP_PKGNAME}/**               mrwkl,
  owner @{HOME}/.local/share/@{APP_PKGNAME}/            rw,      # XDG_DATA_HOME
  owner @{HOME}/.local/share/@{APP_PKGNAME}/**          mrwklix,

@{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.

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

Attachment: signature.asc
Description: OpenPGP digital signature


Follow ups

References