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

This commit is contained in:
iaom 2021-09-15 14:47:08 +08:00
parent dc6c7625f6
commit 9998b87f29
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() { void DirectSearch::run() {
QStringList blockList = GlobalSettings::getInstance()->getBlockDirs();
if(blockList.contains(QStandardPaths::writableLocation(QStandardPaths::HomeLocation).remove(0,1), Qt::CaseSensitive)) {
return;
}
QQueue<QString> bfs; QQueue<QString> bfs;
bfs.enqueue(QStandardPaths::writableLocation(QStandardPaths::HomeLocation)); bfs.enqueue(QStandardPaths::writableLocation(QStandardPaths::HomeLocation));
QFileInfoList list; QFileInfoList list;
@ -421,7 +425,7 @@ void DirectSearch::run() {
// QDir::Hidden // QDir::Hidden
dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot); dir.setFilter(QDir::Dirs | QDir::Files | QDir::NoDotAndDotDot);
dir.setSorting(QDir::DirsFirst); dir.setSorting(QDir::DirsFirst);
QStringList blockList = GlobalSettings::getInstance()->getBlockDirs();
while(!bfs.empty()) { while(!bfs.empty()) {
dir.setPath(bfs.dequeue()); dir.setPath(bfs.dequeue());
list = dir.entryInfoList(); list = dir.entryInfoList();