Verified Commit 8e9709ca authored by Daniel Vrátil's avatar Daniel Vrátil 🤖
Browse files

Fix build against Qt < 5.14

parent f3c1ec7c
......@@ -215,10 +215,11 @@ static bool hasAllParts(const ItemRetrievalRequest &req, const QSet<QByteArray>
bool ItemRetriever::runItemRetrievalRequests(std::list<ItemRetrievalRequest> requests)
{
QEventLoop eventLoop;
QVector<ItemRetrievalRequest::Id> pendingRequests;
std::vector<ItemRetrievalRequest::Id> pendingRequests;
connect(&mItemRetrievalManager, &ItemRetrievalManager::requestFinished,
this, [this, &eventLoop, &pendingRequests](const ItemRetrievalResult &result) {
if (pendingRequests.contains(result.request.id)) {
const auto requestId = std::find(pendingRequests.begin(), pendingRequests.end(), result.request.id);
if (requestId != pendingRequests.end()) {
if (mCanceled) {
eventLoop.exit(1);
} else if (result.errorMsg.has_value()) {
......@@ -226,7 +227,7 @@ bool ItemRetriever::runItemRetrievalRequests(std::list<ItemRetrievalRequest> req
eventLoop.exit(1);
} else {
Q_EMIT itemsRetrieved(result.request.ids);
pendingRequests.removeOne(result.request.id);
pendingRequests.erase(requestId);
if (pendingRequests.empty()) {
eventLoop.quit();
}
......
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