Skip to content
This repository has been archived by the owner on Apr 2, 2020. It is now read-only.

Commit

Permalink
Removed useless stuff
Browse files Browse the repository at this point in the history
  • Loading branch information
FuryBaguette committed Apr 20, 2019
1 parent 7f261c2 commit ad9a8b0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 20 deletions.
17 changes: 2 additions & 15 deletions Source/MainLayout.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@ namespace ui
void MainLayout::GetFolders()
{
std::vector<std::string> gameFolders = utils::get_directories("sdmc:/emuiibo/");

if (gameFolders.empty())
mainapp->Close();
for (auto & element : gameFolders) {
std::size_t found = element.find_last_of("/\\");
std::string namePath = element.substr(found+1);
Expand All @@ -30,20 +31,6 @@ namespace ui
}
}

std::vector<amiibo::AmiiboFile *> MainLayout::GetEmuiibo()
{
std::vector<amiibo::AmiiboFile *> amiiboFiles;
utils::getFiles("sdmc:/emuiibo/", [&amiiboFiles](const std::string &path) {
std::size_t found1 = path.find_last_of("/\\");
std::string namePath1 = path.substr(found1+1);
namePath1.erase(namePath1.length() - 4);
amiibo::AmiiboFile *file = new amiibo::AmiiboFile(namePath1, path);

amiiboFiles.push_back(file);
});
return (amiiboFiles);
}

MainLayout::MainLayout()
{
if (!utils::IsEmuiiboPresent()) {
Expand Down
6 changes: 1 addition & 5 deletions Source/Utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,7 @@ namespace utils

void EnsureDirectories()
{
if (!IsEmuiiboPresent())
CreateDirectory("sdmc:/amiibos");
else
CreateDirectory("sdmc:/emuiibo");
CreateDirectory("sdmc:/emuiibo");
}

void getFiles(const std::string &path, std::function<void(const std::string &)> cb)
Expand Down Expand Up @@ -59,7 +56,6 @@ namespace utils

entry = readdir(dir);
}

closedir(dir);
return r;
}
Expand Down

0 comments on commit ad9a8b0

Please sign in to comment.