From 85a0ce47eed6295541cb5fb55192acd34c72c4f0 Mon Sep 17 00:00:00 2001 From: J-D-K Date: Wed, 1 Sep 2021 15:15:53 -0400 Subject: [PATCH] Separate folders for trash --- Makefile | 2 +- inc/data.h | 4 ++-- src/file.cpp | 7 ++++++- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/Makefile b/Makefile index 5f69c11..694bb29 100644 --- a/Makefile +++ b/Makefile @@ -38,7 +38,7 @@ INCLUDES := inc inc/ui EXEFS_SRC := exefs_src APP_TITLE := JKSV APP_AUTHOR := JK -APP_VERSION := 08.31.2021 +APP_VERSION := 09.01.2021 ROMFS := romfs ICON := icon.jpg diff --git a/inc/data.h b/inc/data.h index f0b5980..3f2c990 100644 --- a/inc/data.h +++ b/inc/data.h @@ -7,8 +7,8 @@ #include "gfx.h" -#define BLD_MON 8 -#define BLD_DAY 31 +#define BLD_MON 9 +#define BLD_DAY 1 #define BLD_YEAR 2021 namespace data diff --git a/src/file.cpp b/src/file.cpp index 0d3f21c..957b4c6 100644 --- a/src/file.cpp +++ b/src/file.cpp @@ -695,8 +695,13 @@ void fs::deleteBackup(void *a) t->status->setStatus("Deleting..."); if(cfg::config["trashBin"]) { + data::userTitleInfo *getTID = data::getCurrentUserTitleInfo(); + std::string oldPath = util::generatePathByTID(cd->tid) + itemName; - std::string trashPath = wd + "_TRASH_/" + itemName; + std::string trashPath = wd + "_TRASH_/" + data::getTitleSafeNameByTID(getTID->tid); + fs::mkDir(trashPath); + trashPath += "/" + itemName; + rename(oldPath.c_str(), trashPath.c_str()); ui::showPopMessage(POP_FRAME_DEFAULT, ui::getUICString("saveDataBackupMovedToTrash", 0), itemName.c_str()); }