mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
(iOS) Fix issue where file would be deleted even if the confirmation dialog is canceled.
This commit is contained in:
parent
0ddf198875
commit
50cca385e6
@ -232,13 +232,16 @@ static void file_action(enum file_action action, NSString* source, NSString* tar
|
|||||||
// Called by various alert views created in this class, the alertView.tag value is the action to take.
|
// Called by various alert views created in this class, the alertView.tag value is the action to take.
|
||||||
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
|
- (void)alertView:(UIAlertView*)alertView clickedButtonAtIndex:(NSInteger)buttonIndex
|
||||||
{
|
{
|
||||||
|
if (buttonIndex != alertView.firstOtherButtonIndex)
|
||||||
|
return;
|
||||||
|
|
||||||
if (alertView.tag == FA_DELETE)
|
if (alertView.tag == FA_DELETE)
|
||||||
file_action(FA_DELETE, nil, self.selectedItem.path);
|
file_action(FA_DELETE, nil, self.selectedItem.path);
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
NSString* text = [alertView textFieldAtIndex:0].text;
|
NSString* text = [alertView textFieldAtIndex:0].text;
|
||||||
|
|
||||||
if (buttonIndex == alertView.firstOtherButtonIndex && text.length)
|
if (text.length)
|
||||||
file_action(alertView.tag, self.selectedItem.path, [_path stringByAppendingPathComponent:text]);
|
file_action(alertView.tag, self.selectedItem.path, [_path stringByAppendingPathComponent:text]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user