diff options
m--------- | release/scripts/addons | 0 | ||||
-rw-r--r-- | source/blender/editors/space_file/fsmenu.c | 17 |
2 files changed, 7 insertions, 10 deletions
diff --git a/release/scripts/addons b/release/scripts/addons -Subproject 5f3c703ea4b0f4651e4f28e682a91382a90a559 +Subproject eb9bab0e7153fda8de113af9e3c54eca74c986e diff --git a/source/blender/editors/space_file/fsmenu.c b/source/blender/editors/space_file/fsmenu.c index c7a139a8b24..7faa2b883f2 100644 --- a/source/blender/editors/space_file/fsmenu.c +++ b/source/blender/editors/space_file/fsmenu.c @@ -492,20 +492,17 @@ void fsmenu_read_system(struct FSMenu *fsmenu, int read_bookmarks) /* Flee from horrible win querying hover floppy drives! */ if (i > 1) { - /* Try to get volume label as well... */ + /* Try to get a friendly drive description. */ + SHFILEINFOW shFile = {0}; BLI_strncpy_wchar_from_utf8(wline, tmps, 4); - if (GetVolumeInformationW( - wline, wline + 4, FILE_MAXDIR - 4, NULL, NULL, NULL, NULL, 0)) { - size_t label_len; - - BLI_strncpy_wchar_as_utf8(line, wline + 4, FILE_MAXDIR - 4); - - label_len = MIN2(strlen(line), FILE_MAXDIR - 6); - BLI_snprintf(line + label_len, 6, " (%.2s)", tmps); - + if (SHGetFileInfoW(wline, 0, &shFile, sizeof(SHFILEINFOW), SHGFI_DISPLAYNAME)) { + BLI_strncpy_wchar_as_utf8(line, shFile.szDisplayName, FILE_MAXDIR); name = line; } } + if (name == NULL) { + name = tmps; + } fsmenu_insert_entry(fsmenu, FS_CATEGORY_SYSTEM, tmps, name, FS_INSERT_SORTED); } |