From 187966b0e07e1281f804b0fe1f021769923755d1 Mon Sep 17 00:00:00 2001 From: aiekick Date: Mon, 19 Feb 2024 22:24:40 +0100 Subject: [PATCH] [IMP] : improvment of device view. add the device name displayed only --- FileSystemBoost.hpp | 18 +++++++++++++++--- ImGuiFileDialog | 2 +- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/FileSystemBoost.hpp b/FileSystemBoost.hpp index 9ef26ec..3c88d01 100644 --- a/FileSystemBoost.hpp +++ b/FileSystemBoost.hpp @@ -82,8 +82,9 @@ class FileSystemBoost : public IGFD::IFileSystem { } return res; } - std::vector GetDrivesList() override { - std::vector res; + + std::vector> GetDevicesList() override { + std::vector> res; #ifdef _IGFD_WIN_ const DWORD mydrives = 2048; char lpBuffer[2048]; @@ -93,7 +94,18 @@ class FileSystemBoost : public IGFD::IFileSystem { if (countChars > 0U && countChars < 2049U) { std::string var = std::string(lpBuffer, (size_t)countChars); IGFD::Utils::ReplaceString(var, "\\", ""); - res = IGFD::Utils::SplitStringToVector(var, '\0', false); + auto arr = IGFD::Utils::SplitStringToVector(var, '\0', false); + wchar_t szVolumeName[2048]; + std::pair path_name; + for (auto& a : arr) { + path_name.first = a; + path_name.second.clear(); + std::wstring wpath = IGFD::Utils::UTF8Decode(a); + if (GetVolumeInformationW(wpath.c_str(), szVolumeName, 2048, NULL, NULL, NULL, NULL, 0)) { + path_name.second = IGFD::Utils::UTF8Encode(szVolumeName); + } + res.push_back(path_name); + } } #endif // _IGFD_WIN_ return res; diff --git a/ImGuiFileDialog b/ImGuiFileDialog index bb6809a..d00c1cb 160000 --- a/ImGuiFileDialog +++ b/ImGuiFileDialog @@ -1 +1 @@ -Subproject commit bb6809ac4fcf32a5485a9cc6925acf3262ff304f +Subproject commit d00c1cbbd3eb26258995f87beca2c89e89d30b28