mirror of
https://github.com/microsoft/PowerToys.git
synced 2026-04-07 19:57:07 +02:00
Add find file plugin.
This commit is contained in:
@@ -85,22 +85,19 @@ namespace Wox.Infrastructure.MFTSearch
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public List<USNRecord> FindByName(string filename, out long foundFileCnt, out long fountFolderCnt)
|
||||
public List<USNRecord> FindByName(string filename)
|
||||
{
|
||||
|
||||
filename = filename.ToLower();
|
||||
var fileQuery = from filesInVolumeDic in _volumes_files.Values
|
||||
from eachFilePair in filesInVolumeDic
|
||||
where eachFilePair.Value.Name.Contains(filename)
|
||||
where eachFilePair.Value.Name.ToLower().Contains(filename)
|
||||
select eachFilePair.Value;
|
||||
|
||||
var folderQuery = from fldsInVolumeDic in _volumes_folders.Values
|
||||
from eachFldPair in fldsInVolumeDic
|
||||
where eachFldPair.Value.Name.Contains(filename)
|
||||
where eachFldPair.Value.Name.ToLower().Contains(filename)
|
||||
select eachFldPair.Value;
|
||||
|
||||
foundFileCnt = fileQuery.Count();
|
||||
fountFolderCnt = folderQuery.Count();
|
||||
|
||||
List<USNRecord> result = new List<USNRecord>();
|
||||
|
||||
result.AddRange(fileQuery);
|
||||
|
||||
Reference in New Issue
Block a user