Skip to content

Commit

Permalink
Separate folders for trash
Browse files Browse the repository at this point in the history
  • Loading branch information
J-D-K committed Sep 1, 2021
1 parent ed77864 commit 85a0ce4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 2 additions & 2 deletions inc/data.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
7 changes: 6 additions & 1 deletion src/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 85a0ce4

Please sign in to comment.