summaryrefslogtreecommitdiffstats
path: root/src/libs/installer/downloadarchivesjob.h
diff options
context:
space:
mode:
authorArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-06-23 10:12:36 +0300
committerArttu Tarkiainen <arttu.tarkiainen@qt.io>2021-08-19 11:57:50 +0300
commit9729cdff85eb1aef0c1713b5b0d811fe9af50d2b (patch)
tree16ed86523cbafc3bd726307e9a106f41dea8e02c /src/libs/installer/downloadarchivesjob.h
parenta89e9e2917f0e783ced39769b879b0f4c53e144a (diff)
Add total remaining download time estimation for archives
Task-number: QTIFW-2207 Change-Id: Ia4ccc5f71a489a1663cdbf66a69f442366e65fc9 Reviewed-by: Katja Marttila <katja.marttila@qt.io>
Diffstat (limited to 'src/libs/installer/downloadarchivesjob.h')
-rw-r--r--src/libs/installer/downloadarchivesjob.h11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/libs/installer/downloadarchivesjob.h b/src/libs/installer/downloadarchivesjob.h
index 8f2392064..bd764e01c 100644
--- a/src/libs/installer/downloadarchivesjob.h
+++ b/src/libs/installer/downloadarchivesjob.h
@@ -1,6 +1,6 @@
/**************************************************************************
**
-** Copyright (C) 2017 The Qt Company Ltd.
+** Copyright (C) 2021 The Qt Company Ltd.
** Contact: https://www.qt.io/licensing/
**
** This file is part of the Qt Installer Framework.
@@ -32,6 +32,7 @@
#include "job.h"
#include <QtCore/QPair>
+#include <QtCore/QElapsedTimer>
QT_BEGIN_NAMESPACE
class QTimerEvent;
@@ -56,6 +57,7 @@ public:
int numberOfDownloads() const { return m_archivesDownloaded; }
void setArchivesToDownload(const QList<QPair<QString, QString> > &archives);
+ void setExpectedTotalSize(quint64 total);
Q_SIGNALS:
void progressChanged(double progress);
@@ -67,6 +69,9 @@ protected:
void doCancel();
void timerEvent(QTimerEvent *event);
+public Q_SLOTS:
+ void onDownloadStatusChanged(const QString &status);
+
protected Q_SLOTS:
void registerFile();
void downloadCanceled();
@@ -92,6 +97,10 @@ private:
QByteArray m_currentHash;
double m_lastFileProgress;
int m_progressChangedTimerId;
+
+ quint64 m_totalSizeToDownload;
+ quint64 m_totalSizeDownloaded;
+ QElapsedTimer m_totalDownloadSpeedTimer;
};
} // namespace QInstaller