Ask Everything for RunCount only if sorting by it

This commit is contained in:
TheBestPessimist 2023-03-08 13:00:00 +02:00 committed by TheBestPessimist
parent a1a4c720c0
commit fa971c6b81

View file

@ -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)
};