begin work on lister-flavored watch windows; begin on using that for the query ui

This commit is contained in:
Ryan Fleury
2025-02-19 08:37:34 -08:00
parent 73351b7550
commit 9805f8cd20
7 changed files with 711 additions and 581 deletions
+21
View File
@@ -547,6 +547,27 @@ os_properties_from_file_path(String8 path)
os_w32_dense_time_from_file_time(&props.modified, &find_data.ftLastWriteTime);
props.flags = os_w32_file_property_flags_from_dwFileAttributes(find_data.dwFileAttributes);
}
else
{
Temp scratch = scratch_begin(0, 0);
WCHAR buffer[512] = {0};
DWORD length = GetLogicalDriveStringsW(sizeof(buffer), buffer);
U64 last_slash_pos = str8_find_needle(path, 0, str8_lit("/"), StringMatchFlag_SlashInsensitive);
String8 path_trimmed = str8_prefix(path, last_slash_pos);
for(U64 off = 0; off < (U64)length;)
{
String16 next_drive_string_16 = str16_cstring((U16 *)buffer+off);
off += next_drive_string_16.size+1;
String8 next_drive_string = str8_from_16(scratch.arena, next_drive_string_16);
next_drive_string = str8_chop_last_slash(next_drive_string);
if(str8_match(path_trimmed, next_drive_string, StringMatchFlag_CaseInsensitive))
{
props.flags |= FilePropertyFlag_IsFolder;
break;
}
}
scratch_end(scratch);
}
FindClose(handle);
scratch_end(scratch);
return props;