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:
BlackAngelTV committed 2026-09-27 19:39:39 +02:00
1 parent d44dbc3ccf
commit 1e751c7205
9 files changed
+381 -5

No files matched your search

+20
View File
@@ -53,6 +53,25 @@ void testInstallRefusesAMissingPackageName() {
assert(!core.hasPendingRequest());
}
void testFileInstallRefusesWhatNoProviderKnows() {
AppCore core;
// Only Flatpak files can be installed from a file; anything else is refused
// rather than silently ignored, and must not leave a request pending.
assert(!core.canInstallFile(QStringLiteral("/tmp/liste-de-courses.txt")));
assert(!core.canInstallFile(QString()));
const AppCore::StartResult result =
core.installFile(QStringLiteral("/tmp/liste-de-courses.txt"));
assert(!result.started);
assert(!result.error.isEmpty());
assert(!core.hasPendingRequest());
const AppCore::StartResult empty = core.installFile(QString());
assert(!empty.started);
assert(empty.error.contains("fichier"));
}
void testBulkRemovalRefusesAnEmptySelection() {
AppCore core;
const AppCore::StartResult result = core.removePackages({}, QStringLiteral("rien"));
@@ -193,6 +212,7 @@ int main(int argc, char* argv[]) {
testCoreDescribesTheSystem();
testSearchRefusesAnEmptyQuery();
testInstallRefusesAMissingPackageName();
testFileInstallRefusesWhatNoProviderKnows();
testBulkRemovalRefusesAnEmptySelection();
testPrivilegedActionAsksForThePasswordFirst();
testCredentialsStayInTheCore();