summaryrefslogtreecommitdiffstats
path: root/src/core/api/qwebenginedownloadrequest_p.h
diff options
context:
space:
mode:
authorPeter Varga <pvarga@inf.u-szeged.hu>2023-02-24 14:57:52 +0100
committerMichal Klocek <michal.klocek@qt.io>2023-03-02 12:10:13 +0100
commit47c398a510d13b1bbe41a665141f9eea52ffac32 (patch)
tree4e11f2f154646cf6c07ccd864c771dce9c1ed5e6 /src/core/api/qwebenginedownloadrequest_p.h
parentd7a03bf28152fe4d7666c97c548d2d7d2c809184 (diff)
Fix initialization of QWebEngineDownloadRequest::totalBytes for Widgets
QQuickWebEngineProfile already initializes totalBytes. Also clean up QWebEngineDownloadRequestPrivate and fix typo in documentation. Fixes: QTBUG-104869 Change-Id: I8c4b79c076ddc63180960e22a9488b45ff6c4402 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io> (cherry picked from commit 496647f7647571ca3cdf81b10ba418de0f06f34d) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> (cherry picked from commit 01be7f108c0d501f532b197f091baaaaba211ee6)
Diffstat (limited to 'src/core/api/qwebenginedownloadrequest_p.h')
-rw-r--r--src/core/api/qwebenginedownloadrequest_p.h29
1 files changed, 16 insertions, 13 deletions
diff --git a/src/core/api/qwebenginedownloadrequest_p.h b/src/core/api/qwebenginedownloadrequest_p.h
index 814af59cb..26afbc4ad 100644
--- a/src/core/api/qwebenginedownloadrequest_p.h
+++ b/src/core/api/qwebenginedownloadrequest_p.h
@@ -31,32 +31,35 @@ QT_BEGIN_NAMESPACE
class Q_WEBENGINECORE_PRIVATE_EXPORT QWebEngineDownloadRequestPrivate
{
public:
- QWebEngineDownloadRequestPrivate(QtWebEngineCore::ProfileAdapter *adapter, const QUrl &url);
+ QWebEngineDownloadRequestPrivate(QtWebEngineCore::ProfileAdapter *adapter);
~QWebEngineDownloadRequestPrivate();
void update(const QtWebEngineCore::ProfileAdapterClient::DownloadItemInfo &info);
void setFinished();
- bool downloadFinished;
- quint32 downloadId;
+ bool downloadFinished = false;
+ quint32 downloadId = -1;
qint64 startTime;
- QWebEngineDownloadRequest::DownloadState downloadState;
- QWebEngineDownloadRequest::SavePageFormat savePageFormat;
- QWebEngineDownloadRequest::DownloadInterruptReason interruptReason;
+ QWebEngineDownloadRequest::DownloadState downloadState =
+ QWebEngineDownloadRequest::DownloadCancelled;
+ QWebEngineDownloadRequest::SavePageFormat savePageFormat =
+ QWebEngineDownloadRequest::MimeHtmlSaveFormat;
+ QWebEngineDownloadRequest::DownloadInterruptReason interruptReason =
+ QWebEngineDownloadRequest::NoReason;
QString downloadPath;
- const QUrl downloadUrl;
+ QUrl downloadUrl;
QString mimeType;
- bool downloadPaused;
+ bool downloadPaused = false;
QString suggestedFileName;
QString downloadDirectory;
QString downloadFileName;
- bool isCustomFileName;
- qint64 totalBytes;
- qint64 receivedBytes;
- bool isSavePageDownload;
+ bool isCustomFileName = false;
+ qint64 totalBytes = -1;
+ qint64 receivedBytes = 0;
+ bool isSavePageDownload = false;
QWebEngineDownloadRequest *q_ptr;
QPointer<QtWebEngineCore::ProfileAdapter> profileAdapter;
- QtWebEngineCore::WebContentsAdapterClient *adapterClient;
+ QtWebEngineCore::WebContentsAdapterClient *adapterClient = nullptr;
Q_DECLARE_PUBLIC(QWebEngineDownloadRequest)
};