aboutsummaryrefslogtreecommitdiff
path: root/lib/downloads/downloadswidget.cpp
diff options
context:
space:
mode:
authorAqua-sama <aqua@iserlohn-fortress.net>2020-01-04 22:00:25 +0200
committerAqua-sama <aqua@iserlohn-fortress.net>2020-01-04 23:03:40 +0200
commit93c92ce9791bb70cf3ff6af71e2f19e9b68d7584 (patch)
treefabbecb5a6712b400754ea1e5f7c892909d6e65c /lib/downloads/downloadswidget.cpp
parentFix configuration not being read unless explicitly specified (diff)
downloadsmolbote-93c92ce9791bb70cf3ff6af71e2f19e9b68d7584.tar.xz
Disable plugins as broken
- Fix several Qt deprecated warnings
Diffstat (limited to 'lib/downloads/downloadswidget.cpp')
-rw-r--r--lib/downloads/downloadswidget.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/lib/downloads/downloadswidget.cpp b/lib/downloads/downloadswidget.cpp
index 3ff7e69..02ed08a 100644
--- a/lib/downloads/downloadswidget.cpp
+++ b/lib/downloads/downloadswidget.cpp
@@ -30,7 +30,7 @@ DownloadsWidget::~DownloadsWidget()
void DownloadsWidget::addDownload(QWebEngineDownloadItem *item)
{
- const QString filepath = QFileDialog::getSaveFileName(this, tr("Save File"), m_downloadPath + "/" + QFileInfo(item->path()).fileName());
+ const QString filepath = QFileDialog::getSaveFileName(this, tr("Save File"), m_downloadPath + "/" + item->downloadFileName());
if(filepath.isEmpty()) {
// user cancelled the save dialog
@@ -38,7 +38,12 @@ void DownloadsWidget::addDownload(QWebEngineDownloadItem *item)
return;
}
- item->setPath(filepath);
+ QFileInfo info(filepath);
+
+ // you first have to set the download directory, then file name, otherwise the filename gets defaulted
+ item->setDownloadDirectory(info.absolutePath());
+ item->setDownloadFileName(info.fileName());
+
auto *listItem = new QListWidgetItem(ui->listWidget);