summaryrefslogtreecommitdiffstats
path: root/src/core/profile_adapter.cpp
diff options
context:
space:
mode:
authorTamas Zakor <ztamas@inf.u-szeged.hu>2018-11-26 08:34:08 +0100
committerZakor Tamas <ztamas@inf.u-szeged.hu>2019-01-30 14:03:31 +0000
commit46d68dcf726e6ba385a91cbeb5db131c0d1d0e9d (patch)
tree8050bf160f77c01c4e3db2ce8d4a90eaf3ad129a /src/core/profile_adapter.cpp
parente08c5e162559737672ae90b12dde369dc09c21f8 (diff)
Add API to set default download path
Add functions and property to set the default download location in QWebEngineProfile and QQuickWebEngineProfile. Also add new test for check uniquifying download filename. Update plugins.qmltypes to 1.9 [ChangeLog][Profile][QtWebEngine][QtWebEngineWidgets] Add functions and property to set the default download location in QWebEngineProfile and QQuickWebEngineProfile. Task-number: QTBUG-66262 Task-number: QTBUG-72176 Change-Id: I7fa93b66c326766b176aec24d453dd75602b91de Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io> Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'src/core/profile_adapter.cpp')
-rw-r--r--src/core/profile_adapter.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/core/profile_adapter.cpp b/src/core/profile_adapter.cpp
index cee783118..dfe701cc9 100644
--- a/src/core/profile_adapter.cpp
+++ b/src/core/profile_adapter.cpp
@@ -84,6 +84,7 @@ ProfileAdapter::ProfileAdapter(const QString &storageName):
, m_visitedLinksPolicy(TrackVisitedLinksOnDisk)
, m_httpCacheMaxSize(0)
, m_pageRequestInterceptors(0)
+ , m_downloadPath(QStandardPaths::writableLocation(QStandardPaths::DownloadLocation))
{
WebEngineContext::current()->addProfileAdapter(this);
// creation of profile requires webengine context
@@ -253,6 +254,11 @@ void ProfileAdapter::setDataPath(const QString &path)
}
}
+void ProfileAdapter::setDownloadPath(const QString &path)
+{
+ m_downloadPath = path.isEmpty() ? QStandardPaths::writableLocation(QStandardPaths::DownloadLocation) : path;
+}
+
QString ProfileAdapter::cachePath() const
{
if (m_offTheRecord)