From acd18168df3613a01ec8beb584388ac6816d0178 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Patrick=20Jos=C3=A9=20Pereira?= Date: Wed, 20 Jun 2018 00:35:32 -0300 Subject: [PATCH] Use Qt5 connect style MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Patrick José Pereira --- src/FollowMe/FollowMe.cc | 8 ++++---- src/QtLocationPlugin/QGeoCodeReplyQGC.cpp | 2 +- src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp | 4 ++-- src/QtLocationPlugin/QGeoMapReplyQGC.cpp | 2 +- src/qgcunittest/TCPLinkTest.cc | 2 +- src/qgcunittest/TCPLoopBackServer.cc | 4 ++-- 6 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/FollowMe/FollowMe.cc b/src/FollowMe/FollowMe.cc index e7f4593c1..750598980 100644 --- a/src/FollowMe/FollowMe.cc +++ b/src/FollowMe/FollowMe.cc @@ -84,9 +84,9 @@ void FollowMe::_settingsChanged() void FollowMe::_enable() { connect(_toolbox->qgcPositionManager(), - SIGNAL(positionInfoUpdated(QGeoPositionInfo)), + &QGCPositionManager::positionInfoUpdated, this, - SLOT(_setGPSLocation(QGeoPositionInfo))); + &FollowMe::_setGPSLocation); _gcsMotionReportTimer.setInterval(_toolbox->qgcPositionManager()->updateInterval()); _gcsMotionReportTimer.start(); } @@ -94,9 +94,9 @@ void FollowMe::_enable() void FollowMe::_disable() { disconnect(_toolbox->qgcPositionManager(), - SIGNAL(positionInfoUpdated(QGeoPositionInfo)), + &QGCPositionManager::positionInfoUpdated, this, - SLOT(_setGPSLocation(QGeoPositionInfo))); + &FollowMe::_setGPSLocation); _gcsMotionReportTimer.stop(); } diff --git a/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp b/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp index ff54955c7..546538f6e 100644 --- a/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp +++ b/src/QtLocationPlugin/QGeoCodeReplyQGC.cpp @@ -158,7 +158,7 @@ JasonMonger kMonger; QGeoCodeReplyQGC::QGeoCodeReplyQGC(QNetworkReply *reply, QObject *parent) : QGeoCodeReply(parent), m_reply(reply) { - connect(m_reply, SIGNAL(finished()), this, SLOT(networkReplyFinished())); + connect(m_reply, &QNetworkReply::finished, this, &QGeoCodeReplyQGC::networkReplyFinished); connect(m_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(networkReplyError(QNetworkReply::NetworkError))); diff --git a/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp b/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp index 2e3b6409f..f020c88b7 100644 --- a/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp +++ b/src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp @@ -125,7 +125,7 @@ QGeoCodeReply *QGeoCodingManagerEngineQGC::geocode(const QString &address, int l QGeoCodeReplyQGC *geocodeReply = new QGeoCodeReplyQGC(reply); - connect(geocodeReply, SIGNAL(finished()), this, SLOT(replyFinished())); + connect(geocodeReply, &QGeoCodeReply::finished, this, &QGeoCodingManagerEngineQGC::replyFinished); connect(geocodeReply, SIGNAL(error(QGeoCodeReply::Error,QString)), this, SLOT(replyError(QGeoCodeReply::Error,QString))); @@ -156,7 +156,7 @@ QGeoCodeReply *QGeoCodingManagerEngineQGC::reverseGeocode(const QGeoCoordinate & QGeoCodeReplyQGC *geocodeReply = new QGeoCodeReplyQGC(reply); - connect(geocodeReply, SIGNAL(finished()), this, SLOT(replyFinished())); + connect(geocodeReply, &QGeoCodeReply::finished, this, &QGeoCodingManagerEngineQGC::replyFinished); connect(geocodeReply, SIGNAL(error(QGeoCodeReply::Error,QString)), this, SLOT(replyError(QGeoCodeReply::Error,QString))); diff --git a/src/QtLocationPlugin/QGeoMapReplyQGC.cpp b/src/QtLocationPlugin/QGeoMapReplyQGC.cpp index eaee21fc0..31d9b1476 100644 --- a/src/QtLocationPlugin/QGeoMapReplyQGC.cpp +++ b/src/QtLocationPlugin/QGeoMapReplyQGC.cpp @@ -189,7 +189,7 @@ QGeoTiledMapReplyQGC::cacheError(QGCMapTask::TaskType type, QString /*errorStrin #endif _reply = _networkManager->get(_request); _reply->setParent(0); - connect(_reply, SIGNAL(finished()), this, SLOT(networkReplyFinished())); + connect(_reply, &QNetworkReply::finished, this, &QGeoTiledMapReplyQGC::networkReplyFinished); connect(_reply, SIGNAL(error(QNetworkReply::NetworkError)), this, SLOT(networkReplyError(QNetworkReply::NetworkError))); #if !defined(__mobile__) _networkManager->setProxy(proxy); diff --git a/src/qgcunittest/TCPLinkTest.cc b/src/qgcunittest/TCPLinkTest.cc index 996951eaf..92b5303c4 100644 --- a/src/qgcunittest/TCPLinkTest.cc +++ b/src/qgcunittest/TCPLinkTest.cc @@ -130,7 +130,7 @@ void TCPLinkTest::_connectSucceed_test(void) // We emit this signal such that it will be queued and run on the TCPLink thread. This in turn // allows the TCPLink object to pump the bytes through. - connect(this, SIGNAL(waitForBytesWritten(int)), _link, SLOT(waitForBytesWritten(int))); + connect(this, &TCPLinkTest::waitForBytesWritten, _link, &TCPLink::waitForBytesWritten); emit waitForBytesWritten(1000); // Check for loopback, both from signal received and actual bytes returned diff --git a/src/qgcunittest/TCPLoopBackServer.cc b/src/qgcunittest/TCPLoopBackServer.cc index f9183627d..b7e64e9bc 100644 --- a/src/qgcunittest/TCPLoopBackServer.cc +++ b/src/qgcunittest/TCPLoopBackServer.cc @@ -30,7 +30,7 @@ void TCPLoopBackServer::run(void) _tcpServer = new QTcpServer(this); Q_CHECK_PTR(_tcpServer); - bool connected = QObject::connect(_tcpServer, SIGNAL(newConnection()), this, SLOT(_newConnection())); + bool connected = QObject::connect(_tcpServer, &QTcpServer::newConnection, this, &TCPLoopBackServer::_newConnection); Q_ASSERT(connected); Q_UNUSED(connected); // Fix initialized-but-not-referenced warning on release builds @@ -45,7 +45,7 @@ void TCPLoopBackServer::_newConnection(void) Q_ASSERT(_tcpServer); _tcpSocket = _tcpServer->nextPendingConnection(); Q_ASSERT(_tcpSocket); - bool connected = QObject::connect(_tcpSocket, SIGNAL(readyRead()), this, SLOT(_readBytes())); + bool connected = QObject::connect(_tcpSocket, &QIODevice::readyRead, this, &TCPLoopBackServer::_readBytes); Q_ASSERT(connected); Q_UNUSED(connected); // Fix initialized-but-not-referenced warning on release builds } -- 2.22.0