summaryrefslogtreecommitdiffstats
path: root/src/webengine/api/qquickwebenginedownloaditem.cpp
diff options
context:
space:
mode:
authorAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-27 10:16:52 +0200
committerAllan Sandfeld Jensen <allan.jensen@qt.io>2019-05-27 10:16:52 +0200
commit8fbe26f467a337ffed34dc9ae2308d69950c1adf (patch)
treedb3472d679143bcb3c14369586817440bfd7c67b /src/webengine/api/qquickwebenginedownloaditem.cpp
parent0f081baa31facec779057de29eec14c6f458f6a6 (diff)
parent02c01aedcc08525eea226382318f6a8585c3dae7 (diff)
Merge remote-tracking branch 'origin/5.13' into dev
Diffstat (limited to 'src/webengine/api/qquickwebenginedownloaditem.cpp')
-rw-r--r--src/webengine/api/qquickwebenginedownloaditem.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/webengine/api/qquickwebenginedownloaditem.cpp b/src/webengine/api/qquickwebenginedownloaditem.cpp
index d5f6a3ef1..2b3e50a72 100644
--- a/src/webengine/api/qquickwebenginedownloaditem.cpp
+++ b/src/webengine/api/qquickwebenginedownloaditem.cpp
@@ -43,6 +43,8 @@
#include "profile_adapter.h"
#include "qquickwebengineprofile_p.h"
+#include "QFileInfo"
+
using QtWebEngineCore::ProfileAdapterClient;
QT_BEGIN_NAMESPACE
@@ -442,6 +444,16 @@ void QQuickWebEngineDownloadItem::setPath(QString path)
return;
}
if (d->downloadPath != path) {
+ if (QFileInfo(path).fileName().isEmpty()) {
+ qWarning("The download path does not include file name.");
+ return;
+ }
+
+ if (QFileInfo(path).isDir()) {
+ qWarning("The download path matches with an already existing directory path.");
+ return;
+ }
+
d->downloadPath = path;
Q_EMIT pathChanged();
}