From: Damiano Galassi Date: Sat, 6 Apr 2019 10:28:19 +0000 (+0200) Subject: MacGui: reset destination folder if the current folder is not available. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=525de85e68b87d5fe4bcac68a711166446a99cf8;p=handbrake MacGui: reset destination folder if the current folder is not available. --- diff --git a/macosx/HBController.m b/macosx/HBController.m index dd69c6834..289c855e8 100644 --- a/macosx/HBController.m +++ b/macosx/HBController.m @@ -190,7 +190,7 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; _currentDestination = [[NSUserDefaults standardUserDefaults] URLForKey:@"HBLastDestinationDirectoryURL"]; #endif - if (!_currentDestination) + if (!_currentDestination || [[NSFileManager defaultManager] fileExistsAtPath:_currentDestination.path isDirectory:nil] == NO) { _currentDestination = [NSURL fileURLWithPath:[NSSearchPathForDirectoriesInDomains(NSMoviesDirectory, NSUserDomainMask, YES) firstObject] isDirectory:YES]; @@ -1054,7 +1054,8 @@ static void *HBControllerQueueCoreContext = &HBControllerQueueCoreContext; [alert setInformativeText:NSLocalizedString(@"This is not a valid destination directory!", @"Invalid destination alert -> informative text")]; [alert beginSheetModalForWindow:self.window completionHandler:handler]; } - else if ([job.fileURL isEqual:job.completeOutputURL]) + else if ([job.fileURL isEqual:job.completeOutputURL]|| + [job.fileURL.absoluteString.lowercaseString isEqualToString:job.completeOutputURL.absoluteString.lowercaseString]) { NSAlert *alert = [[NSAlert alloc] init]; [alert setMessageText:NSLocalizedString(@"A file already exists at the selected destination.", @"Destination same as source alert -> message")];