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
@@ -1,6 +1,8 @@
|
||||
#pragma once
|
||||
|
||||
#include <optional>
|
||||
#include <QString>
|
||||
#include <vector>
|
||||
|
||||
#include "page.h"
|
||||
|
||||
@@ -49,6 +51,10 @@ private:
|
||||
void populateTable(const std::vector<PackageInfo>& packages);
|
||||
void appendRows(const std::vector<PackageInfo>& packages);
|
||||
void addRow(int row, const PackageInfo& pkg);
|
||||
// Which installations of the selected package to remove, when the provider
|
||||
// holds it more than once. Empty when there is only one to remove, nothing
|
||||
// (std::nullopt) when the user cancels the chooser.
|
||||
std::optional<std::vector<std::string>> chooseInstancesToRemove();
|
||||
void updateDetails(const PackageInfo& pkg);
|
||||
void resetDetails();
|
||||
|
||||
@@ -84,5 +90,8 @@ private:
|
||||
QLabel* m_pkgRepo = nullptr;
|
||||
QLabel* m_pkgSize = nullptr;
|
||||
QLabel* m_pkgProvider = nullptr;
|
||||
// The copies a multi-installed package is made of, shown only when there is
|
||||
// more than one.
|
||||
QLabel* m_pkgInstances = nullptr;
|
||||
QLabel* m_pkgDescription = nullptr;
|
||||
};
|
||||
Reference in new issue
Block a user