Commit 2fb73cc1 authored by Laurent Montel's avatar Laurent Montel 😁
Browse files

USe new connect api

parent 5b60ead2
......@@ -256,7 +256,7 @@ void O1::link()
request.setHeader(QNetworkRequest::ContentTypeHeader, O2_MIME_TYPE_XFORM);
QNetworkReply *reply = manager_->post(request, QByteArray());
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onTokenRequestError(QNetworkReply::NetworkError)));
connect(reply, SIGNAL(finished()), this, SLOT(onTokenRequestFinished()));
connect(reply, &QNetworkReply::finished, this, &O1::onTokenRequestFinished);
}
void O1::onTokenRequestError(QNetworkReply::NetworkError error)
......@@ -341,7 +341,7 @@ void O1::exchangeToken()
request.setHeader(QNetworkRequest::ContentTypeHeader, O2_MIME_TYPE_XFORM);
QNetworkReply *reply = manager_->post(request, QByteArray());
connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(onTokenExchangeError(QNetworkReply::NetworkError)));
connect(reply, SIGNAL(finished()), this, SLOT(onTokenExchangeFinished()));
connect(reply, &QNetworkReply::finished, this, &O1::onTokenExchangeFinished);
}
void O1::onTokenExchangeError(QNetworkReply::NetworkError error)
......
......@@ -7,8 +7,8 @@ O1TimedReply::O1TimedReply(QNetworkReply *parent, int pTimeout): QTimer(parent)
{
setSingleShot(true);
setInterval(pTimeout);
connect(this, SIGNAL(timeout()), this, SLOT(onTimeout()));
connect(parent, SIGNAL(finished()), this, SLOT(onFinished()));
connect(this, &QTimer::timeout, this, &O1TimedReply::onTimeout);
connect(parent, &QNetworkReply::finished, this, &O1TimedReply::onFinished);
}
void O1TimedReply::onFinished()
......
......@@ -7,7 +7,7 @@ O2Reply::O2Reply(QNetworkReply *r, int timeOut, QObject *parent): QTimer(parent)
{
setSingleShot(true);
connect(this, SIGNAL(error(QNetworkReply::NetworkError)), reply, SIGNAL(error(QNetworkReply::NetworkError)), Qt::QueuedConnection);
connect(this, SIGNAL(timeout()), this, SLOT(onTimeOut()), Qt::QueuedConnection);
connect(this, &QTimer::timeout, this, &O2Reply::onTimeOut, Qt::QueuedConnection);
start(timeOut);
}
......
......@@ -15,15 +15,15 @@
O2ReplyServer::O2ReplyServer(QObject *parent): QTcpServer(parent)
{
connect(this, SIGNAL(newConnection()), this, SLOT(onIncomingConnection()));
connect(this, &QTcpServer::newConnection, this, &O2ReplyServer::onIncomingConnection);
replyContent_ = "<HTML></HTML>";
}
void O2ReplyServer::onIncomingConnection()
{
QTcpSocket *socket = nextPendingConnection();
connect(socket, SIGNAL(readyRead()), this, SLOT(onBytesReady()), Qt::UniqueConnection);
connect(socket, SIGNAL(disconnected()), socket, SLOT(deleteLater()));
connect(socket, &QIODevice::readyRead, this, &O2ReplyServer::onBytesReady, Qt::UniqueConnection);
connect(socket, &QAbstractSocket::disconnected, socket, &QObject::deleteLater);
}
void O2ReplyServer::onBytesReady()
......
Supports Markdown
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