Notify using a signal when a comic is updated using the http api

This commit is contained in:
Luis Ángel San Martín
2022-10-15 11:41:06 +02:00
parent bf36672ade
commit c576140e6a
4 changed files with 22 additions and 8 deletions

View File

@ -137,7 +137,10 @@ void YACReaderHttpServer::start(quint16 port)
testServer.close();
}
listener = new HttpListener(listenerSettings, new RequestMapper(app), app);
auto requestMapper = new RequestMapper(app);
listener = new HttpListener(listenerSettings, requestMapper, app);
connect(requestMapper, &RequestMapper::comicUpdated, this, &YACReaderHttpServer::comicUpdated);
if (listener->isListening()) {
qDebug("ServiceHelper: Service has started");
@ -158,7 +161,7 @@ void YACReaderHttpServer::stop()
}
YACReaderHttpServer::YACReaderHttpServer()
: listener(nullptr)
: QObject(nullptr), listener(nullptr)
{
}