From 93c92ce9791bb70cf3ff6af71e2f19e9b68d7584 Mon Sep 17 00:00:00 2001 From: Aqua-sama Date: Sat, 4 Jan 2020 22:00:25 +0200 Subject: Disable plugins as broken - Fix several Qt deprecated warnings --- lib/downloads/downloadswidget.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'lib/downloads/downloadswidget.cpp') 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); -- cgit v1.2.1