diff options
author | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-06-29 13:15:48 +0200 |
---|---|---|
committer | Karsten Heimrich <karsten.heimrich@theqtcompany.com> | 2015-07-09 07:59:11 +0000 |
commit | d7f53290d9a8589752b9191131dfe2b500a23511 (patch) | |
tree | f5665c8c90dd06841c3008e805cae8e549f3a2cc /src/libs/installer/testrepository.h | |
parent | a1a11cf402e3c3a54b4d3af4095a6f579f755df8 (diff) |
Implement repository testing using our task classes.
Motivation is to get rid of the KD(}Downloader classes.
Change-Id: Idab1b3b56c2a879e1076e9f400ccec92a4484197
Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com>
Diffstat (limited to 'src/libs/installer/testrepository.h')
-rw-r--r-- | src/libs/installer/testrepository.h | 51 |
1 files changed, 22 insertions, 29 deletions
diff --git a/src/libs/installer/testrepository.h b/src/libs/installer/testrepository.h index bcc817b3c..a056b60e4 100644 --- a/src/libs/installer/testrepository.h +++ b/src/libs/installer/testrepository.h @@ -34,55 +34,48 @@ #ifndef TESTREPOSITORY_H #define TESTREPOSITORY_H -#include "qinstallerglobal.h" +#include "downloadfiletask.h" +#include "kdjob.h" +#include "repository.h" -#include <repository.h> -#include <settings.h> - -#include <kdjob.h> - -QT_BEGIN_NAMESPACE -class QAuthenticator; -class QLocale; -class QVariant; -QT_END_NAMESPACE - -namespace KDUpdater { - class FileDownloader; -} +#include <QFutureWatcher> +#include <QTimer> namespace QInstaller { - class PackageManagerCore; -} -namespace QInstaller { +class PackageManagerCore; +class Repository; class INSTALLER_EXPORT TestRepository : public KDJob { Q_OBJECT + Q_DISABLE_COPY(TestRepository) public: - - explicit TestRepository(QObject *parent = 0); + explicit TestRepository(PackageManagerCore *parent = 0); ~TestRepository(); - QInstaller::Repository repository() const; - void setRepository(const QInstaller::Repository &repository); + Repository repository() const; + void setRepository(const Repository &repository); -private: +private slots: void doStart(); void doCancel(); -private Q_SLOTS: + void onTimeout(); void downloadCompleted(); - void downloadAborted(const QString &reason); - void onAuthenticatorChanged(const QAuthenticator &authenticator); private: - QInstaller::Repository m_repository; - KDUpdater::FileDownloader *m_downloader; + void reset(); + +private: + PackageManagerCore *m_core; + + QTimer m_timer; + Repository m_repository; + QFutureWatcher<FileTaskResult> m_xmlTask; }; -} //namespace QInstaller +} // namespace QInstaller #endif // TESTREPOSITORY_H |