feat(files): confirm dropped files and refuse the ones already installed

A drop — or "Ouvrir avec PacManager" — answered nothing: a Flatpak
install walked off into the background and a plugin package landed
without a sound, so the gesture read as ignored. Both now open a
dialog saying what was taken and what it starts.

A file the machine already has is refused before anything runs, and
named. The application a file would install is read out of the file
itself (the [Flatpak Ref] section of a .flatpakref, the header of a
.flatpak bundle, the manifest of a .fwspacm) and compared with what
the provider has, so nothing is started to find out: Flatpak would
otherwise skip the install and report a success the user never got,
and a plugin package would silently replace the one in place.
This commit is contained in:
BlackAngelTV committed 2026-10-09 19:22:24 +02:00
1 parent f4aa661b54
commit 55718064a6
16 files changed
+557 -9

No files matched your search

+9 -1
View File
@@ -58,7 +58,9 @@ public:
// Installs the Flatpak files handed over by the desktop: dropped on the
// window, or opened from the file manager ("Ouvrir avec PacManager", which
// passes them on the command line). One install runs at a time; the rest
// wait in line. Paths the core does not recognise are reported and skipped.
// wait in line. Paths the core does not recognise are reported and skipped,
// a file the machine already has is refused, and both answers are told to
// the user in a dialog — the gesture is the only thing they see.
void installLocalFiles(const QStringList& paths);
protected:
@@ -174,6 +176,12 @@ private:
// Takes the next queued file and asks the core to install it. A core busy
// with another operation leaves it queued: onCoreActionFinished calls back.
void startNextFileInstall();
// What the user is told about the files just handed over: which ones were
// taken (and what each of them starts), and which ones were refused because
// the machine already has them. Two dialogs, since the two answers ask for
// different things from the user.
void announceAcceptedFiles(const QStringList& installing, const QStringList& plugins);
void announceInstalledFiles(const QStringList& packages, const QStringList& plugins);
// Logic layer: it owns the providers, the workers, the history, the
// credentials and the self-updater. The frame never talks to them directly.