Commit e85afc89 authored by Andrea Scarpino's avatar Andrea Scarpino

No need for the loop

parent 83ee79d1
......@@ -25,7 +25,6 @@
#include "newsmodel.h"
#include <QDebug>
#include <QEventLoop>
#include "item.h"
#include "hackernewsapi.h"
......@@ -102,10 +101,7 @@ void NewsModel::refresh(const int itemId)
{
api->getItem(itemId);
QEventLoop loop;
connect(api, &HackerNewsAPI::itemFetched, &loop, &QEventLoop::quit);
connect(api, &HackerNewsAPI::itemFetched, this, &NewsModel::onRefreshComments);
loop.exec();
}
void NewsModel::onRefreshComments(Item *item)
......
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