Commit 9c694b41 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

flatpak: Support querying by mimetype

BUG: 433291
parent 039887c7
......@@ -1192,6 +1192,9 @@ ResultsStream * FlatpakBackend::search(const AbstractResourcesBackend::Filters &
if (!filter.extends.isEmpty() && !r->extends().contains(filter.extends))
continue;
if (!filter.mimetype.isEmpty() && !r->mimetypes().contains(filter.mimetype))
continue;
if (filter.search.isEmpty() || r->name().contains(filter.search, Qt::CaseInsensitive) || r->comment().contains(filter.search, Qt::CaseInsensitive) || matchById)
{
ret += r;
......
......@@ -588,3 +588,8 @@ QSet<QString> FlatpakResource::alternativeAppstreamIds() const
return QSet<QString>(ret.begin(), ret.end());
}
QStringList FlatpakResource::mimetypes() const
{
return m_appdata.provided(AppStream::Provided::KindMimetype).items();
}
......@@ -125,6 +125,7 @@ public:
void fetchChangelog() override;
void fetchScreenshots() override;
QSet<QString> alternativeAppstreamIds() const override;
QStringList mimetypes() const override;
void setBranch(const QString &branch);
void setBundledIcon(const QPixmap &pixmap);
......
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