summaryrefslogtreecommitdiffstats
path: root/src/webengine
diff options
context:
space:
mode:
authorAdam Kallai <kadam@inf.u-szeged.hu>2015-04-10 15:53:20 +0200
committerAdam Kallai <kadam@inf.u-szeged.hu>2015-04-14 09:31:15 +0000
commitd65bd6b6bad8de8eeebf88ba6ccd93a50f78a172 (patch)
tree43aa6b6f42e3063c721876cac4531180eadd1104 /src/webengine
parente138b30689e49229cbeb0cba8ecd4116e3ee91d5 (diff)
Fix QQuickWebEngineDownloadItem member initializaton
The totalBytes member has to be set before the downloadRequest would be emitted. Change-Id: Ifc164fb2d7f3318b825e28edb5b200ab623740d5 Reviewed-by: Andras Becsi <andras.becsi@theqtcompany.com>
Diffstat (limited to 'src/webengine')
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp2
-rw-r--r--src/webengine/api/qquickwebengineprofile.cpp1
2 files changed, 3 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index c38f5ea1..64e75a08 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -62,6 +62,8 @@ QQuickWebEngineDownloadItemPrivate::QQuickWebEngineDownloadItemPrivate(QQuickWeb
: profile(p)
, downloadId(-1)
, downloadState(QQuickWebEngineDownloadItem::DownloadCancelled)
+ , totalBytes(-1)
+ , receivedBytes(0)
{
}
diff --git a/src/webengine/api/qquickwebengineprofile.cpp b/src/webengine/api/qquickwebengineprofile.cpp
index 54535286..69c52435 100644
--- a/src/webengine/api/qquickwebengineprofile.cpp
+++ b/src/webengine/api/qquickwebengineprofile.cpp
@@ -88,6 +88,7 @@ void QQuickWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
QQuickWebEngineDownloadItemPrivate *itemPrivate = new QQuickWebEngineDownloadItemPrivate(this);
itemPrivate->downloadId = info.id;
itemPrivate->downloadState = QQuickWebEngineDownloadItem::DownloadRequested;
+ itemPrivate->totalBytes = info.totalBytes;
itemPrivate->downloadPath = info.path;
QQuickWebEngineDownloadItem *download = new QQuickWebEngineDownloadItem(itemPrivate, q);