From 1453f74cc5617894c98f09428c3062dfa448044e Mon Sep 17 00:00:00 2001 From: "Jonas M. Gastal" Date: Wed, 11 Jan 2012 10:48:08 -0200 Subject: Make QFtp private. All references to QFtp in documentation have been removed, QFtp's documentaiton was marked internal. The QFtp example was removed. Task-number: QTBUG-23199 Change-Id: Ifff83cac069fb350e8ebeae63e605850e65c0c30 Reviewed-by: Shane Kearns --- tests/auto/network/access/access.pro | 3 +- tests/auto/network/access/qftp/tst_qftp.cpp | 2 +- .../access/qnetworkreply/tst_qnetworkreply.cpp | 42 +++++++++++----------- 3 files changed, 23 insertions(+), 24 deletions(-) (limited to 'tests') diff --git a/tests/auto/network/access/access.pro b/tests/auto/network/access/access.pro index 69ed189712..1e98d3cf85 100644 --- a/tests/auto/network/access/access.pro +++ b/tests/auto/network/access/access.pro @@ -8,12 +8,11 @@ SUBDIRS=\ qhttpnetworkconnection \ qnetworkreply \ qnetworkcachemetadata \ - qftp \ qhttpnetworkreply \ qabstractnetworkcache \ !contains(QT_CONFIG, private_tests): SUBDIRS -= \ qhttpnetworkconnection \ qhttpnetworkreply \ - + qftp \ diff --git a/tests/auto/network/access/qftp/tst_qftp.cpp b/tests/auto/network/access/qftp/tst_qftp.cpp index 49e1f4b230..35abd68415 100644 --- a/tests/auto/network/access/qftp/tst_qftp.cpp +++ b/tests/auto/network/access/qftp/tst_qftp.cpp @@ -45,7 +45,7 @@ #include #include #include -#include "qftp.h" +#include "private/qftp_p.h" #include #include #include diff --git a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp index 6ed241175d..e2c5798c53 100644 --- a/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp +++ b/tests/auto/network/access/qnetworkreply/tst_qnetworkreply.cpp @@ -54,7 +54,9 @@ #include #include #include -#include +#include +#include +#include #include #include #include @@ -1849,23 +1851,22 @@ void tst_QNetworkReply::putToFtp() // download the file again from FTP to make sure it was uploaded // correctly - QFtp ftp; - ftp.connectToHost(url.host()); - ftp.login(); - ftp.get(url.path()); + QNetworkAccessManager qnam; + QNetworkRequest req(url); + QNetworkReply *r = qnam.get(req); - QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(10); - QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + QObject::disconnect(r, SIGNAL(finished(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); - QByteArray uploaded = ftp.readAll(); + QByteArray uploaded = r->readAll(); QCOMPARE(uploaded.size(), data.size()); QCOMPARE(uploaded, data); - ftp.close(); - QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + r->close(); + QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(10); - QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); } void tst_QNetworkReply::putToHttp_data() @@ -3901,23 +3902,22 @@ void tst_QNetworkReply::ioPutToFtpFromFile() // download the file again from FTP to make sure it was uploaded // correctly - QFtp ftp; - ftp.connectToHost(url.host()); - ftp.login(); - ftp.get(url.path()); + QNetworkAccessManager qnam; + QNetworkRequest req(url); + QNetworkReply *r = qnam.get(req); - QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(3); - QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + QObject::disconnect(r, SIGNAL(finished(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); - QByteArray uploaded = ftp.readAll(); + QByteArray uploaded = r->readAll(); QCOMPARE(qint64(uploaded.size()), sourceFile.size()); QCOMPARE(uploaded, sourceFile.readAll()); - ftp.close(); - QObject::connect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + r->close(); + QObject::connect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); QTestEventLoop::instance().enterLoop(10); - QObject::disconnect(&ftp, SIGNAL(done(bool)), &QTestEventLoop::instance(), SLOT(exitLoop())); + QObject::disconnect(r, SIGNAL(finished()), &QTestEventLoop::instance(), SLOT(exitLoop())); } void tst_QNetworkReply::ioPutToHttpFromFile_data() -- cgit v1.2.3