User:Lukacu/Storage

The new organization of MyPaint storage directories
Freedesktop has a standard that specifies where the application data, configuration and cache files are stored. Since many applications decided to move to that standard, it would be sensible to do it for MyPaint too (better sooner than later). Unfortunately (as far as I know at least) the standard is only supported on Linux based OSes (and some BSDs I guess), everywhere else other mechanisms are used. On this page I would like to collect information about these conventions on Windows and OSX.

My idea is to offer to the application the following paths:
 * config: all .conf files
 * data: data files like backgrounds and brushes
 * cache: XDG standard specifies it, I am not sure if it is needed at the moment
 * locale: localization data

Linux et al. (XDG)

 * config: use $XDG_CONFIG_HOME if exists or ~/.config/mypaint as a default ($XDG_CONFIG_DIRS also specifies a hierarchy of less important directories for config, but I doubt we will need that)
 * data: a sequence of dirs - use $XDG_DATA_HOME if exists or ~/.local/share/mypaint as a default for user installed data. Use $XDG_DATA_DIRS hierarchy to search for bundled brushes and backgrounds.
 * cache: use $XDG_CACHE_HOME if exists or ~/.cache/mypaint as a default
 * locale: use data dirs to support also custom user-installed translations (apparently using multiple directories is not possible, so I suggest that we use the first data directory that has share/locale or po subdirectory)

Windows
Apparently application data is in C:\Documents and Settings\ \Local Settings\Application Data\ on XP and in C:\Users\ \AppData\Local\ on Vista. Do not know about Windows 7.
 * There sure is a Windows API to get that directory, no matter where it is and what the language? And most likely even a Python API? maxy 12:34, 20 December 2009 (UTC)
 * Well I will check it out but form my experience with Java API this things are (at least partially) ignored in the core API. If there is something in Windows API then perhaps we can integrate it in the binary executable. Lukacu 14:19, 20 December 2009 (UTC)


 * config: ?
 * data: ?
 * cache: ?
 * locale: ?

OSX
Application data is in ~/Library/Application Support/


 * config: ?
 * data: ?
 * cache: ?
 * locale: ?

Migration
To make the change as unnoticeable as possible, a migration routine will be written that will move all the data from the ~/.mypaint to new directories. For that to happen I have to know what files are currently residing in this directory structure.


 * ~/.mypaint/*.conf >> config
 * ~/.mypaint/brushes/*.conf >> config