1
mirror of https://invent.kde.org/network/falkon.git synced 2024-11-11 09:32:12 +01:00

DownloadManager: Correctly decode file name for downloads

This commit is contained in:
David Rosca 2017-01-13 17:20:20 +01:00
parent 614ac46174
commit 17a90a88e6

View File

@ -1,6 +1,6 @@
/* ============================================================ /* ============================================================
* QupZilla - WebKit based browser * QupZilla - Qt web browser
* Copyright (C) 2010-2016 David Rosca <nowrep@gmail.com> * Copyright (C) 2010-2017 David Rosca <nowrep@gmail.com>
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -214,6 +214,8 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
QString fileName = QFileInfo(downloadItem->path()).fileName(); QString fileName = QFileInfo(downloadItem->path()).fileName();
fileName = QUrl::fromPercentEncoding(fileName.toUtf8()); fileName = QUrl::fromPercentEncoding(fileName.toUtf8());
// Filename may have been percent encoded and actually containing path
fileName = QFileInfo(fileName).fileName();
if (m_useExternalManager) { if (m_useExternalManager) {
startExternalManager(downloadItem->url()); startExternalManager(downloadItem->url());