diff options
author | Olivier Goffart <ogoffart@woboq.com> | 2017-09-20 11:14:48 +0300 |
---|---|---|
committer | Olivier Goffart <olivier@woboq.com> | 2017-09-21 15:05:39 +0300 |
commit | ff4213b59f223b60e87e70af2db6201986f76df8 (patch) | |
tree | 98398cd1a1014b9ef1c47457b9139ccf3a546ace /src/libsync/abstractnetworkjob.cpp | |
parent | c4e51247d833d4f08df7036fe4a7823a6f6e0ff6 (diff) |
Use the Qt5 connection syntax (automated with clazy)
This is motivated by the fact that QMetaObject::noralizeSignature takes 7.35%
CPU of the LargeSyncBench. (Mostly from ABstractNetworkJob::setupConnections and
PropagateUploadFileV1::startNextChunk). It could be fixed by using normalized
signature in the connection statement, but i tought it was a good oportunity
to modernize the code.
This commit only contains calls that were automatically converted with clazy.
Diffstat (limited to 'src/libsync/abstractnetworkjob.cpp')
-rw-r--r-- | src/libsync/abstractnetworkjob.cpp | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/libsync/abstractnetworkjob.cpp b/src/libsync/abstractnetworkjob.cpp index 14f8b1dda..41d61b307 100644 --- a/src/libsync/abstractnetworkjob.cpp +++ b/src/libsync/abstractnetworkjob.cpp @@ -52,15 +52,15 @@ AbstractNetworkJob::AbstractNetworkJob(AccountPtr account, const QString &path, { _timer.setSingleShot(true); _timer.setInterval(OwncloudPropagator::httpTimeout() * 1000); // default to 5 minutes. - connect(&_timer, SIGNAL(timeout()), this, SLOT(slotTimeout())); + connect(&_timer, &QTimer::timeout, this, &AbstractNetworkJob::slotTimeout); - connect(this, SIGNAL(networkActivity()), SLOT(resetTimeout())); + connect(this, &AbstractNetworkJob::networkActivity, this, &AbstractNetworkJob::resetTimeout); // Network activity on the propagator jobs (GET/PUT) keeps all requests alive. // This is a workaround for OC instances which only support one // parallel up and download if (_account) { - connect(_account.data(), SIGNAL(propagatorNetworkActivity()), SLOT(resetTimeout())); + connect(_account.data(), &Account::propagatorNetworkActivity, this, &AbstractNetworkJob::resetTimeout); } } @@ -103,13 +103,13 @@ void AbstractNetworkJob::setPath(const QString &path) void AbstractNetworkJob::setupConnections(QNetworkReply *reply) { - connect(reply, SIGNAL(finished()), SLOT(slotFinished())); - connect(reply, SIGNAL(encrypted()), SIGNAL(networkActivity())); - connect(reply->manager(), SIGNAL(proxyAuthenticationRequired(QNetworkProxy, QAuthenticator *)), SIGNAL(networkActivity())); - connect(reply, SIGNAL(sslErrors(QList<QSslError>)), SIGNAL(networkActivity())); - connect(reply, SIGNAL(metaDataChanged()), SIGNAL(networkActivity())); - connect(reply, SIGNAL(downloadProgress(qint64, qint64)), SIGNAL(networkActivity())); - connect(reply, SIGNAL(uploadProgress(qint64, qint64)), SIGNAL(networkActivity())); + connect(reply, &QNetworkReply::finished, this, &AbstractNetworkJob::slotFinished); + connect(reply, &QNetworkReply::encrypted, this, &AbstractNetworkJob::networkActivity); + connect(reply->manager(), &QNetworkAccessManager::proxyAuthenticationRequired, this, &AbstractNetworkJob::networkActivity); + connect(reply, &QNetworkReply::sslErrors, this, &AbstractNetworkJob::networkActivity); + connect(reply, &QNetworkReply::metaDataChanged, this, &AbstractNetworkJob::networkActivity); + connect(reply, &QNetworkReply::downloadProgress, this, &AbstractNetworkJob::networkActivity); + connect(reply, &QNetworkReply::uploadProgress, this, &AbstractNetworkJob::networkActivity); } QNetworkReply *AbstractNetworkJob::addTimer(QNetworkReply *reply) |