解决文件搜索接口在使用索引搜索根目录时无法搜到文件的问题

This commit is contained in:
iaom 2023-06-16 09:27:33 +08:00
parent ba52540c4e
commit b429a63a26
1 changed files with 1 additions and 1 deletions

View File

@ -365,7 +365,7 @@ bool FileSearchFilter::operator ()(const Xapian::Document &doc) const
if (!m_parent->m_validDirectories.empty()) {
inSearchDir = std::any_of(m_parent->m_validDirectories.begin(), m_parent->m_validDirectories.end(), [&](QString &dir) {
//限制搜索在该目录下
if (!path.startsWith(dir + "/")) {
if (dir != "/" && !path.startsWith(dir + "/")) {
return false;
}