forked from openkylin/ukui-search
Merge branch 'ukss-dev' into 'ukss-dev'
去掉不需要的黑名单判断代码 See merge request kylin-desktop/ukui-search!297
This commit is contained in:
commit
8ada095f21
|
@ -89,17 +89,17 @@ void FileSearchWorker::run()
|
|||
|
||||
Xapian::Query FileSearchWorker::creatQueryForFileSearch() {
|
||||
Xapian::Query fileOrDir = Xapian::Query::MatchAll;
|
||||
if (!m_searchController->isSearchDirOnly() || !m_searchController->isSearchFileOnly()) {
|
||||
if (m_searchController->isSearchDirOnly() && m_searchController->isSearchFileOnly()) {
|
||||
//同时指定'只搜索目录'和'只搜索文件',那麼拒絕搜索
|
||||
return {};
|
||||
|
||||
} else {
|
||||
if (m_searchController->isSearchDirOnly()) {
|
||||
fileOrDir = Xapian::Query(Xapian::Query::OP_VALUE_RANGE, 1, "1", "1");
|
||||
|
||||
} else if (m_searchController->isSearchFileOnly()) {
|
||||
fileOrDir = Xapian::Query(Xapian::Query::OP_VALUE_RANGE, 1, "0", "0");
|
||||
}
|
||||
|
||||
} else {
|
||||
//同时指定只搜索目录和只搜索文件。。。
|
||||
return {};
|
||||
}
|
||||
|
||||
std::vector<Xapian::Query> queries;
|
||||
|
@ -240,11 +240,7 @@ bool FileSearchFilter::operator ()(const Xapian::Document &doc) const
|
|||
return true;
|
||||
});
|
||||
|
||||
bool inBlackList = std::any_of(parent->m_blackList.begin(), parent->m_blackList.end(), [&](QString &dir) {
|
||||
return path.startsWith(dir);
|
||||
});
|
||||
|
||||
return inSearchDir && !inBlackList;
|
||||
return inSearchDir;
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in New Issue