-
-
Notifications
You must be signed in to change notification settings - Fork 455
Add save file with Explorer for quick access #315
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
Changes from all commits
85dee95
cab7f94
3a1d408
324ee62
c02fa4b
44b3f19
82d9184
dd57bfc
d90b6d2
9331c80
889c853
ccc677f
5773829
b71203c
8b698c4
c0f60e2
e615ad8
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| using System; | ||
| using System.Collections.Generic; | ||
| using System.Linq; | ||
|
|
||
| namespace Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks | ||
| { | ||
| public class QuickAccess | ||
| { | ||
| private readonly ResultManager resultManager; | ||
|
|
||
| public QuickAccess(PluginInitContext context) | ||
| { | ||
| resultManager = new ResultManager(context); | ||
| } | ||
|
|
||
| internal List<Result> AccessLinkListMatched(Query query, List<AccessLink> accessLinks) | ||
| { | ||
| if (string.IsNullOrEmpty(query.Search)) | ||
| return new List<Result>(); | ||
|
|
||
| string search = query.Search.ToLower(); | ||
|
|
||
| var queriedAccessLinks = | ||
| accessLinks | ||
| .Where(x => x.Nickname.StartsWith(search, StringComparison.OrdinalIgnoreCase)) | ||
| .OrderBy(x => x.Type) | ||
| .ThenBy(x => x.Nickname); | ||
|
|
||
| return queriedAccessLinks.Select(l => l.Type switch | ||
| { | ||
| ResultType.Folder => resultManager.CreateFolderResult(l.Nickname, l.Path, l.Path, query), | ||
| ResultType.File => resultManager.CreateFileResult(l.Path, query), | ||
| _ => throw new ArgumentOutOfRangeException() | ||
|
|
||
| }).ToList(); | ||
| } | ||
|
|
||
| internal List<Result> AccessLinkListAll(Query query, List<AccessLink> accessLinks) | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar to last one.
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Please use select with switch or if instead where twice and concat. I can do it for you if you want. |
||
| => accessLinks | ||
| .OrderBy(x => x.Type) | ||
| .ThenBy(x => x.Nickname) | ||
| .Select(l => l.Type switch | ||
| { | ||
| ResultType.Folder => resultManager.CreateFolderResult(l.Nickname, l.Path, l.Path, query), | ||
| ResultType.File => resultManager.CreateFileResult(l.Path, query), | ||
| _ => throw new ArgumentOutOfRangeException() | ||
|
|
||
| }).ToList(); | ||
| } | ||
| } | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please also remove QuickFolderAccessLinks so that it won't be saved via json.
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good pick up 👍
It needs to be loaded once, so I dont know how I can make it so it gets loaded but ignored when saving. Changed it so it's saved as empty list.