Browse Source
Set isDirectory:true explicitly to help [NSURL fileURLWithPath] method (#16061)
Might solve some rare/random issues with initial directory not being applied
pull/16159/head
Max Katz
2 years ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
6 additions and
3 deletions
-
native/Avalonia.Native/src/OSX/SystemDialogs.mm
|
|
|
@ -94,7 +94,8 @@ public: |
|
|
|
if(initialDirectory != nullptr) |
|
|
|
{ |
|
|
|
auto directoryString = [NSString stringWithUTF8String:initialDirectory]; |
|
|
|
panel.directoryURL = [NSURL fileURLWithPath:directoryString]; |
|
|
|
panel.directoryURL = [NSURL fileURLWithPath:directoryString |
|
|
|
isDirectory:true]; |
|
|
|
} |
|
|
|
|
|
|
|
auto handler = ^(NSModalResponse result) { |
|
|
|
@ -169,7 +170,8 @@ public: |
|
|
|
if(initialDirectory != nullptr) |
|
|
|
{ |
|
|
|
auto directoryString = [NSString stringWithUTF8String:initialDirectory]; |
|
|
|
panel.directoryURL = [NSURL fileURLWithPath:directoryString]; |
|
|
|
panel.directoryURL = [NSURL fileURLWithPath:directoryString |
|
|
|
isDirectory:true]; |
|
|
|
} |
|
|
|
|
|
|
|
if(initialFile != nullptr) |
|
|
|
@ -248,7 +250,8 @@ public: |
|
|
|
if(initialDirectory != nullptr) |
|
|
|
{ |
|
|
|
auto directoryString = [NSString stringWithUTF8String:initialDirectory]; |
|
|
|
panel.directoryURL = [NSURL fileURLWithPath:directoryString]; |
|
|
|
panel.directoryURL = [NSURL fileURLWithPath:directoryString |
|
|
|
isDirectory:true]; |
|
|
|
} |
|
|
|
|
|
|
|
if(initialFile != nullptr) |
|
|
|
|