feat(plugins): replace the shop with drag-and-drop .fwspacm packages
The shop was a catalogue served over HTTP that the application fetched and listed, which put a network round trip between a user and a plugin that was almost always one file they already had. It also had to keep its catalogue URLs in step with every release, since an entry that pointed at a missing asset was indistinguishable from one that never worked. A plugin is now distributed as a .fwspacm package: a ZIP archive holding a plugin.json manifest and the shared library, which the user drops anywhere on the window. The file is the distribution, so there is no catalogue to publish, no network, and no catalogue URL setting to explain. The manifest tells the user what they are about to run, and its checksum is verified before anything is written, so a package whose library is not the one it declares never reaches the plugin directory. Qt exposes no public ZIP API, so the archive is read directly (central directory plus zlib for the deflated entries) rather than through a private header that could move between toolchains. The reader stays in the logic layer: app-core-test still links no QtWidgets, and a unit test builds its own archives to check both compression methods and every refusal path.
This commit is contained in:
29 files changed
+2105
-1046
No files matched your search
+10
-2
@@ -914,7 +914,7 @@ QStringList MainWindow::installableDroppedFiles(const QMimeData* mimeData) const
|
||||
// first, and a remote .flatpakref is better opened from a browser.
|
||||
if (!url.isLocalFile()) continue;
|
||||
const QString path = url.toLocalFile();
|
||||
if (m_core->canInstallFile(path)) files << path;
|
||||
if (m_core->canInstallFile(path) || m_core->isPluginPackage(path)) files << path;
|
||||
}
|
||||
return files;
|
||||
}
|
||||
@@ -958,6 +958,13 @@ void MainWindow::installLocalFiles(const QStringList& paths) {
|
||||
QStringList files;
|
||||
QStringList rejected;
|
||||
for (const QString& path : paths) {
|
||||
// A plugin package is installed by the core straight away: it needs no
|
||||
// provider, no password and no queue, and the registry is reloaded when
|
||||
// it lands (see AppCore::installPluginPackage).
|
||||
if (m_core->isPluginPackage(path)) {
|
||||
m_core->installPluginPackage(path);
|
||||
continue;
|
||||
}
|
||||
if (m_core->canInstallFile(path)) files << path;
|
||||
else rejected << path;
|
||||
}
|
||||
@@ -967,7 +974,8 @@ void MainWindow::installLocalFiles(const QStringList& paths) {
|
||||
if (!rejected.isEmpty()) {
|
||||
statusBar()->showMessage(
|
||||
QStringLiteral("%1 : format non reconnu (PacManager installe les fichiers "
|
||||
".flatpakref, .flatpakrepo et .flatpak).")
|
||||
".flatpakref, .flatpakrepo, .flatpak et les paquets de plugin "
|
||||
".fwspacm).")
|
||||
.arg(QFileInfo(rejected.first()).fileName()));
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user