diff --git a/README.en.md b/README.en.md index e0c3896..661b0ee 100644 --- a/README.en.md +++ b/README.en.md @@ -19,8 +19,7 @@ package-manager/ ├── include/ │ ├── package-manager.h # Package manager interface (IPackageManager) │ ├── provider-plugin.h # C ABI contract for provider plugins -│ ├── pacman-manager.h # pacman manager (Arch Linux) -│ ├── flatpak-manager.h # Flatpak manager +│ ├── pacman-manager.h # pacman manager (Arch Linux, built-in) │ ├── plugin-manager.h # Provider registry + plugin loading │ ├── main-window.h # Main GUI │ ├── history-manager.h # Action history @@ -34,7 +33,8 @@ package-manager/ │ ├── history-manager.cpp │ └── package-model.cpp ├── plugins/ -│ └── example-provider/ # Example external plugin (template) +│ ├── example-provider/ # Example external plugin (template) +│ └── flatpak-provider/ # Flatpak plugin (loaded at runtime) ├── tests/ # Unit tests (assert, no Qt) └── resources/ ``` @@ -144,7 +144,7 @@ The interface uses **Qt6** with a dark theme, a **navigation sidebar** and stack ## Package managers (providers) -The `IPackageManager` interface (implemented by `PacmanManager` and `FlatpakManager`) defines: +The `IPackageManager` interface (implemented by the built-in `PacmanManager` and the Flatpak plugin) defines: | Method | Description | |--------|-------------| @@ -170,7 +170,7 @@ Search queries **all active providers at once**: every result shows its origin i ### Adding a provider (plugins) -Pacman and Flatpak are **built-in**. Flatpak installs auto-add the flathub remote when missing and fall back to a **per-user** install (no password) when the system-wide install fails (polkit, homonymous remotes) — the real error is shown on failure. An app installed via Flatpak appears immediately in the desktop launcher: its `.desktop` entries and icons are linked into `~/.local/share/applications` and `~/.local/share/icons` (the XDG dirs scanned by **every** environment: wofi, GNOME, KDE…), exactly like a pacman install, and are removed again on uninstall. Search shows the real status of each app (Installed / Update available). This is covered by an **integration test** that drives the real flatpak CLI (install, list, update, search, uninstall). To add another manager (apt, dnf, zypper, or another distro's repos) without touching the application: +**Pacman** is **built-in** (compiled into the application); **Flatpak** is an **external plugin** loaded at runtime from `plugins/` (`plugins/flatpak-provider`), next to the executable or in `~/.local/share/PacManager/plugins/`. Flatpak installs auto-add the flathub remote when missing and fall back to a **per-user** install (no password) when the system-wide install fails (polkit, homonymous remotes) — the real error is shown on failure. An app installed via Flatpak appears immediately in the desktop launcher: its `.desktop` entries and icons are linked into `~/.local/share/applications` and `~/.local/share/icons` (the XDG dirs scanned by **every** environment: wofi, GNOME, KDE…), exactly like a pacman install, and are removed again on uninstall. Search shows the real status of each app (Installed / Update available). This is covered by an **integration test** that drives the real flatpak CLI (install, list, update, search, uninstall). To add another manager (apt, dnf, zypper, or another distro's repos) without touching the application: 1. Implement `IPackageManager` in a `.cpp` file (copy `plugins/example-provider/example-provider.cpp` as a template). 2. Export the C ABI contract with the `FWS_PROVIDER_PLUGIN(MyManager, "id", "Name", "1.0.0", "Description", "Author")` macro. diff --git a/README.md b/README.md index 8aa839e..777a260 100644 --- a/README.md +++ b/README.md @@ -18,9 +18,7 @@ package-manager/ ├── CMakeLists.txt # Build root ├── include/ │ ├── package-manager.h # Interface du gestionnaire de paquets (IPackageManager) -│ ├── provider-plugin.h # Contrat C ABI des plugins fournisseurs -│ ├── pacman-manager.h # Gestionnaire pacman (Arch Linux) -│ ├── flatpak-manager.h # Gestionnaire Flatpak +│ ├── provider-plugin.h # Contrat C ABI des plugins fournisseurs│ ├── pacman-manager.h # Gestionnaire pacman (Arch Linux, intégré) │ ├── plugin-manager.h # Registre des fournisseurs + chargement des plugins │ ├── main-window.h # GUI principal │ ├── history-manager.h # Historique des actions @@ -34,7 +32,8 @@ package-manager/ │ ├── history-manager.cpp │ └── package-model.cpp ├── plugins/ -│ └── example-provider/ # Plugin externe d'exemple (modèle à copier) +│ ├── example-provider/ # Plugin externe d'exemple (modèle à copier) +│ └── flatpak-provider/ # Plugin Flatpak (chargé à l'exécution) ├── tests/ # Tests unitaires (assert, sans Qt) └── resources/ ``` @@ -170,7 +169,7 @@ La recherche interroge **tous les fournisseurs actifs à la fois** : chaque rés ### Ajouter un fournisseur (plugins) -Pacman et Flatpak sont **intégrés**. L'installation Flatpak ajoute automatiquement le dépôt flathub si besoin et retombe en installation **utilisateur** (sans mot de passe) quand l'installation système échoue (polkit, plusieurs dépôts homonymes) — l'erreur réelle est affichée en cas d'échec. Une app installée via Flatpak apparaît immédiatement dans le launcher du bureau : ses entrées `.desktop` et ses icônes sont liées dans `~/.local/share/applications` et `~/.local/share/icons` (les dossiers XDG scannés par **tout** environnement : wofi, GNOME, KDE…), exactement comme une installation pacman, et retirées à la désinstallation. La recherche affiche le statut réel de chaque app (Installé / Mise à jour disponible). Le tout est couvert par un **test d'intégration** qui pilote le vrai CLI flatpak (install, liste, mise à jour, recherche, désinstallation). Pour ajouter un autre gestionnaire (apt, dnf, zypper, ou les dépôts d'une autre distro) sans toucher à l'application : +**Pacman** est **intégré** (compilé dans l'application) ; **Flatpak** est un **plugin externe** chargé à l'exécution depuis `plugins/` (`plugins/flatpak-provider`), à côté de l'exécutable ou dans `~/.local/share/PacManager/plugins/`. L'installation Flatpak ajoute automatiquement le dépôt flathub si besoin et retombe en installation **utilisateur** (sans mot de passe) quand l'installation système échoue (polkit, plusieurs dépôts homonymes) — l'erreur réelle est affichée en cas d'échec. Une app installée via Flatpak apparaît immédiatement dans le launcher du bureau : ses entrées `.desktop` et ses icônes sont liées dans `~/.local/share/applications` et `~/.local/share/icons` (les dossiers XDG scannés par **tout** environnement : wofi, GNOME, KDE…), exactement comme une installation pacman, et retirées à la désinstallation. La recherche affiche le statut réel de chaque app (Installé / Mise à jour disponible). Le tout est couvert par un **test d'intégration** qui pilote le vrai CLI flatpak (install, liste, mise à jour, recherche, désinstallation). Pour ajouter un autre gestionnaire (apt, dnf, zypper, ou les dépôts d'une autre distro) sans toucher à l'application : 1. Implémentez `IPackageManager` dans un fichier `.cpp` (copiez `plugins/example-provider/example-provider.cpp` comme modèle). 2. Exportez le contrat C ABI avec la macro `FWS_PROVIDER_PLUGIN(MyManager, "id", "Nom", "1.0.0", "Description", "Auteur")`.