diff options
author | Balazs Egedi <egedib@inf.u-szeged.hu> | 2021-05-05 14:23:38 +0200 |
---|---|---|
committer | Balazs Egedi <egedib@inf.u-szeged.hu> | 2021-05-07 01:31:58 +0200 |
commit | 2250a262fa3ecc68706e5e5905d44c3c04a482a9 (patch) | |
tree | 19e5561d70b0c9d226ebebd8de84c1b7325296e1 /src | |
parent | a5c7b4d4f16574e35ce36550bda2d45baf345c79 (diff) |
Fix QWebEngineDownloadRequest signals
downloadFileNameChanged and downloadDirectoryChanged signals were removed in
08375ee7 Rename QWebEngineDownloadItem -> QWebEngineDownloadRequest.
Reintroduce these signals because they are still part of the API.
Also test these in Widgets auto test.
QQuickWebEngineDownloadItem::pathChanged were also removed in
75393077 Remove obsolete, deprecated api from qwebenginedownloaditem.
Remove the pathChanged signal checks from the test because it was deprecated.
The test tst_download.qml does not have quickcontrols1 dependency.
Update it in the project file and re-enable the test.
Change-Id: I702e04dfe2179beafc558a628bfa07f4090fede2
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src')
-rw-r--r-- | src/core/api/qwebenginedownloadrequest.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/src/core/api/qwebenginedownloadrequest.cpp b/src/core/api/qwebenginedownloadrequest.cpp index 58f02ee4f..eae48b017 100644 --- a/src/core/api/qwebenginedownloadrequest.cpp +++ b/src/core/api/qwebenginedownloadrequest.cpp @@ -516,13 +516,20 @@ void QWebEngineDownloadRequest::setDownloadDirectory(const QString &directory) return; } - if (!directory.isEmpty() && d->downloadDirectory != directory) + if (!directory.isEmpty() && d->downloadDirectory != directory) { d->downloadDirectory = directory; + Q_EMIT downloadDirectoryChanged(); + } - if (!d->isCustomFileName && d->m_profileAdapter) - d->downloadFileName = QFileInfo(d->m_profileAdapter->determineDownloadPath(d->downloadDirectory, - d->suggestedFileName, - d->startTime)).fileName(); + if (!d->isCustomFileName && d->m_profileAdapter) { + QString newFileName = QFileInfo(d->m_profileAdapter->determineDownloadPath(d->downloadDirectory, + d->suggestedFileName, + d->startTime)).fileName(); + if (d->downloadFileName != newFileName) { + d->downloadFileName = newFileName; + Q_EMIT downloadFileNameChanged(); + } + } } /*! @@ -554,6 +561,7 @@ void QWebEngineDownloadRequest::setDownloadFileName(const QString &fileName) if (!fileName.isEmpty()) { d->downloadFileName = fileName; d->isCustomFileName = true; + Q_EMIT downloadFileNameChanged(); } } |