]> granicus.if.org Git - handbrake/commitdiff
MacGui: always use the last selected source parent directory for the open panel.
authorDamiano Galassi <damiog@gmail.com>
Mon, 2 Jan 2017 13:38:51 +0000 (14:38 +0100)
committerDamiano Galassi <damiog@gmail.com>
Mon, 2 Jan 2017 13:40:59 +0000 (14:40 +0100)
(cherry picked from commit d6d633ac7b386b9c0ca70efa0ba93fcd45221d08)

macosx/HBController.m

index ae165cd34d8bb954099ce81ae0620ba61e5436ea..4a7605c613d18ef0c23b017b9f39b120cfeab199 100644 (file)
     {
          if (result == NSFileHandlingPanelOKButton)
          {
-             // Check if we selected a folder or not
-             id outValue = nil;
-             [panel.URL getResourceValue:&outValue forKey:NSURLIsDirectoryKey error:NULL];
-
-             // we set the last searched source directory in the prefs here
-             if ([outValue boolValue])
-             {
-                 [[NSUserDefaults standardUserDefaults] setURL:panel.URL forKey:@"HBLastSourceDirectoryURL"];
-             }
-             else
-             {
-                 [[NSUserDefaults standardUserDefaults] setURL:panel.URL.URLByDeletingLastPathComponent forKey:@"HBLastSourceDirectoryURL"];
-             }
+             // Set the last searched source directory in the prefs here
+            [[NSUserDefaults standardUserDefaults] setURL:panel.URL.URLByDeletingLastPathComponent forKey:@"HBLastSourceDirectoryURL"];
 
              NSInteger titleIdx = self.scanSpecificTitle ? self.scanSpecificTitleIdx : 0;
              [self openURL:panel.URL titleIndex:titleIdx];