diff options
author | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-06-10 15:35:33 +0200 |
---|---|---|
committer | Kai Koehne <kai.koehne@theqtcompany.com> | 2015-06-15 13:48:13 +0000 |
commit | 90135a5b7a31c30322f19e403d697780b552bf19 (patch) | |
tree | d64bef2da4d0143c38167eca2ae32d47b7226ced /tests | |
parent | 80b2694aede1ed736c619f76cb7b6250a913635b (diff) |
Convert to Qt 5 connect syntax
Convert to new signal/slot syntax where it does not make things more
complicated: connections where the signal or slot is an overloaded
method, or where the receiver method is not in a QObject, are left alone.
The new syntax allows compile-time checking of the connection.
Change-Id: I2cc3c93b9812797bd67f64a8728569491eeec668
Reviewed-by: Karsten Heimrich <karsten.heimrich@theqtcompany.com>
Reviewed-by: Jarek Kobus <jaroslaw.kobus@theqtcompany.com>
Diffstat (limited to 'tests')
-rw-r--r-- | tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp | 2 | ||||
-rw-r--r-- | tests/downloadspeed/main.cpp | 16 |
2 files changed, 9 insertions, 9 deletions
diff --git a/tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp b/tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp index 868865b5d..c0f250435 100644 --- a/tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp +++ b/tests/auto/installer/consumeoutputoperationtest/tst_consumeoutputoperationtest.cpp @@ -114,7 +114,7 @@ private: QEventLoop loop; QProcess process; - QObject::connect(&process, SIGNAL(finished(int, QProcess::ExitStatus)), &loop, SLOT(quit())); + QObject::connect(&process, SIGNAL(finished(int,QProcess::ExitStatus)), &loop, SLOT(quit())); process.start(binary, arguments, QIODevice::ReadOnly); if (process.state() != QProcess::NotRunning) diff --git a/tests/downloadspeed/main.cpp b/tests/downloadspeed/main.cpp index 5b66df051..c56305657 100644 --- a/tests/downloadspeed/main.cpp +++ b/tests/downloadspeed/main.cpp @@ -165,16 +165,16 @@ int main(int argc, char *argv[]) loader->setProxyFactory(new ProxyFactory()); Receiver r; - r.connect(loader, SIGNAL(downloadStarted()), &r, SLOT(downloadStarted())); - r.connect(loader, SIGNAL(downloadCanceled()), &r, SLOT(downloadFinished())); - r.connect(loader, SIGNAL(downloadCompleted()), &r, SLOT(downloadFinished())); - r.connect(loader, SIGNAL(downloadAborted(QString)), &r, SLOT(downloadAborted(QString))); + r.connect(loader, &KDUpdater::FileDownloader::downloadStarted, &r, &Receiver::downloadStarted); + r.connect(loader, &KDUpdater::FileDownloader::downloadCanceled, &r, &Receiver::downloadFinished); + r.connect(loader, &KDUpdater::FileDownloader::downloadCompleted, &r, &Receiver::downloadFinished); + r.connect(loader, &KDUpdater::FileDownloader::downloadAborted, &r, &Receiver::downloadAborted); - r.connect(loader, SIGNAL(downloadSpeed(qint64)), &r, SLOT(downloadSpeed(qint64))); - r.connect(loader, SIGNAL(downloadStatus(QString)), &r, SLOT(downloadStatus(QString))); + r.connect(loader, &KDUpdater::FileDownloader::downloadSpeed, &r, &Receiver::downloadSpeed); + r.connect(loader, &KDUpdater::FileDownloader::downloadStatus, &r, &Receiver::downloadStatus); r.connect(loader, SIGNAL(downloadProgress(double)), &r, SLOT(downloadProgress(double))); - r.connect(loader, SIGNAL(estimatedDownloadTime(int)), &r, SLOT(estimatedDownloadTime(int))); - r.connect(loader, SIGNAL(downloadProgress(qint64, qint64)), &r, SLOT(downloadProgress(qint64, qint64))); + r.connect(loader, &KDUpdater::FileDownloader::estimatedDownloadTime, &r, &Receiver::estimatedDownloadTime); + r.connect(loader, SIGNAL(downloadProgress(qint64,qint64)), &r, SLOT(downloadProgress(qint64,qint64))); loader->download(); while (!r.downloaded()) |