summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets
diff options
context:
space:
mode:
authorMichal Klocek <michal.klocek@qt.io>2020-08-11 13:28:48 +0200
committerMichal Klocek <michal.klocek@qt.io>2020-08-18 23:23:46 +0200
commit08375ee796a545e3916feb24e0b35d561e6f0049 (patch)
tree6af02ebfebf352781213490c12c18b8d4f1fcb84 /src/webenginewidgets
parent75393077108480e1762612331c399a012b5feba7 (diff)
Rename QWebEngineDownloadItem -> QWebEngineDownloadRequest
This fits better with other QWebEngine*Requests. [ChangeLog] QWebEngineDownloadItem is now QWebEngineDownloadRequest, also in qml. Change-Id: I506e9fac746b4f23ac0936c2fbe1c7472f4fda36 Reviewed-by: Michael BrĂ¼ning <michael.bruning@qt.io>
Diffstat (limited to 'src/webenginewidgets')
-rw-r--r--src/webenginewidgets/api/qwebenginepage.cpp4
-rw-r--r--src/webenginewidgets/api/qwebenginepage.h6
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.cpp38
-rw-r--r--src/webenginewidgets/api/qwebengineprofile.h4
-rw-r--r--src/webenginewidgets/api/qwebengineprofile_p.h2
5 files changed, 27 insertions, 27 deletions
diff --git a/src/webenginewidgets/api/qwebenginepage.cpp b/src/webenginewidgets/api/qwebenginepage.cpp
index a48d3a934..1e4ade4ac 100644
--- a/src/webenginewidgets/api/qwebenginepage.cpp
+++ b/src/webenginewidgets/api/qwebenginepage.cpp
@@ -1086,11 +1086,11 @@ void QWebEnginePage::setBackgroundColor(const QColor &color)
*
* This function issues an asynchronous download request for the web page and returns immediately.
*
- * \sa QWebEngineDownloadItem::SavePageFormat
+ * \sa QWebEngineDownloadRequest::SavePageFormat
* \since 5.8
*/
void QWebEnginePage::save(const QString &filePath,
- QWebEngineDownloadItem::SavePageFormat format) const
+ QWebEngineDownloadRequest::SavePageFormat format) const
{
Q_D(const QWebEnginePage);
d->ensureInitialized();
diff --git a/src/webenginewidgets/api/qwebenginepage.h b/src/webenginewidgets/api/qwebenginepage.h
index ffb9425f0..199ba9e2e 100644
--- a/src/webenginewidgets/api/qwebenginepage.h
+++ b/src/webenginewidgets/api/qwebenginepage.h
@@ -42,7 +42,7 @@
#include <QtWebEngineWidgets/qtwebenginewidgetsglobal.h>
#include <QtWebEngineWidgets/qwebengineclientcertificateselection.h>
-#include <QtWebEngineCore/qwebenginedownloaditem.h>
+#include <QtWebEngineCore/qwebenginedownloadrequest.h>
#include <QtWebEngineCore/qwebenginecallback.h>
#include <QtWebEngineCore/qwebenginehttprequest.h>
@@ -295,8 +295,8 @@ public:
QColor backgroundColor() const;
void setBackgroundColor(const QColor &color);
- void save(const QString &filePath, QWebEngineDownloadItem::SavePageFormat format
- = QWebEngineDownloadItem::MimeHtmlSaveFormat) const;
+ void save(const QString &filePath, QWebEngineDownloadRequest::SavePageFormat format
+ = QWebEngineDownloadRequest::MimeHtmlSaveFormat) const;
bool isAudioMuted() const;
void setAudioMuted(bool muted);
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(QSharedPointer<QtWebEngineCore::
}
/*!
- \fn QWebEngineProfile::downloadRequested(QWebEngineDownloadItem *download)
+ \fn QWebEngineProfile::downloadRequested(QWebEngineDownloadRequest *download)
\since 5.5
This signal is emitted whenever a download has been triggered.
The \a download argument holds the state of the download.
- The download has to be explicitly accepted with QWebEngineDownloadItem::accept() or it will be
+ The download has to be explicitly accepted with QWebEngineDownloadRequest::accept() or it will be
cancelled by default.
The download item is parented by the profile. If it is not accepted, it
will be deleted immediately after the signal emission.
This signal cannot be used with a queued connection.
- \sa QWebEngineDownloadItem, QWebEnginePage::download()
+ \sa QWebEngineDownloadRequest, QWebEnginePage::download()
*/
QWebEngineProfilePrivate::QWebEngineProfilePrivate(ProfileAdapter* profileAdapter)
@@ -223,37 +223,37 @@ void QWebEngineProfilePrivate::downloadRequested(DownloadItemInfo &info)
Q_Q(QWebEngineProfile);
Q_ASSERT(!m_ongoingDownloads.contains(info.id));
- QWebEngineDownloadItemPrivate *itemPrivate = new QWebEngineDownloadItemPrivate(m_profileAdapter, info.url);
+ QWebEngineDownloadRequestPrivate *itemPrivate = new QWebEngineDownloadRequestPrivate(m_profileAdapter, info.url);
itemPrivate->downloadId = 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<QWebEngineDownloadItem::SavePageFormat>(info.savePageFormat);
+ itemPrivate->savePageFormat = static_cast<QWebEngineDownloadRequest::SavePageFormat>(info.savePageFormat);
itemPrivate->isSavePageDownload = info.isSavePageDownload;
if (info.page && info.page->clientType() == QtWebEngineCore::WebContentsAdapterClient::WidgetsClient)
itemPrivate->page = static_cast<QWebEnginePagePrivate *>(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<QtWebEngineCore::ProfileAdapterClient::SavePageFormat>(
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);
diff --git a/src/webenginewidgets/api/qwebengineprofile.h b/src/webenginewidgets/api/qwebengineprofile.h
index 794ba6279..a8bf70856 100644
--- a/src/webenginewidgets/api/qwebengineprofile.h
+++ b/src/webenginewidgets/api/qwebengineprofile.h
@@ -55,7 +55,7 @@ class QObject;
class QUrl;
class QWebEngineClientCertificateStore;
class QWebEngineCookieStore;
-class QWebEngineDownloadItem;
+class QWebEngineDownloadRequest;
class QWebEngineNotification;
class QWebEnginePage;
class QWebEnginePagePrivate;
@@ -149,7 +149,7 @@ public:
static QWebEngineProfile *defaultProfile();
Q_SIGNALS:
- void downloadRequested(QWebEngineDownloadItem *download);
+ void downloadRequested(QWebEngineDownloadRequest *download);
private:
Q_DISABLE_COPY(QWebEngineProfile)
diff --git a/src/webenginewidgets/api/qwebengineprofile_p.h b/src/webenginewidgets/api/qwebengineprofile_p.h
index 64e9500b0..60fa4632f 100644
--- a/src/webenginewidgets/api/qwebengineprofile_p.h
+++ b/src/webenginewidgets/api/qwebengineprofile_p.h
@@ -99,7 +99,7 @@ private:
QWebEngineSettings *m_settings;
QPointer<QtWebEngineCore::ProfileAdapter> m_profileAdapter;
QScopedPointer<QWebEngineScriptCollection> m_scriptCollection;
- QMap<quint32, QPointer<QWebEngineDownloadItem> > m_ongoingDownloads;
+ QMap<quint32, QPointer<QWebEngineDownloadRequest> > m_ongoingDownloads;
std::function<void(std::unique_ptr<QWebEngineNotification>)> m_notificationPresenter;
};