Sort remote file lists alphabetically

This commit is contained in:
Huntereb 2020-01-03 11:35:08 -05:00
parent db061e81ec
commit 424a52a3d8
3 changed files with 4 additions and 3 deletions

View file

@ -6,6 +6,7 @@ namespace inst::util {
void deinitApp ();
void initInstallServices();
void deinitInstallServices();
bool ignoreCaseCompare(const std::string &a, const std::string &b);
std::vector<std::filesystem::path> getDirectoryFiles(const std::string & dir, const std::vector<std::string> & extensions);
std::vector<std::filesystem::path> getDirsAtPath(const std::string & dir);
bool removeDirectory(std::string dir);

View file

@ -282,6 +282,7 @@ namespace netInstStuff{
std::string segment;
while (std::getline(urlStream, segment, '\n')) urls.push_back(segment);
std::sort(urls.begin(), urls.end(), inst::util::ignoreCaseCompare);
break;
}

View file

@ -70,9 +70,8 @@ namespace usbInstStuff {
// Split the string up into individual title names
std::stringstream titleNamesStream(titleListBuf.get());
std::string segment;
while (std::getline(titleNamesStream, segment, '\n')) {
titleNames.push_back(segment);
}
while (std::getline(titleNamesStream, segment, '\n')) titleNames.push_back(segment);
std::sort(titleNames.begin(), titleNames.end(), inst::util::ignoreCaseCompare);
return titleNames;
}