Add --db and let the user choose where the database lives

- `kareer --db <path>` works for the GUI and every subcommand, before
  or after the subcommand name, and creates the file if missing. main()
  strips it from argv before CLI/GUI routing; every parser declares it
  so it shows in --help.
- Path precedence: --db > KAREER_DB_PATH > the location chosen in the
  GUI (kareerrc [Database] Path, read at startup for GUI and CLI alike)
  > $XDG_DATA_HOME/kareer/kareer.sqlite.
- First GUI run (nothing forced, no file yet, or the configured file
  has gone missing): DatabaseSetupDialog offers the default location, a
  folder of the user's choice, or an existing database used in place.
  Until then JobsDatabase opens nothing.
- Preferences gains a Database section: Move to... (copies, leaves the
  original), Open Existing..., Use Default Location. Refuses foreign
  SQLite files and unwritable ones.
- Models call JobsDatabase::reopenIfPathChanged() on refresh, so
  switching databases needs no restart.
- Link KF6::ConfigCore; add a QuickDialogs2 configure-time guard; add
  kconfig to the Arch dependencies and a note to the Flatpak manifest.
- README documents --db, the precedence, and the first-run choice, and
  gains Fedora 44 build dependencies; CONTRIBUTING gets a dev recipe.

Co-Authored-By: Claude Opus 5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01BxDf7HqD1xPnsZP8wt3NTk
This commit is contained in:
2026-09-11 15:42:00 -05:00
co-authored by Claude Opus 5
parent aa3a31f014
commit 260704cf9b
17 changed files with 790 additions and 16 deletions
+31 -4
View File
@@ -58,9 +58,23 @@ kareer stages
```
Run `kareer <command> --help` for the full option list of any
subcommand. Data lives in `$XDG_DATA_HOME/kareer/kareer.sqlite`
(under Flatpak, that's sandboxed to the app's own data directory); set
`KAREER_DB_PATH` to point at a different file.
subcommand.
### Where the data lives
On first launch the GUI asks where to keep the database: the default
location, a folder you choose (a synced folder, say), or an existing
`kareer.sqlite` you already have, used where it is. You can move or switch
it later under Preferences. The CLI uses the same file.
The database file is picked in this order:
1. `--db <path>` on the command line (GUI or any subcommand; the file is
created if it doesn't exist): `kareer --db ~/test.sqlite list`
2. The `KAREER_DB_PATH` environment variable
3. The location chosen in the GUI (stored in `kareerrc`)
4. `$XDG_DATA_HOME/kareer/kareer.sqlite` (under Flatpak, that's sandboxed to
the app's own data directory)
### Wiring up a resume-builder tool
@@ -110,10 +124,23 @@ CMake toolchain. On Arch/CachyOS:
```sh
sudo pacman -S --needed cmake ninja extra-cmake-modules base-devel \
qt6-base qt6-declarative vulkan-headers kirigami kirigami-addons \
ki18n kcoreaddons kiconthemes kcrash kitemmodels \
ki18n kconfig kcoreaddons kiconthemes kcrash kitemmodels \
kcolorscheme qqc2-desktop-style
```
On Fedora 44:
```sh
sudo dnf install cmake ninja-build extra-cmake-modules gcc-c++ \
qt6-qtbase-devel qt6-qtbase-private-devel \
qt6-qtdeclarative-devel qt6-qtquickcontrols2-devel \
vulkan-headers kf6-kirigami-devel \
kf6-kirigami-addons-devel kf6-ki18n-devel kf6-kcoreaddons-devel \
kf6-kconfig-devel \
kf6-kiconthemes-devel kf6-kcrash-devel kf6-kitemmodels-devel \
kf6-kcolorscheme-devel qqc2-desktop-style
```
Then:
```sh