From 6fda4b06d9fc82a61b6c1aaa0df6b9e20d8e26ed Mon Sep 17 00:00:00 2001 From: TheFloW Date: Sun, 28 Aug 2016 00:50:02 +0200 Subject: [PATCH] Fixed unchanged renaming error of files. Added file list refresh on app resume. --- main.c | 20 ++++++++++++++++---- resources/english_us.txt | 2 +- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/main.c b/main.c index 9ff80f56..9e3671aa 100644 --- a/main.c +++ b/main.c @@ -859,16 +859,19 @@ int dialogSteps() { if (name[0] == '\0') { dialog_step = DIALOG_STEP_NONE; } else { - addEndSlash(name); - FileListEntry *file_entry = fileListGetNthEntry(&file_list, base_pos + rel_pos); - if (strcmp(file_entry->name, name) == 0) { // No change + + char old_name[MAX_NAME_LENGTH]; + strcpy(old_name, file_entry->name); + removeEndSlash(old_name); + + if (strcmp(old_name, name) == 0) { // No change dialog_step = DIALOG_STEP_NONE; } else { char old_path[MAX_PATH_LENGTH]; char new_path[MAX_PATH_LENGTH]; - snprintf(old_path, MAX_PATH_LENGTH, "%s%s", file_list.path, file_entry->name); + snprintf(old_path, MAX_PATH_LENGTH, "%s%s", file_list.path, old_name); snprintf(new_path, MAX_PATH_LENGTH, "%s%s", file_list.path, name); int res = sceIoRename(old_path, new_path); @@ -1090,6 +1093,15 @@ int shellMain() { refresh = dialogSteps(); } + // Receive system event + SceAppMgrSystemEvent event; + sceAppMgrReceiveSystemEvent(&event); + + // Refresh on app resume + if (event.systemEvent == SCE_APPMGR_SYSTEMEVENT_ON_RESUME) { + refresh = 1; + } + if (refresh) { // Refresh lists refreshFileList(); diff --git a/resources/english_us.txt b/resources/english_us.txt index 1b442ce8..c9543cf0 100644 --- a/resources/english_us.txt +++ b/resources/english_us.txt @@ -26,7 +26,7 @@ DELETE_FILE_QUESTION = "Are you sure you want to delete this fil DELETE_FOLDER_QUESTION = "Are you sure you want to delete this folder?" DELETE_FILES_FOLDERS_QUESTION = "Are you sure you want to delete these files/folders?" INSTALL_QUESTION = "Do you want to install this package?" -INSTALL_WARNING = "This package requests advanced access to the\system.\It will have access to your personal information.\If you did not obtain it from a trusted source,\please proceed at your own caution.\\Would you like to continue the install?" +INSTALL_WARNING = "This package requests extended permissions.\It will have access to your personal information.\If you did not obtain it from a trusted source,\please proceed at your own caution.\\Would you like to continue the install?" SAVE_MODIFICATIONS = "Do you want to save your modifications?" WIFI_ERROR = "You must use Wi-Fi to do this." FTP_SERVER = "FTP server is now running at\ftp://%s:%i\\Press 'OK' to keep it in background.\Press 'Cancel' to disconnect." \ No newline at end of file