Changeset View
Changeset View
Standalone View
Standalone View
discover/DiscoverObject.cpp
Context not available. | |||||
65 | #include <unistd.h> | 65 | #include <unistd.h> | ||
---|---|---|---|---|---|
66 | #include <resources/StoredResultsStream.h> | 66 | #include <resources/StoredResultsStream.h> | ||
67 | #include <utils.h> | 67 | #include <utils.h> | ||
68 | #include <QMimeDatabase> | | |||
69 | 68 | | |||
70 | class OurSortFilterProxyModel : public QSortFilterProxyModel, public QQmlParserStatus | 69 | class OurSortFilterProxyModel : public QSortFilterProxyModel, public QQmlParserStatus | ||
71 | { | 70 | { | ||
Context not available. | |||||
225 | if (res) { | 224 | if (res) { | ||
226 | emit openApplicationInternal(res); | 225 | emit openApplicationInternal(res); | ||
227 | } else { | 226 | } else { | ||
228 | QMimeDatabase db; | 227 | setRootObjectProperty("defaultStartup", true); | ||
229 | auto mime = db.mimeTypeForUrl(localfile); | 228 | showPassiveNotification(i18n("Couldn't open %1", localfile.toDisplayString())); | ||
230 | if (mime.name().startsWith(QLatin1String("application/vnd.flatpak"))) { | | |||
231 | openApplication(QUrl(QLatin1String("appstream://org.kde.discover.flatpak"))); | | |||
232 | showPassiveNotification(i18n("Cannot interact with flatpak resources without the flatpak backend %1. Please install it first.", localfile.toDisplayString())); | | |||
233 | } else { | | |||
234 | setRootObjectProperty("defaultStartup", true); | | |||
235 | showPassiveNotification(i18n("Couldn't open %1", localfile.toDisplayString())); | | |||
236 | } | | |||
237 | } | 229 | } | ||
238 | } | 230 | } | ||
239 | , this); | 231 | , this); | ||
Context not available. |