From f48fac5b55fbcc422bc2e66a1df023d606fb8a72 Mon Sep 17 00:00:00 2001 From: JosJuice Date: Sat, 5 May 2018 16:39:51 +0200 Subject: [PATCH] DolphinQt2: Allow picking "Extract Files..." on disc/partition DolphinWX already does this. --- .../DolphinQt2/Config/FilesystemWidget.cpp | 27 ++++++++++++------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/Source/Core/DolphinQt2/Config/FilesystemWidget.cpp b/Source/Core/DolphinQt2/Config/FilesystemWidget.cpp index a8b3ddc220..5c8126c219 100644 --- a/Source/Core/DolphinQt2/Config/FilesystemWidget.cpp +++ b/Source/Core/DolphinQt2/Config/FilesystemWidget.cpp @@ -155,8 +155,20 @@ void FilesystemWidget::ShowContextMenu(const QPoint&) GetPartitionFromID(item->data(ENTRY_PARTITION).toInt()); QString path = item->data(ENTRY_NAME).toString(); - if ((type == EntryType::Disc && m_volume->GetPartitions().empty()) || - type == EntryType::Partition) + const bool is_filesystem_root = (type == EntryType::Disc && m_volume->GetPartitions().empty()) || + type == EntryType::Partition; + + if (type == EntryType::Dir || is_filesystem_root) + { + AddAction(menu, tr("Extract Files..."), this, [this, partition, path] { + auto folder = SelectFolder(); + + if (!folder.isEmpty()) + ExtractDirectory(partition, path, folder); + }); + } + + if (is_filesystem_root) { AddAction(menu, tr("Extract System Data..."), this, [this, partition] { auto folder = SelectFolder(); @@ -203,14 +215,6 @@ void FilesystemWidget::ShowContextMenu(const QPoint&) AddAction(menu, tr("Check Partition Integrity"), this, [this, partition] { CheckIntegrity(partition); }); break; - case EntryType::Dir: - AddAction(menu, tr("Extract Files..."), this, [this, partition, path] { - auto folder = SelectFolder(); - - if (!folder.isEmpty()) - ExtractDirectory(partition, path, folder); - }); - break; case EntryType::File: AddAction(menu, tr("Extract File..."), this, [this, partition, path] { auto dest = QFileDialog::getSaveFileName(this, tr("Save File to")); @@ -219,6 +223,9 @@ void FilesystemWidget::ShowContextMenu(const QPoint&) ExtractFile(partition, path, dest); }); break; + case EntryType::Dir: + // Handled above the switch statement + break; } menu->exec(QCursor::pos());