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

flatpak: Use async API to search for already installed flatpakrefs

libflatpak will refuse to give us a ref if it's already installed, so we
want to rely on the installed db. At startup it might not be loaded yet,
so let's just call a function that will do the right thing at the right
time.

BUG: 436333
parent 2f443a0a
......@@ -427,9 +427,11 @@ void FlatpakBackend::addAppFromFlatpakRef(const QUrl &url, ResultsStream *stream
remoteRef = flatpak_installation_install_ref_file(preferredInstallation(), bytes, m_cancellable, &error);
if (!remoteRef) {
qWarning() << "Failed to create install ref file:" << error->message;
const auto resources = resourcesByAppstreamName(name);
stream->resourcesFound(resources);
stream->finish();
AbstractResourcesBackend::Filters filter;
filter.resourceUrl = QUrl(QLatin1String("appstream://") + name);
auto streamKnown = search(filter);
connect(streamKnown, &ResultsStream::resourcesFound, stream, &ResultsStream::resourcesFound);
connect(streamKnown, &ResultsStream::destroyed, stream, &ResultsStream::finish);
return;
}
}
......
Supports Markdown
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