Display error if target file item could not be created for bulk operations.

This commit is contained in:
Steveice10 2017-01-06 18:24:13 -08:00
parent 0d2fd5b28e
commit 554f96350e
4 changed files with 32 additions and 4 deletions

View File

@ -207,7 +207,14 @@ static void action_delete_internal(linked_list* items, list_item* selected, cons
data->items = items;
file_info* targetInfo = (file_info*) selected->data;
task_create_file_item(&data->targetItem, targetInfo->archive, targetInfo->path, targetInfo->attributes);
Result targetCreateRes = task_create_file_item(&data->targetItem, targetInfo->archive, targetInfo->path, targetInfo->attributes);
if(R_FAILED(targetCreateRes)) {
error_display_res(NULL, NULL, targetCreateRes, "Failed to create target file item.");
action_delete_free_data(data);
return;
}
data->target = (file_info*) data->targetItem->data;
data->deleteInfo.data = data;

View File

@ -321,7 +321,14 @@ static void action_install_cias_internal(linked_list* items, list_item* selected
data->items = items;
file_info* targetInfo = (file_info*) selected->data;
task_create_file_item(&data->targetItem, targetInfo->archive, targetInfo->path, targetInfo->attributes);
Result targetCreateRes = task_create_file_item(&data->targetItem, targetInfo->archive, targetInfo->path, targetInfo->attributes);
if(R_FAILED(targetCreateRes)) {
error_display_res(NULL, NULL, targetCreateRes, "Failed to create target file item.");
action_install_cias_free_data(data);
return;
}
data->target = (file_info*) data->targetItem->data;
data->delete = delete;

View File

@ -287,7 +287,14 @@ static void action_install_tickets_internal(linked_list* items, list_item* selec
data->items = items;
file_info* targetInfo = (file_info*) selected->data;
task_create_file_item(&data->targetItem, targetInfo->archive, targetInfo->path, targetInfo->attributes);
Result targetCreateRes = task_create_file_item(&data->targetItem, targetInfo->archive, targetInfo->path, targetInfo->attributes);
if(R_FAILED(targetCreateRes)) {
error_display_res(NULL, NULL, targetCreateRes, "Failed to create target file item.");
action_install_tickets_free_data(data);
return;
}
data->target = (file_info*) data->targetItem->data;
data->delete = delete;

View File

@ -357,7 +357,14 @@ void action_paste_contents(linked_list* items, list_item* selected) {
data->items = items;
file_info* targetInfo = (file_info*) selected->data;
task_create_file_item(&data->targetItem, targetInfo->archive, targetInfo->path, targetInfo->attributes);
Result targetCreateRes = task_create_file_item(&data->targetItem, targetInfo->archive, targetInfo->path, targetInfo->attributes);
if(R_FAILED(targetCreateRes)) {
error_display_res(NULL, NULL, targetCreateRes, "Failed to create target file item.");
action_paste_contents_free_data(data);
return;
}
data->target = (file_info*) data->targetItem->data;
data->pasteInfo.data = data;