migrate database paths to XDG user data directory #1

Merged
alisson merged 6 commits from fix/fix-data-location into master 2026-02-23 00:13:58 -03:00
Member

summary:

  • replace hardcoded build-time database paths (ZAP_DATABASE_PATH, PAPO_DATABASE_PATH) with a runtime DATA_DIR static that uses glib::user_data_dir(), following XDG Base Directory conventions
  • remove PKGDATADIR-based path constants from config.rs.in and inline path construction at call sites

motivation:
database paths were previously baked in at compile time via PKGDATADIR, tying them to the install prefix. this meant dev builds wrote to /home/user/.local/share/papo/ regardless of actual XDG config, and the paths couldn't adapt to different environments at runtime. using glib::user_data_dir() resolves this by respecting the user's XDG data directory.

summary: - replace hardcoded build-time database paths (ZAP_DATABASE_PATH, PAPO_DATABASE_PATH) with a runtime DATA_DIR static that uses glib::user_data_dir(), following XDG Base Directory conventions - remove PKGDATADIR-based path constants from config.rs.in and inline path construction at call sites motivation: database paths were previously baked in at compile time via PKGDATADIR, tying them to the install prefix. this meant dev builds wrote to /home/user/.local/share/papo/ regardless of actual XDG config, and the paths couldn't adapt to different environments at runtime. using glib::user_data_dir() resolves this by respecting the user's XDG data directory.
Adds glib crate to support user data directory queries
Replaces hardcoded database paths with glib::user_data_dir() for better cross-platform support

- Removes hardcoded paths from config

- Updates session client to use dynamic path

- Updates database store to use dynamic path
- alphabetize glib in Cargo.toml
- import PathBuf directly
- group static declarations together near the top of main.rs.
refactor: inline database path helpers and import DATA_DIR directly
Some checks are pending
CI / Rustfmt (pull_request) Waiting to run
CI / Flatpak (pull_request) Waiting to run
79013fb96a
removes zap_database_path() and papo_database_path() helper functions, inlining the path construction at call sites and importing DATA_DIR directly.
andrielfr 2026-02-22 10:24:03 -03:00
chore: restore cargo files
Some checks are pending
CI / Rustfmt (pull_request) Waiting to run
CI / Flatpak (pull_request) Waiting to run
e0c6b9d588
fix: ensure data directory is created on startup
Some checks are pending
CI / Rustfmt (pull_request) Waiting to run
CI / Flatpak (pull_request) Waiting to run
7f76a4c893
alisson approved these changes 2026-02-23 00:09:21 -03:00
alisson force-pushed fix/fix-data-location from 7f76a4c893
Some checks are pending
CI / Rustfmt (pull_request) Waiting to run
CI / Flatpak (pull_request) Waiting to run
to e8e72b9ebd
Some checks failed
CI / Rustfmt (pull_request) Has been cancelled
CI / Flatpak (pull_request) Has been cancelled
2026-02-23 00:12:42 -03:00
Compare
alisson merged commit c943a9ec5b into master 2026-02-23 00:13:58 -03:00
Sign in to join this conversation.
No reviewers
No milestone
No project
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
AmanoTeam/Papo!1
No description provided.