@@ -467,8 +467,9 @@ class FileSystemStd : public IGFD::IFileSystem {
467467 }
468468 return res;
469469 }
470- std::vector<std::string> GetDrivesList () override {
471- std::vector<std::string> res;
470+
471+ std::vector<std::pair<std::string, std::string> > GetDevicesList () override {
472+ std::vector<std::pair<std::string, std::string> > res;
472473#ifdef _IGFD_WIN_
473474 const DWORD mydrives = 2048 ;
474475 char lpBuffer[2048 ];
@@ -478,7 +479,18 @@ class FileSystemStd : public IGFD::IFileSystem {
478479 if (countChars > 0U && countChars < 2049U ) {
479480 std::string var = std::string (lpBuffer, (size_t )countChars);
480481 IGFD::Utils::ReplaceString (var, " \\ " , " " );
481- res = IGFD::Utils::SplitStringToVector (var, ' \0 ' , false );
482+ auto arr = IGFD::Utils::SplitStringToVector (var, ' \0 ' , false );
483+ wchar_t szVolumeName[2048 ];
484+ std::pair<std::string, std::string> path_name;
485+ for (auto & a : arr) {
486+ path_name.first = a;
487+ path_name.second .clear ();
488+ std::wstring wpath = IGFD::Utils::UTF8Decode (a);
489+ if (GetVolumeInformationW (wpath.c_str (), szVolumeName, 2048 , NULL , NULL , NULL , NULL , 0 )) {
490+ path_name.second = IGFD::Utils::UTF8Encode (szVolumeName);
491+ }
492+ res.push_back (path_name);
493+ }
482494 }
483495#endif // _IGFD_WIN_
484496 return res;
@@ -623,8 +635,8 @@ class FileSystemDirent : public IGFD::IFileSystem {
623635 return res;
624636 }
625637
626- std::vector<std::string> GetDrivesList () override {
627- std::vector<std::string> res;
638+ std::vector<std::pair<std:: string, std::string>> GetDevicesList () override {
639+ std::vector<std::pair<std:: string, std::string> > res;
628640#ifdef _IGFD_WIN_
629641 const DWORD mydrives = 2048 ;
630642 char lpBuffer[2048 ];
@@ -634,7 +646,18 @@ class FileSystemDirent : public IGFD::IFileSystem {
634646 if (countChars > 0U && countChars < 2049U ) {
635647 std::string var = std::string (lpBuffer, (size_t )countChars);
636648 IGFD::Utils::ReplaceString (var, " \\ " , " " );
637- res = IGFD::Utils::SplitStringToVector (var, ' \0 ' , false );
649+ auto arr = IGFD::Utils::SplitStringToVector (var, ' \0 ' , false );
650+ wchar_t szVolumeName[2048 ];
651+ std::pair<std::string, std::string> path_name;
652+ for (auto & a : arr) {
653+ path_name.first = a;
654+ path_name.second .clear ();
655+ std::wstring wpath = IGFD::Utils::UTF8Decode (a);
656+ if (GetVolumeInformationW (wpath.c_str (), szVolumeName, 2048 , NULL , NULL , NULL , NULL , 0 )) {
657+ path_name.second = IGFD::Utils::UTF8Encode (szVolumeName);
658+ }
659+ res.push_back (path_name);
660+ }
638661 }
639662#endif // _IGFD_WIN_
640663 return res;
@@ -1971,15 +1994,16 @@ void IGFD::FileManager::m_OpenPathPopup(const FileDialogInternal& vFileDialogInt
19711994}
19721995
19731996bool IGFD::FileManager::GetDrives () {
1974- auto drives = m_FileSystemPtr->GetDrivesList ();
1997+ auto drives = m_FileSystemPtr->GetDevicesList ();
19751998 if (!drives.empty ()) {
19761999 m_CurrentPath.clear ();
19772000 m_CurrentPathDecomposition.clear ();
19782001 ClearFileLists ();
19792002 for (auto & drive : drives) {
19802003 auto info = std::make_shared<FileInfos>();
1981- info->fileNameExt = drive;
1982- info->fileNameExt_optimized = Utils::LowerCaseString (drive);
2004+ info->fileNameExt = drive.first ;
2005+ info->fileNameExt_optimized = Utils::LowerCaseString (drive.first );
2006+ info->deviceInfos = drive.second ;
19832007 info->fileType .SetContent (FileType::ContentType::Directory);
19842008
19852009 if (!info->fileNameExt .empty ()) {
@@ -4085,27 +4109,26 @@ void IGFD::FileDialog::m_DrawFileListView(ImVec2 vSize) {
40854109 ImGui::TableNextRow ();
40864110
40874111 column_id = 0 ;
4088- if (ImGui::TableNextColumn ()) // file name
4089- {
4112+ if (ImGui::TableNextColumn ()) { // file name
4113+ if (!infos->deviceInfos .empty ()) {
4114+ _str += " " + infos->deviceInfos ;
4115+ }
40904116 m_SelectableItem (i, infos, selected, _str.c_str ());
40914117 m_DisplayFileInfosTooltip (i, column_id++, infos);
40924118 }
4093- if (ImGui::TableNextColumn ()) // file type
4094- {
4119+ if (ImGui::TableNextColumn ()) { // file type
40954120 ImGui::Text (" %s" , infos->fileExtLevels [0 ].c_str ());
40964121 m_DisplayFileInfosTooltip (i, column_id++, infos);
40974122 }
4098- if (ImGui::TableNextColumn ()) // file size
4099- {
4123+ if (ImGui::TableNextColumn ()) { // file size
41004124 if (!infos->fileType .isDir ()) {
41014125 ImGui::Text (" %s " , infos->formatedFileSize .c_str ());
41024126 } else {
41034127 ImGui::TextUnformatted (" " );
41044128 }
41054129 m_DisplayFileInfosTooltip (i, column_id++, infos);
41064130 }
4107- if (ImGui::TableNextColumn ()) // file date + time
4108- {
4131+ if (ImGui::TableNextColumn ()) { // file date + time
41094132 ImGui::Text (" %s" , infos->fileModifDate .c_str ());
41104133 m_DisplayFileInfosTooltip (i, column_id++, infos);
41114134 }
@@ -4273,32 +4296,31 @@ void IGFD::FileDialog::m_DrawThumbnailsListView(ImVec2 vSize) {
42734296 ImGui::TableNextRow ();
42744297
42754298 column_id = 0 ;
4276- if (ImGui::TableNextColumn ()) // file name
4277- {
4299+ if (ImGui::TableNextColumn ()) { // file name
4300+ if (!infos->deviceInfos .empty ()) {
4301+ _str += " " + infos->deviceInfos ;
4302+ }
42784303 m_SelectableItem (i, infos, selected, _str.c_str ());
42794304 m_DisplayFileInfosTooltip (i, column_id++, infos);
42804305 }
4281- if (ImGui::TableNextColumn ()) // file type
4282- {
4306+ if (ImGui::TableNextColumn ())
4307+ { // file type
42834308 ImGui::Text (" %s" , infos->fileExtLevels [0 ].c_str ());
42844309 m_DisplayFileInfosTooltip (i, column_id++, infos);
42854310 }
4286- if (ImGui::TableNextColumn ()) // file size
4287- {
4311+ if (ImGui::TableNextColumn ()) { // file size
42884312 if (!infos->fileType .isDir ()) {
42894313 ImGui::Text (" %s " , infos->formatedFileSize .c_str ());
42904314 } else {
42914315 ImGui::TextUnformatted (" " );
42924316 }
42934317 m_DisplayFileInfosTooltip (i, column_id++, infos);
42944318 }
4295- if (ImGui::TableNextColumn ()) // file date + time
4296- {
4319+ if (ImGui::TableNextColumn ()) { // file date + time
42974320 ImGui::Text (" %s" , infos->fileModifDate .c_str ());
42984321 m_DisplayFileInfosTooltip (i, column_id++, infos);
42994322 }
4300- if (ImGui::TableNextColumn ()) // file thumbnails
4301- {
4323+ if (ImGui::TableNextColumn ()) { // file thumbnails
43024324 auto th = &infos->thumbnailInfo ;
43034325
43044326 if (!th->isLoadingOrLoaded ) {
0 commit comments