mirror of
https://github.com/Flow-Launcher/Flow.Launcher.git
synced 2026-03-11 08:54:32 +00:00
Make ResultManager static
This commit is contained in:
parent
327ee2d091
commit
08a3215c9d
4 changed files with 12 additions and 12 deletions
|
|
@ -64,7 +64,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo
|
|||
}
|
||||
}
|
||||
|
||||
results.Add(new ResultManager().CreateOpenCurrentFolderResult(incompleteName, search));
|
||||
results.Add(ResultManager.CreateOpenCurrentFolderResult(incompleteName, search));
|
||||
|
||||
incompleteName += "*";
|
||||
|
||||
|
|
@ -97,11 +97,11 @@ namespace Flow.Launcher.Plugin.Explorer.Search.DirectoryInfo
|
|||
if (searchOption == SearchOption.AllDirectories)
|
||||
folderSubtitleString = fileSystemInfo.FullName;
|
||||
|
||||
folderList.Add(new ResultManager().CreateFolderResult(fileSystemInfo.Name, folderSubtitleString, fileSystemInfo.FullName, query));
|
||||
folderList.Add(ResultManager.CreateFolderResult(fileSystemInfo.Name, folderSubtitleString, fileSystemInfo.FullName, query));
|
||||
}
|
||||
else
|
||||
{
|
||||
fileList.Add(new ResultManager().CreateFileResult(fileSystemInfo.FullName, query));
|
||||
fileList.Add(ResultManager.CreateFileResult(fileSystemInfo.FullName, query));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -62,7 +62,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
{
|
||||
var expandedPath = environmentVariables[search];
|
||||
|
||||
results.Add(new ResultManager().CreateFolderResult($"%{search}%", expandedPath, expandedPath, query));
|
||||
results.Add(ResultManager.CreateFolderResult($"%{search}%", expandedPath, expandedPath, query));
|
||||
|
||||
return results;
|
||||
}
|
||||
|
|
@ -81,7 +81,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
{
|
||||
if (p.Key.StartsWith(search))
|
||||
{
|
||||
results.Add(new ResultManager().CreateFolderResult($"%{p.Key}%", p.Value, p.Value, query));
|
||||
results.Add(ResultManager.CreateFolderResult($"%{p.Key}%", p.Value, p.Value, query));
|
||||
}
|
||||
}
|
||||
return results;
|
||||
|
|
|
|||
|
|
@ -16,7 +16,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search.QuickFolderLinks
|
|||
var userFolderLinks = folderLinks.Where(
|
||||
x => x.Nickname.StartsWith(search, StringComparison.OrdinalIgnoreCase));
|
||||
var results = userFolderLinks.Select(item =>
|
||||
new ResultManager().CreateFolderResult(item.Nickname, Constants.DefaultFolderSubtitleString, item.Path, query)).ToList();
|
||||
ResultManager.CreateFolderResult(item.Nickname, Constants.DefaultFolderSubtitleString, item.Path, query)).ToList();
|
||||
return results;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -9,9 +9,9 @@ using System.Windows;
|
|||
|
||||
namespace Flow.Launcher.Plugin.Explorer.Search
|
||||
{
|
||||
public class ResultManager
|
||||
internal static class ResultManager
|
||||
{
|
||||
public Result CreateFolderResult(string title, string subtitle, string path, Query query)
|
||||
internal static Result CreateFolderResult(string title, string subtitle, string path, Query query)
|
||||
{
|
||||
return new Result
|
||||
{
|
||||
|
|
@ -45,7 +45,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
};
|
||||
}
|
||||
|
||||
public Result CreateOpenCurrentFolderResult(string incompleteName, string search)
|
||||
internal static Result CreateOpenCurrentFolderResult(string incompleteName, string search)
|
||||
{
|
||||
var firstResult = "Open current directory";
|
||||
if (incompleteName.Length > 0)
|
||||
|
|
@ -68,7 +68,7 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
};
|
||||
}
|
||||
|
||||
public Result CreateFileResult(string filePath, Query query)
|
||||
internal static Result CreateFileResult(string filePath, Query query)
|
||||
{
|
||||
var result = new Result
|
||||
{
|
||||
|
|
@ -95,13 +95,13 @@ namespace Flow.Launcher.Plugin.Explorer.Search
|
|||
}
|
||||
}
|
||||
|
||||
public class SearchResult
|
||||
internal class SearchResult
|
||||
{
|
||||
public string FullPath { get; set; }
|
||||
public ResultType Type { get; set; }
|
||||
}
|
||||
|
||||
public enum ResultType
|
||||
internal enum ResultType
|
||||
{
|
||||
Volume,
|
||||
Folder,
|
||||
|
|
|
|||
Loading…
Reference in a new issue