Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 7f61173a authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

When we know the plugin is missing, offer it

BUG: 387844
parent 4e953e44
......@@ -64,6 +64,7 @@
#include <unistd.h>
#include <resources/StoredResultsStream.h>
#include <utils.h>
#include <QMimeDatabase>
class OurSortFilterProxyModel : public QSortFilterProxyModel, public QQmlParserStatus
{
......@@ -223,8 +224,15 @@ void DiscoverObject::openLocalPackage(const QUrl& localfile)
if (res) {
emit openApplicationInternal(res);
} else {
setRootObjectProperty("defaultStartup", true);
showPassiveNotification(i18n("Couldn't open %1", localfile.toDisplayString()));
QMimeDatabase db;
auto mime = db.mimeTypeForUrl(localfile);
if (mime.name().startsWith(QLatin1String("application/vnd.flatpak"))) {
openApplication(QUrl(QLatin1String("appstream://org.kde.discover.flatpak")));
showPassiveNotification(i18n("Cannot interact with flatpak resources without the flatpak backend %1. Please install it first.", localfile.toDisplayString()));
} else {
setRootObjectProperty("defaultStartup", true);
showPassiveNotification(i18n("Couldn't open %1", localfile.toDisplayString()));
}
}
}
, this);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment