#5250 use Documents as default save location

This commit is contained in:
Maxim Nikolenko
2026-01-14 22:59:05 +02:00
committed by GitHub
parent 3ad887763b
commit 87f7d37e43
+6 -1
View File
@@ -241,8 +241,13 @@ void doSaveDialogModeless(const std::string* file,
NSURL* url = [NSURL fileURLWithPath:fileName];
[panel setNameFieldStringValue: fileName];
[panel setDirectoryURL: url];
NSURL *last_url = [[NSUserDefaults standardUserDefaults] URLForKey:@"NSNavLastRootDirectory"];
if(!last_url)
{
NSURL *documents_url = [[NSFileManager defaultManager] URLsForDirectory:NSDocumentDirectory inDomains:NSUserDomainMask].firstObject;
[panel setDirectoryURL:documents_url];
}
[panel beginWithCompletionHandler:^(NSModalResponse result)
{