Skip to content

Commit

Permalink
refresh backup list for all the games with the same title id
Browse files Browse the repository at this point in the history
  • Loading branch information
BernardoGiordano committed Dec 23, 2017
1 parent 65225af commit 9075c4a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
2 changes: 1 addition & 1 deletion include/title.h
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,6 @@ size_t getTextureId(int i);

void loadFilter(void);
void loadTitles(void);
void refreshDirectories(size_t index);
void refreshDirectories(u64 id);

#endif
4 changes: 2 additions & 2 deletions source/fsstream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,7 @@ void backup(size_t index)
return;
}

refreshDirectories(index);
refreshDirectories(title.getId());
}
else
{
Expand Down Expand Up @@ -378,7 +378,7 @@ void backup(size_t index)

delete[] saveFile;
stream.close();
refreshDirectories(index);
refreshDirectories(title.getId());
}

createInfo("Success!", "Progress correctly saved to disk.");
Expand Down
18 changes: 15 additions & 3 deletions source/title.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -442,15 +442,27 @@ static void loadTextureIcon(smdh_s *smdh, size_t i) {
free(image);
}

void refreshDirectories(size_t i)
void refreshDirectories(u64 id)
{
const Mode_t mode = getMode();
if (mode == MODE_SAVE)
{
titleSaves.at(i).refreshDirectories();
for (size_t i = 0; i < titleSaves.size(); i++)
{
if (titleSaves.at(i).getId() == id)
{
titleSaves.at(i).refreshDirectories();
}
}
}
else
{
titleExtdatas.at(i).refreshDirectories();
for (size_t i = 0; i < titleExtdatas.size(); i++)
{
if (titleExtdatas.at(i).getId() == id)
{
titleExtdatas.at(i).refreshDirectories();
}
}
}
}

0 comments on commit 9075c4a

Please sign in to comment.