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

This commit is contained in:
iaom 2023-06-16 09:27:33 +08:00
parent 275f69dd3f
commit eb89486427
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;
}