From df03fb1e90ee73ae1bed6610ebfa57baa2756043 Mon Sep 17 00:00:00 2001 From: Sapour <128595414+Sapour@users.noreply.github.com> Date: Mon, 27 Mar 2023 12:23:01 +0100 Subject: [PATCH] Fix: Recovery: Only show delete confirmation dialog if file/folder selected --- SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp b/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp index 41f90330..edf01b8c 100644 --- a/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp +++ b/SandboxiePlus/SandMan/Windows/RecoveryWindow.cpp @@ -242,7 +242,10 @@ void CRecoveryWindow::OnDelete() { QMap FileMap = GetFiles(); - if (QMessageBox("Sandboxie-Plus", tr("Do you really want to delete %1 selected files?").arg(FileMap.count()), QMessageBox::Question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton, this).exec() != QMessageBox::Yes) + if (FileMap.isEmpty()) + return; + + if (QMessageBox::Yes != QMessageBox("Sandboxie-Plus", tr("Do you really want to delete %1 selected files?").arg(FileMap.count()), QMessageBox::Question, QMessageBox::Yes, QMessageBox::No | QMessageBox::Default | QMessageBox::Escape, QMessageBox::NoButton, this).exec()) return; foreach(const QString & FilePath, FileMap.keys())