Commit f9cc7a4e authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧

Properly allocate streams

parent 92d656cd
......@@ -316,19 +316,13 @@ void AggregatedResultsStream::clear()
AggregatedResultsStream * ResourcesModel::findResourceByPackageName(const QUrl& search)
{
QSet<ResultsStream*> streams;
foreach(auto backend, m_backends) {
streams << backend->findResourceByPackageName(search);
}
auto streams = kTransform<QSet<ResultsStream*>>(m_backends, [search](AbstractResourcesBackend* backend){ return backend->findResourceByPackageName(search); });
return new AggregatedResultsStream(streams);
}
AggregatedResultsStream* ResourcesModel::search(const AbstractResourcesBackend::Filters& search)
{
QSet<ResultsStream*> streams;
foreach(auto backend, m_backends) {
streams << backend->search(search);
}
auto streams = kTransform<QSet<ResultsStream*>>(m_backends, [search](AbstractResourcesBackend* backend){ return backend->search(search); });
return new AggregatedResultsStream(streams);
}
......
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