mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
fix per comment
This commit is contained in:
parent
889c853e33
commit
ccc677fd8f
3 changed files with 21 additions and 25 deletions
|
|
@ -63,27 +63,17 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
SubTitle = $"Add the current {fileOrFolder} to Quick Access",
|
||||
Action = (context) =>
|
||||
{
|
||||
try
|
||||
{
|
||||
Settings.QuickAccessLinks.Add(new AccessLink { Path = record.FullPath, Type = record.Type });
|
||||
Settings.QuickAccessLinks.Add(new AccessLink { Path = record.FullPath, Type = record.Type });
|
||||
|
||||
Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess"),
|
||||
string.Format(
|
||||
Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess_detail"),
|
||||
fileOrFolder),
|
||||
Constants.ExplorerIconImageFullPath);
|
||||
Context.API.ShowMsg(Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess"),
|
||||
string.Format(
|
||||
Context.API.GetTranslation("plugin_explorer_addfilefoldersuccess_detail"),
|
||||
fileOrFolder),
|
||||
Constants.ExplorerIconImageFullPath);
|
||||
|
||||
ViewModel.Save();
|
||||
ViewModel.Save();
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception e)
|
||||
{
|
||||
var message = "Fail to add to Quick Access";
|
||||
LogException(message, e);
|
||||
Context.API.ShowMsg(message);
|
||||
return false;
|
||||
}
|
||||
return true;
|
||||
},
|
||||
IcoPath = Constants.QuickAccessImagePath
|
||||
});
|
||||
|
|
|
|||
|
|
@ -36,7 +36,10 @@ namespace Flow.Launcher.Plugin.Explorer
|
|||
|
||||
// as at v1.7.0 this is to maintain backwards compatibility, need to be removed afterwards.
|
||||
if (Settings.QuickFolderAccessLinks.Any())
|
||||
{
|
||||
Settings.QuickAccessLinks = Settings.QuickFolderAccessLinks;
|
||||
Settings.QuickFolderAccessLinks = null;
|
||||
}
|
||||
|
||||
contextMenu = new ContextMenu(Context, Settings, viewModel);
|
||||
searchManager = new SearchManager(Settings, Context);
|
||||
|
|
|
|||
|
|
@ -21,34 +21,37 @@ namespace Flow.Launcher.Plugin.Explorer.Search.QuickAccessLinks
|
|||
string search = query.Search.ToLower();
|
||||
|
||||
var queriedAccessLinks =
|
||||
accessLinks.Where(x => x.Nickname.StartsWith(search, StringComparison.OrdinalIgnoreCase));
|
||||
accessLinks
|
||||
.Where(x => x.Nickname.StartsWith(search, StringComparison.OrdinalIgnoreCase))
|
||||
.OrderBy(x => x.Type)
|
||||
.ThenBy(x => x.Nickname);
|
||||
|
||||
return queriedAccessLinks
|
||||
.Where(x => x.Type == ResultType.Folder)
|
||||
.Select(item =>
|
||||
resultManager.CreateFolderResult(item.Nickname, item.Path, item.Path, query))
|
||||
.OrderBy(x => x.Title)
|
||||
.Concat(
|
||||
queriedAccessLinks
|
||||
.Where(x => x.Type == ResultType.File)
|
||||
.Select(item =>
|
||||
resultManager.CreateFileResult(item.Path, query))
|
||||
.OrderBy(x => x.Title))
|
||||
resultManager.CreateFileResult(item.Path, query)))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
internal List<Result> AccessLinkListAll(Query query, List<AccessLink> accessLinks)
|
||||
=> accessLinks
|
||||
.OrderBy(x => x.Type)
|
||||
.ThenBy(x => x.Nickname)
|
||||
.Where(x => x.Type == ResultType.Folder)
|
||||
.Select(item =>
|
||||
resultManager.CreateFolderResult(item.Nickname, item.Path, item.Path, query))
|
||||
.OrderBy(x => x.Title)
|
||||
.Concat(
|
||||
accessLinks
|
||||
.OrderBy(x => x.Type)
|
||||
.ThenBy(x => x.Nickname)
|
||||
.Where(x => x.Type == ResultType.File)
|
||||
.Select(item =>
|
||||
resultManager.CreateFileResult(item.Path, query))
|
||||
.OrderBy(x => x.Title))
|
||||
resultManager.CreateFileResult(item.Path, query)))
|
||||
.ToList();
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue