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
+14
-1
@@ -96,6 +96,14 @@ public:
|
||||
StartResult updateAll();
|
||||
StartResult refresh();
|
||||
StartResult cleanCaches();
|
||||
// Installs the package a file describes — a Flatpak .flatpakref, .flatpakrepo
|
||||
// or .flatpak bundle dropped on the window or opened from the file manager
|
||||
// ("Ouvrir avec PacManager"). The provider owning the format is picked here,
|
||||
// so the view never names one.
|
||||
StartResult installFile(const QString& path);
|
||||
// Whether any available provider knows that file, so the window only accepts
|
||||
// drops it can act on.
|
||||
bool canInstallFile(const QString& path) const;
|
||||
// Bulk removal: one command per provider, run one provider at a time
|
||||
// (pacman locks its database for the whole operation).
|
||||
StartResult removePackages(const std::vector<PackageInfo>& packages,
|
||||
@@ -191,10 +199,15 @@ private:
|
||||
PackageInfo package;
|
||||
std::vector<PackageInfo> packages;
|
||||
QString description;
|
||||
// File a file-based request acts on (see installFile), kept apart from
|
||||
// `package.name`, which only carries the label for the UI and history.
|
||||
QString path;
|
||||
std::string pluginId;
|
||||
};
|
||||
|
||||
StartResult startRequest(const Request& request);
|
||||
// Taken by value: the label and the pending copy are filled in from the
|
||||
// request's contents once the target action is known.
|
||||
StartResult startRequest(Request request);
|
||||
StartResult startList(ListMode mode);
|
||||
StartResult startSearch(const QString& query);
|
||||
StartResult startAction(InstallWorker* worker, const Request& request,
|
||||
|
||||
Reference in new issue
Block a user