diff options
Diffstat (limited to 'macosx/HBJob.m')
-rw-r--r-- | macosx/HBJob.m | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/macosx/HBJob.m b/macosx/HBJob.m index 8c672445e..d90d95be0 100644 --- a/macosx/HBJob.m +++ b/macosx/HBJob.m @@ -166,6 +166,25 @@ NSString *HBChaptersChangedNotification = @"HBChaptersChangedNotification"; _outputFileName = [outputFileName copy]; } +- (BOOL)validateOutputFileName:(id *)ioValue error:(NSError * __autoreleasing *)outError +{ + BOOL retval = YES; + + if (nil != *ioValue) + { + NSString *value = *ioValue; + + if ([value rangeOfString:@"/"].location != NSNotFound) + { + *outError = [NSError errorWithDomain:@"HBError" code:0 userInfo:@{NSLocalizedDescriptionKey: NSLocalizedString(@"Invalid name", nil), + NSLocalizedRecoverySuggestionErrorKey: NSLocalizedString(@"The file name can't contain the / character.", nil)}]; + return NO; + } + } + + return retval; +} + - (NSURL *)completeOutputURL { return [self.outputURL URLByAppendingPathComponent:self.outputFileName]; |