From e21d29f0ea3e24790bdff53a6d4b9c21ac3f2c35 Mon Sep 17 00:00:00 2001 From: Ben Kuper Date: Sat, 22 Jun 2024 14:03:24 +0200 Subject: [PATCH] fix delete --- Source/Prop/PropManager.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Source/Prop/PropManager.cpp b/Source/Prop/PropManager.cpp index 36d65266..01b62855 100644 --- a/Source/Prop/PropManager.cpp +++ b/Source/Prop/PropManager.cpp @@ -287,13 +287,14 @@ void PropManager::onControllableFeedbackUpdate(ControllableContainer* cc, Contro } else if (c == deleteAllPlayback || c == deleteAllScripts) { + bool isPlayback = c == deleteAllPlayback; AlertWindow::showAsync( MessageBoxOptions().withIconType(AlertWindow::WarningIcon) .withTitle("Delete All files") .withMessage("Are you sure you want to delete all the files on all the props ?") .withButton("Yes") .withButton("No"), - [&](int result) + [&, isPlayback](int result) { if (result) { @@ -301,7 +302,7 @@ void PropManager::onControllableFeedbackUpdate(ControllableContainer* cc, Contro { if (BentoProp* bp = dynamic_cast(p)) { - bp->deleteFolder(c == deleteAllPlayback ? "/playback" : "/scripts"); + bp->deleteFolder(isPlayback ? "/playback" : "/scripts"); } } }