feat(flatpak): install packages from a Flatpak file
Dragging a .flatpakref, .flatpakrepo or .flatpak onto the window, or opening it with the file manager, has to reach flatpak without the user going through a search. The provider now owns its formats: it claims the files it handles and builds the matching command, and the core routes the request to whichever provider recognises it, so a new provider can claim its own formats the same way. 🤖 Generated with Codebuff Co-Authored-By: Codebuff <noreply@codebuff.com>
This commit is contained in:
9 files changed
+381
-5
No files matched your search
@@ -185,6 +185,27 @@ public:
|
||||
return false;
|
||||
}
|
||||
|
||||
// ---- Installation from a file (optional) ----
|
||||
// Providers that can install a package straight from a file — the Flatpak
|
||||
// bundle formats, typically — override these, so the app can act on what
|
||||
// the user drops on the window or opens from the file manager ("Ouvrir
|
||||
// avec PacManager"). A provider only claims the formats it owns.
|
||||
|
||||
// Whether this provider understands that file (or URL).
|
||||
virtual bool canInstallFile(const std::string& path) const {
|
||||
(void)path;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Install the package the file describes. Returns false when the install
|
||||
// failed; the reason is then in lastError().
|
||||
virtual bool installFile(const std::string& path,
|
||||
ProgressCallback progressCallback = nullptr) {
|
||||
(void)path;
|
||||
(void)progressCallback;
|
||||
return false;
|
||||
}
|
||||
|
||||
// Check if the package manager is available on the system
|
||||
virtual bool isAvailable() const = 0;
|
||||
|
||||
|
||||
Reference in new issue
Block a user