Skip to content

Commit

Permalink
Fixed unchanged renaming error of files. Added file list refresh on a…
Browse files Browse the repository at this point in the history
…pp resume.
  • Loading branch information
TheOfficialFloW committed Aug 27, 2016
1 parent 4a605d1 commit 6fda4b0
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 5 deletions.
20 changes: 16 additions & 4 deletions main.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion resources/english_us.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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."

0 comments on commit 6fda4b0

Please sign in to comment.