Skip to content

Commit 385ebed

Browse files
committed
[FIX] : fix issue on UNIX. all files was displayed in lowercase, some problemes for open directory and all returned path could be invalids. (@jackm97, #41)
1 parent 97b9f52 commit 385ebed

2 files changed

Lines changed: 7 additions & 7 deletions

File tree

ImGuiFileDialog.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2150,17 +2150,17 @@ namespace IGFD
21502150

21512151
void IGFD::FileDialog::GetDrives()
21522152
{
2153-
auto res = GetDrivesList();
2154-
if (!res.empty())
2153+
auto drives = GetDrivesList();
2154+
if (!drives.empty())
21552155
{
21562156
m_CurrentPath.clear();
21572157
m_CurrentPath_Decomposition.clear();
21582158
m_FileList.clear();
2159-
for (auto& re : res)
2159+
for (auto& drive : drives)
21602160
{
21612161
FileInfoStruct infos;
2162-
infos.fileName = re;
2163-
infos.fileName_optimized = OptimizeFilenameForSearchOperations(re);
2162+
infos.fileName = drive;
2163+
infos.fileName_optimized = OptimizeFilenameForSearchOperations(drive);
21642164
infos.type = 'd';
21652165

21662166
if (!infos.fileName.empty())
@@ -2275,7 +2275,7 @@ namespace IGFD
22752275
}
22762276
}
22772277

2278-
std::string IGFD::FileDialog::OptimizeFilenameForSearchOperations(std::string& vFileName)
2278+
std::string IGFD::FileDialog::OptimizeFilenameForSearchOperations(std::string vFileName)
22792279
{
22802280
// convert to lower case
22812281
for (char& c : vFileName)

ImGuiFileDialog.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -839,7 +839,7 @@ namespace IGFD
839839
void GetDrives(); // list drives on windows platform
840840
void ParseFilters(const char* vFilters); // parse filter syntax, detect and parse filter collection
841841
void SetSelectedFilterWithExt(const std::string& vFilter); // select filter
842-
static std::string OptimizeFilenameForSearchOperations(std::string& vFileName); // easier the search by lower case all filenames
842+
static std::string OptimizeFilenameForSearchOperations(std::string vFileName); // easier the search by lower case all filenames
843843
void ApplyFilteringOnFileList(); // filter the file list accroding to the searh tags
844844
bool Confirm_Or_OpenOverWriteFileDialog_IfNeeded(bool vLastAction, ImGuiWindowFlags vFlags); // treatment of the result, start the confirm to overwrite dialog if needed (if defined with flag)
845845
bool IsFileExist(const std::string& vFile); // is file exist

0 commit comments

Comments
 (0)