@@ -525,8 +525,8 @@ class FileSystemStd : public IGFD::IFileSystem {
525525 std::wstring wpath = IGFD::Utils::UTF8Decode (a);
526526 if (GetVolumeInformationW (wpath.c_str (), szVolumeName, 2048 , nullptr , nullptr , nullptr , nullptr , 0 )) {
527527 path_name.second = IGFD::Utils::UTF8Encode (szVolumeName);
528+ res.push_back (path_name);
528529 }
529- res.push_back (path_name);
530530 }
531531 }
532532#endif // _IGFD_WIN_
@@ -719,8 +719,8 @@ class FileSystemDirent : public IGFD::IFileSystem {
719719 std::wstring wpath = IGFD::Utils::UTF8Decode (a);
720720 if (GetVolumeInformationW (wpath.c_str (), szVolumeName, 2048 , nullptr , nullptr , nullptr , nullptr , 0 )) {
721721 path_name.second = IGFD::Utils::UTF8Encode (szVolumeName);
722+ res.push_back (path_name);
722723 }
723- res.push_back (path_name);
724724 }
725725 }
726726#endif // _IGFD_WIN_
@@ -2148,19 +2148,19 @@ void IGFD::FileManager::m_OpenPathPopup(const FileDialogInternal& vFileDialogInt
21482148}
21492149
21502150bool IGFD::FileManager::GetDevices () {
2151- auto devices = m_FileSystemPtr->GetDevicesList ();
2151+ const auto devices = m_FileSystemPtr->GetDevicesList ();
21522152 if (!devices.empty ()) {
21532153 m_CurrentPath.clear ();
21542154 m_CurrentPathDecomposition.clear ();
21552155 ClearFileLists ();
2156- for (auto & drive : devices) {
2157- auto info_ptr = FileInfos::create ();
2158- info_ptr ->fileNameExt = drive.first ;
2159- info_ptr ->fileNameExt_optimized = Utils::LowerCaseString (drive.first );
2160- info_ptr ->deviceInfos = drive.second ;
2161- info_ptr ->fileType .SetContent (FileType::ContentType::Directory);
2162- if (!info_ptr ->fileNameExt .empty ()) {
2163- m_FileList.push_back (info_ptr );
2156+ for (const auto & drive : devices) {
2157+ auto pInfo = FileInfos::create ();
2158+ pInfo ->fileNameExt = drive.first ;
2159+ pInfo ->fileNameExt_optimized = Utils::LowerCaseString (drive.first );
2160+ pInfo ->deviceInfos = drive.second ;
2161+ pInfo ->fileType .SetContent (FileType::ContentType::Directory);
2162+ if (!pInfo ->fileNameExt .empty ()) {
2163+ m_FileList.push_back (pInfo );
21642164 showDevices = true ;
21652165 }
21662166 }
0 commit comments