-
Notifications
You must be signed in to change notification settings - Fork 291
Show application locations matching Finder's behaviour #3128
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
danielcompton
wants to merge
4
commits into
quicksilver:main
Choose a base branch
from
danielcompton:claude/gifted-haslett-5d6265
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
4df1533
Add NSURL category for user-visible paths
danielcompton ffe38f0
Catalog apps at their user-visible path instead of cryptex backing path
danielcompton db84235
Show system applications at their Finder location
danielcompton b86cd69
Document the Additional Applications preset as a cryptex fallback
danielcompton File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
66 changes: 66 additions & 0 deletions
66
Quicksilver/Tests/Tests-QSFoundation/TestNSURLCanonicalPath.m
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| // | ||
| // TestNSURLCanonicalPath.m | ||
| // Quicksilver | ||
| // | ||
| // Tests for the NSURL (QSCanonicalPath) category (issue #3125) | ||
| // | ||
|
|
||
| #import <XCTest/XCTest.h> | ||
| #import "NSURL_BLTRExtensions.h" | ||
|
|
||
| @interface TestNSURLCanonicalPath : XCTestCase | ||
| @end | ||
|
|
||
| @implementation TestNSURLCanonicalPath | ||
|
|
||
| - (void)testRegularPathsAreUnchanged { | ||
| for (NSString *path in @[@"/Applications", NSHomeDirectory(), @"/usr/bin/yes"]) { | ||
| NSURL *url = [NSURL fileURLWithPath:path]; | ||
| XCTAssertEqualObjects([url URLByResolvingToUserVisiblePath].path, path); | ||
| XCTAssertEqualObjects([url URLByMappingSystemApplicationsToLocalDomain].path, path); | ||
| } | ||
| } | ||
|
|
||
| - (void)testNonexistentPathIsUnchanged { | ||
| NSURL *url = [NSURL fileURLWithPath:@"/Applications/QSDoesNotExist.app"]; | ||
| XCTAssertEqualObjects([url URLByResolvingToUserVisiblePath], url); | ||
| } | ||
|
|
||
| - (void)testNonFileURLIsUnchanged { | ||
| NSURL *url = [NSURL URLWithString:@"https://qsapp.com/"]; | ||
| XCTAssertEqualObjects([url URLByResolvingToUserVisiblePath], url); | ||
| XCTAssertEqualObjects([url URLByMappingSystemApplicationsToLocalDomain], url); | ||
| } | ||
|
|
||
| - (void)testCryptexBackedAppResolvesToUserVisiblePath { | ||
| // Safari ships in a cryptex; Launch Services and directory scans can | ||
| // report it at the backing location instead of the /Applications symlink | ||
| NSString *userVisiblePath = @"/Applications/Safari.app"; | ||
| NSFileManager *manager = [NSFileManager defaultManager]; | ||
| if (![manager fileExistsAtPath:userVisiblePath] | ||
| || ![manager fileExistsAtPath:@"/System/Cryptexes/App/System/Applications/Safari.app"]) { | ||
| XCTSkip(@"Safari is not cryptex-backed on this system"); | ||
| } | ||
| for (NSString *backingPath in @[@"/System/Volumes/Preboot/Cryptexes/App/System/Applications/Safari.app", | ||
| @"/System/Cryptexes/App/System/Applications/Safari.app"]) { | ||
| NSURL *resolved = [[NSURL fileURLWithPath:backingPath] URLByResolvingToUserVisiblePath]; | ||
| XCTAssertEqualObjects(resolved.path, userVisiblePath); | ||
| } | ||
| } | ||
|
|
||
| - (void)testSystemApplicationWithoutLocalCounterpart { | ||
| NSString *terminalPath = @"/System/Applications/Utilities/Terminal.app"; | ||
| if (![[NSFileManager defaultManager] fileExistsAtPath:terminalPath]) { | ||
| XCTSkip(@"Terminal.app is not in /System/Applications on this system"); | ||
| } | ||
| // The catalog mapping requires an existing file, so the real path is kept... | ||
| XCTAssertEqualObjects([[NSURL fileURLWithPath:terminalPath] URLByResolvingToUserVisiblePath].path, terminalPath); | ||
| // ...while the Finder-location mapping gives the /Applications location | ||
| XCTAssertEqualObjects([[NSURL fileURLWithPath:terminalPath] URLByMappingSystemApplicationsToLocalDomain].path, | ||
| @"/Applications/Utilities/Terminal.app"); | ||
| // Paths inside a bundle are never remapped | ||
| NSString *interiorPath = [terminalPath stringByAppendingPathComponent:@"Contents/Info.plist"]; | ||
| XCTAssertEqualObjects([[NSURL fileURLWithPath:interiorPath] URLByMappingSystemApplicationsToLocalDomain].path, interiorPath); | ||
| } | ||
|
|
||
| @end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.