feat(flatpak): let the user choose which installation to act on
The same application can be present twice — in the user installation and system-wide, or from two remotes or two branches — and flatpak then refuses to act on the application id alone: "Multiple installed refs match 'com.hoptodesk.HopToDesk'". Removing either copy was impossible from the app. A row now stands for the application and carries the copies it is made of, so the details panel lists them and Remove opens one checkbox per copy; the provider gets back the exact target it listed, and naming a ref plus its installation is what makes the call unambiguous. Update gains the same resolution, since it hit the very same refusal, and removing one copy of two no longer takes the other one's launcher entry away with it. The listing that feeds it now asks flatpak for the ref, the branch and the installation, and reads those columns by position: a branch installed from a subdirectory has no version, and dropping that empty column shifted every field after it.
This commit is contained in:
14 files changed
+559
-20
No files matched your search
@@ -92,6 +92,13 @@ public:
|
||||
// ---- Actions ----
|
||||
StartResult install(const PackageInfo& package);
|
||||
StartResult remove(const PackageInfo& package);
|
||||
// Removes only the installations the user picked, when the provider can
|
||||
// have several copies of the same application (flatpak: one in the user
|
||||
// installation and one system-wide, or two remotes or branches). The targets
|
||||
// are the ones the provider listed in PackageInfo::instances, so the core
|
||||
// never builds them; an empty list is the plain remove().
|
||||
StartResult removeInstances(const PackageInfo& package,
|
||||
const std::vector<std::string>& targets);
|
||||
StartResult update(const PackageInfo& package);
|
||||
StartResult updateAll();
|
||||
StartResult refresh();
|
||||
@@ -202,6 +209,13 @@ private:
|
||||
// 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;
|
||||
// The exact installation a request acts on, when the provider named one
|
||||
// (see removeInstances). Like `path`, it is what the provider is given
|
||||
// instead of the display label, which the UI and the history keep.
|
||||
QString target;
|
||||
// Several installations of the same application, acted on in one
|
||||
// operation (see removeInstances).
|
||||
std::vector<std::string> targets;
|
||||
std::string pluginId;
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user