Separate folders for trash

This commit is contained in:
J-D-K 2021-09-01 15:15:53 -04:00
parent ed77864455
commit 85a0ce47ee
3 changed files with 9 additions and 4 deletions

View File

@ -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

View File

@ -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

View File

@ -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());
}