A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Sort directories first in file picker

+4 -2
+4 -2
src/screens/FileSelectionScreen.cpp
··· 3 3 #include <EpdRenderer.h> 4 4 #include <SD.h> 5 5 6 - void caseInsensitiveSort(std::vector<std::string>& strs) { 6 + void sortFileList(std::vector<std::string>& strs) { 7 7 std::sort(begin(strs), end(strs), [](const std::string& str1, const std::string& str2) { 8 + if (str1.back() == '/' && str2.back() != '/') return true; 9 + if (str1.back() != '/' && str2.back() == '/') return false; 8 10 return lexicographical_compare( 9 11 begin(str1), end(str1), begin(str2), end(str2), 10 12 [](const char& char1, const char& char2) { return tolower(char1) < tolower(char2); }); ··· 35 37 file.close(); 36 38 } 37 39 root.close(); 38 - caseInsensitiveSort(files); 40 + sortFileList(files); 39 41 } 40 42 41 43 void FileSelectionScreen::onEnter() {