Merge pull request #7174 from spycrab/qt_fs_export

Qt/FilesystemWidget: Suggest default filename when exporting files
This commit is contained in:
spycrab 2018-06-28 22:32:22 +02:00 committed by GitHub
commit 6700cc4234
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 1 deletions

View File

@ -7,6 +7,7 @@
#include <QApplication>
#include <QCoreApplication>
#include <QFileDialog>
#include <QFileInfo>
#include <QHeaderView>
#include <QMenu>
#include <QMessageBox>
@ -244,7 +245,8 @@ void FilesystemWidget::ShowContextMenu(const QPoint&)
break;
case EntryType::File:
AddAction(menu, tr("Extract File..."), this, [this, partition, path] {
auto dest = QFileDialog::getSaveFileName(this, tr("Save File to"));
auto dest =
QFileDialog::getSaveFileName(this, tr("Save File to"), QFileInfo(path).fileName());
if (!dest.isEmpty())
ExtractFile(partition, path, dest);