From fa971c6b81eb683dbce54c638b28ba6a011ff261 Mon Sep 17 00:00:00 2001 From: TheBestPessimist Date: Wed, 8 Mar 2023 13:00:00 +0200 Subject: [PATCH] Ask Everything for RunCount only if sorting by it --- .../Search/Everything/EverythingAPI.cs | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs index 579c5075f..32fbaee61 100644 --- a/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs +++ b/Plugins/Flow.Launcher.Plugin.Explorer/Search/Everything/EverythingAPI.cs @@ -115,8 +115,16 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything EverythingApiDllImport.Everything_SetSort(option.SortOption); EverythingApiDllImport.Everything_SetMatchPath(option.IsFullPathSearch); + + if (option.SortOption == SortOption.RUN_COUNT_DESCENDING) + { + EverythingApiDllImport.Everything_SetRequestFlags(EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME | EVERYTHING_REQUEST_RUN_COUNT); + } + else + { + EverythingApiDllImport.Everything_SetRequestFlags(EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME); + } - EverythingApiDllImport.Everything_SetRequestFlags(EVERYTHING_REQUEST_FULL_PATH_AND_FILE_NAME | EVERYTHING_REQUEST_RUN_COUNT); // todo need flag for this? if (token.IsCancellationRequested) yield break; @@ -143,7 +151,6 @@ namespace Flow.Launcher.Plugin.Explorer.Search.Everything Type = EverythingApiDllImport.Everything_IsFolderResult(idx) ? ResultType.Folder : EverythingApiDllImport.Everything_IsFileResult(idx) ? ResultType.File : ResultType.Volume, - // todo need flag for this? Score = (int)EverythingApiDllImport.Everything_GetResultRunCount( (uint)idx) };