Fix showing folder contents in Finder

This commit is contained in:
2026-04-05 13:18:09 +02:00
parent 1d214b20e4
commit ec69c733ee
+10 -1
View File
@@ -133,7 +133,16 @@ bool MacFileSystem::ShowBrowseFolderDialog(Window* parentWindow, const StringVie
bool MacFileSystem::ShowFileExplorer(const StringView& path)
{
return [[NSWorkspace sharedWorkspace] selectFile: AppleUtils::ToNSString(FileSystem::ConvertRelativePathToAbsolute(path)) inFileViewerRootedAtPath: @""];
String fullPath = FileSystem::ConvertRelativePathToAbsolute(path);
NSString* selectFile = AppleUtils::ToNSString(fullPath);
NSString* inFileViewerRootedAtPath = AppleUtils::ToNSString(String::Empty);
if (FileSystem::GetExtension(fullPath).IsEmpty())
{
// Show folder contents
inFileViewerRootedAtPath = selectFile;
selectFile = nullptr;
}
return [[NSWorkspace sharedWorkspace] selectFile: selectFile inFileViewerRootedAtPath: inFileViewerRootedAtPath];
}
#endif