mirror of
https://gitlab.com/Theopse/fbi-i18n-zh.git
synced 2025-04-06 03:58:02 +08:00
Rename move task to copy task.
This commit is contained in:
parent
7e421c741a
commit
574424e6af
@ -20,7 +20,7 @@ typedef struct {
|
||||
|
||||
u64 currTitleId;
|
||||
|
||||
move_data_info installInfo;
|
||||
copy_data_info installInfo;
|
||||
Handle cancelEvent;
|
||||
} install_cias_data;
|
||||
|
||||
@ -213,7 +213,7 @@ static void action_install_cias_onresponse(ui_view* view, void* data, bool respo
|
||||
install_cias_data* installData = (install_cias_data*) data;
|
||||
|
||||
if(response) {
|
||||
installData->cancelEvent = task_move_data(&installData->installInfo);
|
||||
installData->cancelEvent = task_copy_data(&installData->installInfo);
|
||||
if(installData->cancelEvent != 0) {
|
||||
ui_view* progressView = progressbar_create("Installing CIA(s)", "Press B to cancel.", data, action_install_cias_update, action_install_cias_draw_top);
|
||||
snprintf(progressbar_get_progress_text(progressView), PROGRESS_TEXT_MAX, "0 / %lu", installData->installInfo.total);
|
||||
@ -238,7 +238,7 @@ static void action_install_cias_internal(file_info* info, bool* populated, bool
|
||||
|
||||
data->installInfo.data = data;
|
||||
|
||||
data->installInfo.moveEmpty = false;
|
||||
data->installInfo.copyEmpty = false;
|
||||
|
||||
data->installInfo.isSrcDirectory = action_install_cias_is_src_directory;
|
||||
data->installInfo.makeDstDirectory = action_install_cias_make_dst_directory;
|
||||
|
@ -16,7 +16,7 @@ typedef struct {
|
||||
file_info* base;
|
||||
char** contents;
|
||||
|
||||
move_data_info installInfo;
|
||||
copy_data_info installInfo;
|
||||
Handle cancelEvent;
|
||||
} install_tickets_data;
|
||||
|
||||
@ -151,7 +151,7 @@ static void action_install_tickets_onresponse(ui_view* view, void* data, bool re
|
||||
install_tickets_data* installData = (install_tickets_data*) data;
|
||||
|
||||
if(response) {
|
||||
installData->cancelEvent = task_move_data(&installData->installInfo);
|
||||
installData->cancelEvent = task_copy_data(&installData->installInfo);
|
||||
if(installData->cancelEvent != 0) {
|
||||
ui_view* progressView = progressbar_create("Installing ticket(s)", "Press B to cancel.", data, action_install_tickets_update, action_install_tickets_draw_top);
|
||||
snprintf(progressbar_get_progress_text(progressView), PROGRESS_TEXT_MAX, "0 / %lu", installData->installInfo.total);
|
||||
@ -172,7 +172,7 @@ void action_install_tickets(file_info* info, bool* populated) {
|
||||
|
||||
data->installInfo.data = data;
|
||||
|
||||
data->installInfo.moveEmpty = false;
|
||||
data->installInfo.copyEmpty = false;
|
||||
|
||||
data->installInfo.isSrcDirectory = action_install_tickets_is_src_directory;
|
||||
data->installInfo.makeDstDirectory = action_install_tickets_make_dst_directory;
|
||||
|
@ -18,7 +18,7 @@ typedef struct {
|
||||
bool* populated;
|
||||
char** contents;
|
||||
|
||||
move_data_info pasteInfo;
|
||||
copy_data_info pasteInfo;
|
||||
Handle cancelEvent;
|
||||
} paste_files_data;
|
||||
|
||||
@ -178,7 +178,7 @@ static void action_paste_files_onresponse(ui_view* view, void* data, bool respon
|
||||
|
||||
paste_files_data* pasteData = (paste_files_data*) data;
|
||||
if(response) {
|
||||
pasteData->cancelEvent = task_move_data(&pasteData->pasteInfo);
|
||||
pasteData->cancelEvent = task_copy_data(&pasteData->pasteInfo);
|
||||
if(pasteData->cancelEvent != 0) {
|
||||
ui_view* progressView = progressbar_create("Pasting Contents", "Press B to cancel.", data, action_paste_files_update, action_paste_files_draw_top);
|
||||
snprintf(progressbar_get_progress_text(progressView), PROGRESS_TEXT_MAX, "0 / %lu", ((paste_files_data*) data)->pasteInfo.total);
|
||||
@ -203,7 +203,7 @@ void action_paste_contents(file_info* info, bool* populated) {
|
||||
|
||||
data->pasteInfo.data = data;
|
||||
|
||||
data->pasteInfo.moveEmpty = true;
|
||||
data->pasteInfo.copyEmpty = true;
|
||||
|
||||
data->pasteInfo.isSrcDirectory = action_paste_files_is_src_directory;
|
||||
data->pasteInfo.makeDstDirectory = action_paste_files_make_dst_directory;
|
||||
|
@ -10,7 +10,7 @@
|
||||
#include "../../screen.h"
|
||||
|
||||
typedef struct {
|
||||
move_data_info dumpInfo;
|
||||
copy_data_info dumpInfo;
|
||||
Handle cancelEvent;
|
||||
} dump_nand_data;
|
||||
|
||||
@ -102,7 +102,7 @@ static void dumpnand_onresponse(ui_view* view, void* data, bool response) {
|
||||
if(response) {
|
||||
dump_nand_data* dumpData = (dump_nand_data*) data;
|
||||
|
||||
dumpData->cancelEvent = task_move_data(&dumpData->dumpInfo);
|
||||
dumpData->cancelEvent = task_copy_data(&dumpData->dumpInfo);
|
||||
if(dumpData->cancelEvent != 0) {
|
||||
ui_push(progressbar_create("Dumping NAND", "Press B to cancel.", data, dumpnand_update, NULL));
|
||||
} else {
|
||||
@ -118,7 +118,7 @@ void dump_nand() {
|
||||
|
||||
data->dumpInfo.data = data;
|
||||
|
||||
data->dumpInfo.moveEmpty = true;
|
||||
data->dumpInfo.copyEmpty = true;
|
||||
|
||||
data->dumpInfo.total = 1;
|
||||
|
||||
|
@ -23,7 +23,7 @@ typedef struct {
|
||||
|
||||
u64 currTitleId;
|
||||
|
||||
move_data_info installInfo;
|
||||
copy_data_info installInfo;
|
||||
Handle cancelEvent;
|
||||
} network_install_data;
|
||||
|
||||
@ -232,7 +232,7 @@ static void networkinstall_confirm_onresponse(ui_view* view, void* data, bool re
|
||||
network_install_data* networkInstallData = (network_install_data*) data;
|
||||
|
||||
if(response) {
|
||||
networkInstallData->cancelEvent = task_move_data(&networkInstallData->installInfo);
|
||||
networkInstallData->cancelEvent = task_copy_data(&networkInstallData->installInfo);
|
||||
if(networkInstallData->cancelEvent != 0) {
|
||||
ui_view* progressView = progressbar_create("Installing CIA(s)", "Press B to cancel.", data, networkinstall_install_update, NULL);
|
||||
snprintf(progressbar_get_progress_text(progressView), PROGRESS_TEXT_MAX, "0 / %lu", networkInstallData->installInfo.total);
|
||||
@ -335,7 +335,7 @@ void networkinstall_open() {
|
||||
|
||||
data->installInfo.data = data;
|
||||
|
||||
data->installInfo.moveEmpty = false;
|
||||
data->installInfo.copyEmpty = false;
|
||||
|
||||
data->installInfo.isSrcDirectory = networkinstall_is_src_directory;
|
||||
data->installInfo.makeDstDirectory = networkinstall_make_dst_directory;
|
||||
|
@ -9,12 +9,12 @@
|
||||
#include "task.h"
|
||||
|
||||
typedef struct {
|
||||
move_data_info* info;
|
||||
copy_data_info* info;
|
||||
|
||||
Handle cancelEvent;
|
||||
} move_data_data;
|
||||
} copy_data_data;
|
||||
|
||||
static bool task_move_data_item(move_data_data* data, u32 index) {
|
||||
static bool task_copy_data_item(copy_data_data* data, u32 index) {
|
||||
data->info->currProcessed = 0;
|
||||
data->info->currTotal = 0;
|
||||
|
||||
@ -28,7 +28,7 @@ static bool task_move_data_item(move_data_data* data, u32 index) {
|
||||
if(R_SUCCEEDED(res = data->info->openSrc(data->info->data, index, &srcHandle))) {
|
||||
if(R_SUCCEEDED(res = data->info->getSrcSize(data->info->data, srcHandle, &data->info->currTotal))) {
|
||||
if(data->info->currTotal == 0) {
|
||||
if(data->info->moveEmpty) {
|
||||
if(data->info->copyEmpty) {
|
||||
u32 dstHandle = 0;
|
||||
if(R_SUCCEEDED(res = data->info->openDst(data->info->data, index, NULL, &dstHandle))) {
|
||||
res = data->info->closeDst(data->info->data, index, true, dstHandle);
|
||||
@ -105,8 +105,8 @@ static bool task_move_data_item(move_data_data* data, u32 index) {
|
||||
return true;
|
||||
}
|
||||
|
||||
static void task_move_data_thread(void* arg) {
|
||||
move_data_data* data = (move_data_data*) arg;
|
||||
static void task_copy_data_thread(void* arg) {
|
||||
copy_data_data* data = (copy_data_data*) arg;
|
||||
|
||||
data->info->finished = false;
|
||||
data->info->premature = false;
|
||||
@ -114,7 +114,7 @@ static void task_move_data_thread(void* arg) {
|
||||
data->info->processed = 0;
|
||||
|
||||
for(data->info->processed = 0; data->info->processed < data->info->total; data->info->processed++) {
|
||||
if(!task_move_data_item(data, data->info->processed)) {
|
||||
if(!task_copy_data_item(data, data->info->processed)) {
|
||||
data->info->premature = true;
|
||||
break;
|
||||
}
|
||||
@ -126,7 +126,7 @@ static void task_move_data_thread(void* arg) {
|
||||
free(data);
|
||||
}
|
||||
|
||||
static void task_move_data_reset_info(move_data_info* info) {
|
||||
static void task_copy_data_reset_info(copy_data_info* info) {
|
||||
info->finished = false;
|
||||
info->premature = false;
|
||||
|
||||
@ -136,14 +136,14 @@ static void task_move_data_reset_info(move_data_info* info) {
|
||||
info->currTotal = 0;
|
||||
}
|
||||
|
||||
Handle task_move_data(move_data_info* info) {
|
||||
Handle task_copy_data(copy_data_info* info) {
|
||||
if(info == NULL) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
task_move_data_reset_info(info);
|
||||
task_copy_data_reset_info(info);
|
||||
|
||||
move_data_data* installData = (move_data_data*) calloc(1, sizeof(move_data_data));
|
||||
copy_data_data* installData = (copy_data_data*) calloc(1, sizeof(copy_data_data));
|
||||
installData->info = info;
|
||||
|
||||
Result eventRes = svcCreateEvent(&installData->cancelEvent, 1);
|
||||
@ -154,7 +154,7 @@ Handle task_move_data(move_data_info* info) {
|
||||
return 0;
|
||||
}
|
||||
|
||||
if(threadCreate(task_move_data_thread, installData, 0x4000, 0x18, 1, true) == NULL) {
|
||||
if(threadCreate(task_copy_data_thread, installData, 0x4000, 0x18, 1, true) == NULL) {
|
||||
error_display(NULL, NULL, NULL, "Failed to create CIA installation thread.");
|
||||
|
||||
svcCloseHandle(installData->cancelEvent);
|
@ -71,7 +71,7 @@ typedef struct {
|
||||
typedef struct {
|
||||
void* data;
|
||||
|
||||
bool moveEmpty;
|
||||
bool copyEmpty;
|
||||
|
||||
bool finished;
|
||||
bool premature;
|
||||
@ -98,7 +98,7 @@ typedef struct {
|
||||
|
||||
bool (*resultError)(void* data, u32 index, Result res);
|
||||
bool (*ioError)(void* data, u32 index, int err);
|
||||
} move_data_info;
|
||||
} copy_data_info;
|
||||
|
||||
bool task_is_quit_all();
|
||||
void task_quit_all();
|
||||
@ -109,4 +109,4 @@ Handle task_populate_pending_titles(list_item* items, u32* count, u32 max);
|
||||
Handle task_populate_system_save_data(list_item* items, u32* count, u32 max);
|
||||
Handle task_populate_tickets(list_item* items, u32* count, u32 max);
|
||||
Handle task_populate_titles(list_item* items, u32* count, u32 max);
|
||||
Handle task_move_data(move_data_info* info);
|
||||
Handle task_copy_data(copy_data_info* info);
|
Loading…
x
Reference in New Issue
Block a user