]> granicus.if.org Git - handbrake/commitdiff
MacGui: specify is a path is a folder or not when creating an url.
authorDamiano Galassi <damiog@gmail.com>
Thu, 28 Mar 2019 11:23:30 +0000 (12:23 +0100)
committerDamiano Galassi <damiog@gmail.com>
Thu, 28 Mar 2019 11:23:30 +0000 (12:23 +0100)
macosx/HBPresetsViewController.m
macosx/HBSubtitlesController.m
macosx/HandBrakeKitTests/HBJobTests.m
macosx/HandBrakeKitTests/HBJobUndoTests.m

index 470776b9b383ba925d6ab7bf96388790e14a8dfb..5e1411cd1d20177e56fac4e6a80e122f22b55998 100644 (file)
@@ -159,7 +159,7 @@ static void *HBPresetsViewControllerContext = &HBPresetsViewControllerContext;
     panel.title = NSLocalizedString(@"Export presets", @"Export presets save panel title");
 
     // We get the current file name and path from the destination field here
-    NSURL *defaultExportDirectory = [[NSURL fileURLWithPath:NSHomeDirectory()] URLByAppendingPathComponent:@"Desktop"];
+    NSURL *defaultExportDirectory = [[NSURL fileURLWithPath:NSHomeDirectory()] URLByAppendingPathComponent:@"Desktop" isDirectory:YES];
     panel.directoryURL = defaultExportDirectory;
     panel.nameFieldStringValue = [NSString stringWithFormat:@"%@.json", selectedPreset.name];
 
@@ -190,7 +190,7 @@ static void *HBPresetsViewControllerContext = &HBPresetsViewControllerContext;
     }
     else
     {
-        panel.directoryURL = [[NSURL fileURLWithPath:NSHomeDirectory()] URLByAppendingPathComponent:@"Desktop"];
+        panel.directoryURL = [[NSURL fileURLWithPath:NSHomeDirectory()] URLByAppendingPathComponent:@"Desktop" isDirectory:YES];
     }
 
     [panel beginWithCompletionHandler:^(NSInteger result)
index b9c88e9400f22114d098032fde99b4392da9764c..58767d7e3098bfbd9c23179eb002fc4d8ee89f2e 100644 (file)
@@ -91,7 +91,7 @@
     }
     else
     {
-        sourceDirectory = [[NSURL fileURLWithPath:NSHomeDirectory()] URLByAppendingPathComponent:@"Desktop"];
+        sourceDirectory = [[NSURL fileURLWithPath:NSHomeDirectory()] URLByAppendingPathComponent:@"Desktop" isDirectory:YES];
     }
 
     panel.directoryURL = sourceDirectory;
index d4a91863d44aaf4c5a9fa010b87e60c3e4e966b9..9848bbe5ba495be42f33627f3b9925c8f9328bb8 100644 (file)
@@ -40,7 +40,7 @@
 
     self.preset = self.manager.defaultPreset;
 
-    NSURL *sampleURL = [NSURL fileURLWithPath:@"/test.mp4"];
+    NSURL *sampleURL = [NSURL fileURLWithPath:@"/test.mp4" isDirectory:NO];
 
     self.queue = dispatch_queue_create("fr.handbrake.testQueue", DISPATCH_QUEUE_SERIAL);
     dispatch_semaphore_t sem = dispatch_semaphore_create(0);
@@ -57,7 +57,7 @@
     self.title = self.core.titles.firstObject;
 
     self.job = [[HBJob alloc] initWithTitle:self.title andPreset:self.preset];
-    self.job.outputURL = [NSURL fileURLWithPath:@"/"];
+    self.job.outputURL = [NSURL fileURLWithPath:@"/" isDirectory:YES];
     self.job.outputFileName = @"Dest.mp4";
 }
 
@@ -83,7 +83,7 @@
 
     XCTAssertNotNil(self.job);
 
-    self.job.outputURL = [NSURL fileURLWithPath:@"/"];
+    self.job.outputURL = [NSURL fileURLWithPath:@"/" isDirectory:YES];
     self.job.outputFileName = @"Dest.mp4";
     [job applyPreset:preset];
 }
index ab2e5534f0acee9594a207ec1f8cde0bc00231f0..7ec26a130115f2507b023a930b352a1997010ca1 100644 (file)
@@ -41,7 +41,7 @@
 
     self.preset = self.manager.defaultPreset;
 
-    NSURL *sampleURL = [NSURL fileURLWithPath:@"/test.mp4"];
+    NSURL *sampleURL = [NSURL fileURLWithPath:@"/test.mp4" isDirectory:NO];
 
     self.queue = dispatch_queue_create("fr.handbrake.testQueue", DISPATCH_QUEUE_SERIAL);
     dispatch_semaphore_t sem = dispatch_semaphore_create(0);
@@ -58,7 +58,7 @@
     self.title = self.core.titles.firstObject;
 
     self.job = [[HBJob alloc] initWithTitle:self.title andPreset:self.preset];
-    self.job.outputURL = [NSURL fileURLWithPath:@"/"];
+    self.job.outputURL = [NSURL fileURLWithPath:@"/" isDirectory:YES];
     self.job.outputFileName = @"Dest.mp4";
 
     NSUndoManager *undoManager = [[NSUndoManager alloc] init];