解决文件搜索接口在使用索引搜索根目录时无法搜到文件的问题
This commit is contained in:
parent
d1bf50859a
commit
7e296c325a
|
@ -365,7 +365,7 @@ bool FileSearchFilter::operator ()(const Xapian::Document &doc) const
|
||||||
if (!m_parent->m_validDirectories.empty()) {
|
if (!m_parent->m_validDirectories.empty()) {
|
||||||
inSearchDir = std::any_of(m_parent->m_validDirectories.begin(), m_parent->m_validDirectories.end(), [&](QString &dir) {
|
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;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue