1
mirror of https://invent.kde.org/network/falkon.git synced 2024-12-20 02:36:34 +01:00

Download Manager: Save last path only when not empty

This commit is contained in:
David Rosca 2016-05-27 20:37:08 +02:00
parent 6280d34e70
commit 5ba652afa9

View File

@ -230,9 +230,11 @@ void DownloadManager::download(QWebEngineDownloadItem *downloadItem)
case 2: // Save
downloadPath = QFileDialog::getSaveFileName(mApp->activeWindow(), tr("Save file as..."), m_lastDownloadPath + fileName);
m_lastDownloadPath = QFileInfo(downloadPath).absolutePath();
Settings().setValue(QSL("lastDownloadPath"), m_lastDownloadPath);
m_lastDownloadOption = SaveFile;
if (!downloadPath.isEmpty()) {
m_lastDownloadPath = QFileInfo(downloadPath).absolutePath();
Settings().setValue(QSL("lastDownloadPath"), m_lastDownloadPath);
m_lastDownloadOption = SaveFile;
}
break;
case 3: // External manager