Merge pull request #224 from rookie-J/0506-dev

Fix blockpath uneffective problem
This commit is contained in:
fensite 2021-05-08 11:05:35 +08:00 committed by GitHub
commit 7598394fd6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 18 additions and 2 deletions

View File

@ -422,8 +422,24 @@ void DirectSearch::run() {
while(!bfs.empty()) {
dir.setPath(bfs.dequeue());
list = dir.entryInfoList();
for(auto i : list) {
if(i.isDir() && (!(i.isSymLink()))) {
for (auto i : list) {
if (i.isDir() && (!(i.isSymLink()))) {
bool findIndex = false;
QStringList blockList = GlobalSettings::getInstance()->getBlockDirs();
for (QString j : blockList) {
if (i.absoluteFilePath().startsWith(j.prepend("/"))) {
findIndex = true;
break;
}
}
if (findIndex == true) {
qDebug() << "path is blocked:" << i.absoluteFilePath();
continue;
}
bfs.enqueue(i.absoluteFilePath());
}
if(i.fileName().contains(m_keyword, Qt::CaseInsensitive)) {