Skip to content

Commit a9748ac

Browse files
committed
Code quality
1 parent 022b345 commit a9748ac

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Plugins/Flow.Launcher.Plugin.Explorer/Search/WindowsIndex/WindowsIndexSearchManager.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -82,14 +82,17 @@ private IAsyncEnumerable<SearchResult> WindowsIndexTopLevelFolderSearchAsync(
8282
return HandledEngineNotAvailableExceptionAsync();
8383
}
8484
}
85+
8586
public IAsyncEnumerable<SearchResult> SearchAsync(string search, CancellationToken token)
8687
{
8788
return WindowsIndexFilesAndFoldersSearchAsync(search, token: token);
8889
}
90+
8991
public IAsyncEnumerable<SearchResult> ContentSearchAsync(string plainSearch, string contentSearch, CancellationToken token)
9092
{
9193
return WindowsIndexFileContentSearchAsync(contentSearch, token);
9294
}
95+
9396
public IAsyncEnumerable<SearchResult> EnumerateAsync(string path, string search, bool recursive, CancellationToken token)
9497
{
9598
return WindowsIndexTopLevelFolderSearchAsync(search, path, recursive, token);
@@ -100,19 +103,17 @@ private IAsyncEnumerable<SearchResult> HandledEngineNotAvailableExceptionAsync()
100103
if (!Settings.WarnWindowsSearchServiceOff)
101104
return AsyncEnumerable.Empty<SearchResult>();
102105

103-
var api = Main.Context.API;
104-
105106
throw new EngineNotAvailableException(
106107
"Windows Index",
107-
api.GetTranslation("plugin_explorer_windowsSearchServiceFix"),
108-
api.GetTranslation("plugin_explorer_windowsSearchServiceNotRunning"),
108+
Main.Context.API.GetTranslation("plugin_explorer_windowsSearchServiceFix"),
109+
Main.Context.API.GetTranslation("plugin_explorer_windowsSearchServiceNotRunning"),
109110
Constants.WindowsIndexErrorImagePath,
110111
c =>
111112
{
112113
Settings.WarnWindowsSearchServiceOff = false;
113114

114115
// Clears the warning message so user is not mistaken that it has not worked
115-
api.ChangeQuery(string.Empty);
116+
Main.Context.API.ChangeQuery(string.Empty);
116117

117118
return ValueTask.FromResult(false);
118119
});

0 commit comments

Comments
 (0)