summaryrefslogtreecommitdiffstats
path: root/src/webenginewidgets/api
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
commit366aef14779c28b12807be960eb494b534a859c9 (patch)
treed03acb2bc402f0aaf1a38ac11a254134dd696b2a /src/webenginewidgets/api
parenta69029cf9fcfd0c1fcdaafe5cbcbff2d5dd6b5c5 (diff)
parent8fbe26f467a337ffed34dc9ae2308d69950c1adf (diff)
Merge "Merge remote-tracking branch 'origin/5.13' into dev"
Diffstat (limited to 'src/webenginewidgets/api')
-rw-r--r--src/webenginewidgets/api/qwebenginedownloaditem.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/src/webenginewidgets/api/qwebenginedownloaditem.cpp b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
index ec088762e..6df131066 100644
--- a/src/webenginewidgets/api/qwebenginedownloaditem.cpp
+++ b/src/webenginewidgets/api/qwebenginedownloaditem.cpp
@@ -43,6 +43,7 @@
#include "profile_adapter.h"
#include "qwebengineprofile_p.h"
+#include "QFileInfo"
QT_BEGIN_NAMESPACE
@@ -534,6 +535,16 @@ void QWebEngineDownloadItem::setPath(QString path)
return;
}
+ 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;
}
/*!