From 08375ee796a545e3916feb24e0b35d561e6f0049 Mon Sep 17 00:00:00 2001 From: Michal Klocek Date: Tue, 11 Aug 2020 13:28:48 +0200 Subject: Rename QWebEngineDownloadItem -> QWebEngineDownloadRequest MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fits better with other QWebEngine*Requests. [ChangeLog] QWebEngineDownloadItem is now QWebEngineDownloadRequest, also in qml. Change-Id: I506e9fac746b4f23ac0936c2fbe1c7472f4fda36 Reviewed-by: Michael BrĂ¼ning --- src/webenginewidgets/api/qwebengineprofile.cpp | 38 +++++++++++++------------- 1 file changed, 19 insertions(+), 19 deletions(-) (limited to 'src/webenginewidgets/api/qwebengineprofile.cpp') diff --git a/src/webenginewidgets/api/qwebengineprofile.cpp b/src/webenginewidgets/api/qwebengineprofile.cpp index 499d6df9d..ea9db34c4 100644 --- a/src/webenginewidgets/api/qwebengineprofile.cpp +++ b/src/webenginewidgets/api/qwebengineprofile.cpp @@ -41,8 +41,8 @@ #include "qwebengineprofile_p.h" #include "qwebenginecookiestore.h" -#include "qwebenginedownloaditem.h" -#include "qwebenginedownloaditem_p.h" +#include "qwebenginedownloadrequest.h" +#include "qwebenginedownloadrequest_p.h" #include "qwebenginenotificationpresenter_p.h" #include "qwebenginepage.h" #include "qwebenginepage_p.h" @@ -58,10 +58,10 @@ QT_BEGIN_NAMESPACE -ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::UnknownSaveFormat, QtWebEngineCore::ProfileAdapterClient::UnknownSavePageFormat) -ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::SingleHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::SingleHtmlSaveFormat) -ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::CompleteHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::CompleteHtmlSaveFormat) -ASSERT_ENUMS_MATCH(QWebEngineDownloadItem::MimeHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::MimeHtmlSaveFormat) +ASSERT_ENUMS_MATCH(QWebEngineDownloadRequest::UnknownSaveFormat, QtWebEngineCore::ProfileAdapterClient::UnknownSavePageFormat) +ASSERT_ENUMS_MATCH(QWebEngineDownloadRequest::SingleHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::SingleHtmlSaveFormat) +ASSERT_ENUMS_MATCH(QWebEngineDownloadRequest::CompleteHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::CompleteHtmlSaveFormat) +ASSERT_ENUMS_MATCH(QWebEngineDownloadRequest::MimeHtmlSaveFormat, QtWebEngineCore::ProfileAdapterClient::MimeHtmlSaveFormat) using QtWebEngineCore::ProfileAdapter; @@ -151,19 +151,19 @@ void QWebEngineProfilePrivate::showNotification(QSharedPointerdownloadId = info.id; - itemPrivate->downloadState = info.accepted ? QWebEngineDownloadItem::DownloadInProgress - : QWebEngineDownloadItem::DownloadRequested; + itemPrivate->downloadState = info.accepted ? QWebEngineDownloadRequest::DownloadInProgress + : QWebEngineDownloadRequest::DownloadRequested; itemPrivate->startTime = info.startTime; itemPrivate->downloadDirectory = QFileInfo(info.path).path(); itemPrivate->downloadFileName = QFileInfo(info.path).fileName(); itemPrivate->suggestedFileName = info.suggestedFileName; itemPrivate->mimeType = info.mimeType; - itemPrivate->savePageFormat = static_cast(info.savePageFormat); + itemPrivate->savePageFormat = static_cast(info.savePageFormat); itemPrivate->isSavePageDownload = info.isSavePageDownload; if (info.page && info.page->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient) itemPrivate->page = static_cast(info.page)->q_ptr; else itemPrivate->page = nullptr; - QWebEngineDownloadItem *download = new QWebEngineDownloadItem(itemPrivate, q); + QWebEngineDownloadRequest *download = new QWebEngineDownloadRequest(itemPrivate, q); m_ongoingDownloads.insert(info.id, download); - QObject::connect(download, &QWebEngineDownloadItem::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); }); + QObject::connect(download, &QWebEngineDownloadRequest::destroyed, q, [id = info.id, this] () { downloadDestroyed(id); }); Q_EMIT q->downloadRequested(download); - QWebEngineDownloadItem::DownloadState state = download->state(); + QWebEngineDownloadRequest::DownloadState state = download->state(); info.path = QDir(download->downloadDirectory()).filePath(download->downloadFileName()); info.savePageFormat = static_cast( download->savePageFormat()); - info.accepted = state != QWebEngineDownloadItem::DownloadCancelled; + info.accepted = state != QWebEngineDownloadRequest::DownloadCancelled; - if (state == QWebEngineDownloadItem::DownloadRequested) { + if (state == QWebEngineDownloadRequest::DownloadRequested) { // Delete unaccepted downloads. info.accepted = false; delete download; @@ -265,7 +265,7 @@ void QWebEngineProfilePrivate::downloadUpdated(const DownloadItemInfo &info) if (!m_ongoingDownloads.contains(info.id)) return; - QWebEngineDownloadItem* download = m_ongoingDownloads.value(info.id).data(); + QWebEngineDownloadRequest* download = m_ongoingDownloads.value(info.id).data(); if (!download) { downloadDestroyed(info.id); -- cgit v1.2.3