Skip to content

Commit

Permalink
Use URLWithString for pickers (#17594)
Browse files Browse the repository at this point in the history
  • Loading branch information
maxkatz6 committed Nov 26, 2024
1 parent fa36f52 commit 901efda
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions native/Avalonia.Native/src/OSX/StorageProvider.mm
Original file line number Diff line number Diff line change
Expand Up @@ -173,8 +173,7 @@ virtual void SelectFolderDialog (IAvnWindow* parentWindowHandle,
if(initialDirectory != nullptr)
{
auto directoryString = [NSString stringWithUTF8String:initialDirectory];
panel.directoryURL = [NSURL fileURLWithPath:directoryString
isDirectory:true];
panel.directoryURL = [NSURL URLWithString:directoryString];
}

auto handler = ^(NSModalResponse result) {
Expand Down Expand Up @@ -239,8 +238,7 @@ virtual void OpenFileDialog (IAvnWindow* parentWindowHandle,
if(initialDirectory != nullptr)
{
auto directoryString = [NSString stringWithUTF8String:initialDirectory];
panel.directoryURL = [NSURL fileURLWithPath:directoryString
isDirectory:true];
panel.directoryURL = [NSURL URLWithString:directoryString];
}

if(initialFile != nullptr)
Expand Down Expand Up @@ -309,8 +307,7 @@ virtual void SaveFileDialog (IAvnWindow* parentWindowHandle,
if(initialDirectory != nullptr)
{
auto directoryString = [NSString stringWithUTF8String:initialDirectory];
panel.directoryURL = [NSURL fileURLWithPath:directoryString
isDirectory:true];
panel.directoryURL = [NSURL URLWithString:directoryString];
}

if(initialFile != nullptr)
Expand Down

0 comments on commit 901efda

Please sign in to comment.