summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTamas Zakor <ztamas@inf.u-szeged.hu>2019-10-24 13:55:50 +0200
committerTamas Zakor <ztamas@inf.u-szeged.hu>2019-11-05 13:17:43 +0100
commit58bc92115febfa332e9f2ebe0f06a01b5a679416 (patch)
treed15949542959ecbdb56dd8da41ef42ac6ff9bc4c
parentb7ca21bb126ed1ce6372af0e8e705b290ad0161a (diff)
Deprecate QWebEngineDownloadItem path API properly
Implements suggestion from 5.14 API review: - Replace QT_DEPRECATED with QT_DEPRECATED_SINCE and QT_DEPRECATED_VERSION_X Change-Id: I4d0bf8a2b535c44b5749cbd3bbab7e305bd137c6 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.h8
-rw-r--r--tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp4
2 files changed, 10 insertions, 2 deletions
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.h b/src/webenginewidgets/api/qwebenginedownloaditem.h
index 27fca6f8..8d98799a 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.h
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.h
@@ -118,8 +118,12 @@ public:
qint64 receivedBytes() const;
QUrl url() const;
QString mimeType() const;
- QString Q_DECL_DEPRECATED path() const;
- void Q_DECL_DEPRECATED setPath(QString path);
+#if QT_DEPRECATED_SINCE(5, 14)
+ QT_DEPRECATED_VERSION_X(5, 14, "Use downloadDirectory() and downloadFileName() instead")
+ QString path() const;
+ QT_DEPRECATED_VERSION_X(5, 14, "Use setDownloadDirectory() and setDownloadFileName() instead")
+ void setPath(QString path);
+#endif
bool isFinished() const;
bool isPaused() const;
SavePageFormat savePageFormat() const;
diff --git a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
index 4a5b4e3e..d34e3cef 100644
--- a/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
+++ b/tests/auto/widgets/qwebenginedownloaditem/tst_qwebenginedownloaditem.cpp
@@ -77,7 +77,9 @@ private Q_SLOTS:
void downloadToDefaultLocation();
void downloadToNonExistentDir();
void downloadToReadOnlyDir();
+#if QT_DEPRECATED_SINCE(5, 14)
void downloadPathValidation();
+#endif
void downloadToDirectoryWithFileName();
private:
@@ -1135,6 +1137,7 @@ void tst_QWebEngineDownloadItem::downloadToReadOnlyDir()
QFile(m_profile->downloadPath()).setPermissions(QFileDevice::WriteOwner);
}
+#if QT_DEPRECATED_SINCE(5, 14)
void tst_QWebEngineDownloadItem::downloadPathValidation()
{
const QString fileName = "test.txt";
@@ -1251,6 +1254,7 @@ void tst_QWebEngineDownloadItem::downloadPathValidation()
#endif // !defined(Q_OS_WIN)
QDir::setCurrent(oldPath);
}
+#endif
void tst_QWebEngineDownloadItem::downloadToDirectoryWithFileName()
{