diff options
author | Viktor Engelmann <viktor.engelmann@qt.io> | 2016-12-19 15:58:04 +0100 |
---|---|---|
committer | Viktor Engelmann <viktor.engelmann@qt.io> | 2017-01-12 13:42:48 +0000 |
commit | 0a578ce16b0ea5eadae32d0055b45f56f36eefa4 (patch) | |
tree | 24ef4e345f42e66986882713ce6cd3a687de85ce /src/webengine/api/qquickwebenginedownloaditem.cpp | |
parent | 479ca165d3df610a135f9129cb3cecb0a7c7e069 (diff) |
Add methods for textual description of DownloadInterruptReason
A method was added to get a textual description of a
Q(Quick)WebEngineDownloadItem::DownloadInterruptReason.
Basically returns the same description from the QDoc entry, but
shortened where that was to long.
Also moved the ASSERT_ENUMS_MATCHes from
download_manager_delegate_qt.cpp to the newly created
browser_context_adapter_client.cpp.
Task-number: QTBUG-56839
Change-Id: I17c68987b7f12fcaeb71fd27f7ebb35c0ac87bac
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/webengine/api/qquickwebenginedownloaditem.cpp')
-rw-r--r-- | src/webengine/api/qquickwebenginedownloaditem.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp index 520839880..58116116c 100644 --- a/src/webengine/api/qquickwebenginedownloaditem.cpp +++ b/src/webengine/api/qquickwebenginedownloaditem.cpp @@ -401,6 +401,8 @@ QQuickWebEngineDownloadItem::DownloadType QQuickWebEngineDownloadItem::type() co \value WebEngineDownloadItem.ServerUnreachable Unexpected server response (might indicate that the responding server may not be the intended server). \value WebEngineDownloadItem.UserCanceled The user canceled the download. + + \sa interruptReasonString() */ QQuickWebEngineDownloadItem::DownloadInterruptReason QQuickWebEngineDownloadItem::interruptReason() const @@ -409,6 +411,19 @@ QQuickWebEngineDownloadItem::DownloadInterruptReason QQuickWebEngineDownloadItem return d->interruptReason; } +/*! + Returns a human-readable description of the reason for interrupting the download. + \since QtWebEngine 1.6 + + \sa interruptReason() +*/ + +QString QQuickWebEngineDownloadItem::interruptReasonString() const +{ + return BrowserContextAdapterClient::downloadInterruptReasonToString( + static_cast<BrowserContextAdapterClient::DownloadInterruptReason>(interruptReason())); +} + QQuickWebEngineDownloadItem::QQuickWebEngineDownloadItem(QQuickWebEngineDownloadItemPrivate *p, QObject *parent) : QObject(parent) , d_ptr(p) |