Merge branch '0811-dev' into 'dev-unity'

Fix: Black list wont't work when block home location.

See merge request kylin-desktop/ukui-search!139
This commit is contained in:
纪笑旭 2021-09-15 06:50:01 +00:00
commit dc5cfce2f6
1 changed files with 5 additions and 1 deletions

View File

@ -414,6 +414,10 @@ DirectSearch::DirectSearch(QString keyword, QQueue<QString> *searchResultFile, Q
}
void DirectSearch::run() {
QStringList blockList = GlobalSettings::getInstance()->getBlockDirs();
if(blockList.contains(QStandardPaths::writableLocation(QStandardPaths::HomeLocation).remove(0,1), Qt::CaseSensitive)) {
return;
}
QQueue<QString> bfs;
bfs.enqueue(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
QFileInfoList list;
@ -421,7 +425,7 @@ void DirectSearch::run() {
// QDir::Hidden
dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
dir.setSorting(QDir::DirsFirst);
QStringList blockList = GlobalSettings::getInstance()->getBlockDirs();
while(!bfs.empty()) {
dir.setPath(bfs.dequeue());
list = dir.entryInfoList();