Skip to content

Commit

Permalink
Use Qt5 connect style
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick José Pereira <[email protected]>
  • Loading branch information
patrickelectric committed Jun 21, 2018
1 parent 0ee8973 commit acd1816
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
8 changes: 4 additions & 4 deletions src/FollowMe/FollowMe.cc
Original file line number Diff line number Diff line change
Expand Up @@ -84,19 +84,19 @@ 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();
}

void FollowMe::_disable()
{
disconnect(_toolbox->qgcPositionManager(),
SIGNAL(positionInfoUpdated(QGeoPositionInfo)),
&QGCPositionManager::positionInfoUpdated,
this,
SLOT(_setGPSLocation(QGeoPositionInfo)));
&FollowMe::_setGPSLocation);
_gcsMotionReportTimer.stop();
}

Expand Down
2 changes: 1 addition & 1 deletion src/QtLocationPlugin/QGeoCodeReplyQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand Down
4 changes: 2 additions & 2 deletions src/QtLocationPlugin/QGeoCodingManagerEngineQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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)));

Expand Down Expand Up @@ -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)));

Expand Down
2 changes: 1 addition & 1 deletion src/QtLocationPlugin/QGeoMapReplyQGC.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion src/qgcunittest/TCPLinkTest.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions src/qgcunittest/TCPLoopBackServer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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
}
Expand Down

0 comments on commit acd1816

Please sign in to comment.