From 17a90a88e6a56cefda5ecf74bfc5a93c859b6e3d Mon Sep 17 00:00:00 2001 From: David Rosca Date: Fri, 13 Jan 2017 17:20:20 +0100 Subject: [PATCH] DownloadManager: Correctly decode file name for downloads --- src/lib/downloads/downloadmanager.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/lib/downloads/downloadmanager.cpp b/src/lib/downloads/downloadmanager.cpp index 4e03ccbb5..cc205b191 100644 --- a/src/lib/downloads/downloadmanager.cpp +++ b/src/lib/downloads/downloadmanager.cpp @@ -1,6 +1,6 @@ /* ============================================================ -* QupZilla - WebKit based browser -* Copyright (C) 2010-2016 David Rosca +* QupZilla - Qt web browser +* Copyright (C) 2010-2017 David Rosca * * 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 @@ -214,6 +214,8 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem) QString fileName = QFileInfo(downloadItem->path()).fileName(); fileName = QUrl::fromPercentEncoding(fileName.toUtf8()); + // Filename may have been percent encoded and actually containing path + fileName = QFileInfo(fileName).fileName(); if (m_useExternalManager) { startExternalManager(downloadItem->url());