Skip to content

Commit

Permalink
Default value for file browser’s “keep folders on top” now match Finder
Browse files Browse the repository at this point in the history
  • Loading branch information
sorbits committed Apr 16, 2021
1 parent 0fd87c1 commit 6d4b0ec
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 9 additions & 5 deletions Frameworks/FileBrowser/src/FileBrowserViewController.mm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,15 @@ @implementation FileBrowserViewController
+ (NSSet*)keyPathsForValuesAffectingCanGoBack { return [NSSet setWithObjects:@"historyIndex", nil]; }
+ (NSSet*)keyPathsForValuesAffectingCanGoForward { return [NSSet setWithObjects:@"historyIndex", nil]; }

+ (void)initialize
{
[NSApplication.sharedApplication registerServicesMenuSendTypes:@[ NSFilenamesPboardType, NSURLPboardType ] returnTypes:@[ ]];

[NSUserDefaults.standardUserDefaults registerDefaults:@{
kUserDefaultsFoldersOnTopKey: [[[NSUserDefaults alloc] initWithSuiteName:@"com.apple.finder"] objectForKey:@"_FXSortFoldersFirst"] ?: @NO,
}];
}

- (instancetype)init
{
if(self = [super init])
Expand Down Expand Up @@ -2215,11 +2224,6 @@ - (BOOL)previewPanel:(QLPreviewPanel*)previewPanel handleEvent:(NSEvent*)event
// = Services =
// ============

+ (void)initialize
{
[NSApplication.sharedApplication registerServicesMenuSendTypes:@[ NSFilenamesPboardType, NSURLPboardType ] returnTypes:@[ ]];
}

- (id)validRequestorForSendType:(NSString*)sendType returnType:(NSString*)returnType
{
return returnType == nil && sendType != nil && [@[ NSFilenamesPboardType, NSURLPboardType ] containsObject:sendType] ? self : nil;
Expand Down
1 change: 0 additions & 1 deletion Frameworks/Preferences/src/Keys.mm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@
return @{
kUserDefaultsHTMLOutputPlacementKey: @"window",
kUserDefaultsFileBrowserPlacementKey: @"right",
kUserDefaultsFoldersOnTopKey: @YES,
kUserDefaultsShowFileExtensionsKey: @NO,
kUserDefaultsEnvironmentVariablesKey: default_environment(),
kUserDefaultsDisableBundleUpdatesKey: @NO,
Expand Down

0 comments on commit 6d4b0ec

Please sign in to comment.