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

Keep fetching while we query for resources

parent 3f98f6e8
......@@ -96,8 +96,11 @@ void FeaturedModel::setUris(const QVector<QUrl>& uris)
filter.resourceUrl = uri;
streams << backend->search(filter);
}
auto stream = new StoredResultsStream(streams);
connect(stream, &StoredResultsStream::finishedResources, this, &FeaturedModel::setResources);
if (!streams.isEmpty()) {
auto stream = new StoredResultsStream(streams);
acquireFetching(true);
connect(stream, &StoredResultsStream::finishedResources, this, &FeaturedModel::setResources);
}
}
static void filterDupes(QVector<AbstractResource *> &resources)
......@@ -135,14 +138,16 @@ void FeaturedModel::setResources(const QVector<AbstractResource *>& _resources)
auto resources = _resources;
filterDupes(resources);
if (m_resources == resources)
if (m_resources == resources) {
acquireFetching(false);
return;
}
//TODO: sort like in the json files
beginResetModel();
m_resources = resources;
endResetModel();
acquireFetching(false);
}
void FeaturedModel::removeResource(AbstractResource* resource)
......
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