Open uninsane opened 10 months ago
Wike calculates its data paths in src/data.py
:
_data_path = GLib.get_user_data_dir()
class Languages:
items = {}
global _data_path
_file_path = _data_path + '/languages.json'
...
the docs for g_get_user_data_dir say
On UNIX platforms this is determined using the mechanisms described in the XDG Base Directory Specification. In this case the directory retrieved will be XDG_DATA_HOME.
the spec in turn says:
$XDG_DATA_HOME defines the base directory relative to which user specific data files should be stored. If $XDG_DATA_HOME is either not set or empty, a default equal to $HOME/.local/share should be used. "
it seems the desired behavior could be achieved with something like this (untested):
- _data_path = GLib.get_user_data_dir()
+ _data_path = os.path.join(GLib.get_user_data_dir(), "wike")
though that doesn't cover data migration for existing installs.
Thank you @uninsane
In flatpak this is not a problem since a data folder is created for each application. However, I suppose it would be better to fix it, but I have to make sure that user data is not lost when updating to the new version.
~/.local/share
.~/.local/share/wike
so that users can more easily manage their application data.repro:
ls ~/.local/share
wike
, and then close it once the UI loads.ls ~/.local/share
observe: several new files (booklists.json, bookmarks.json, ...) appear under
~/.local/share
and aren't clearly associated with any particular app, whereas other applications (cozy, dino, flare) place their files under a subdirectory so that it's clear which files belong to which apps.runtime info