修复搜索接口当设置搜索目录为‘/’时无法搜到内容的问题

This commit is contained in:
iaom 2023-04-07 10:20:43 +08:00
parent 4143c4ea5b
commit a339b337eb
2 changed files with 2 additions and 2 deletions

View File

@ -94,7 +94,7 @@ void FileContentSearchWorker::run()
searchDirs.removeDuplicates();
for (QString &dir : searchDirs) {
if (dir.endsWith("/")) {
if (dir.endsWith("/") && dir != "/") {
dir = dir.mid(0, dir.length() - 1);
}

View File

@ -73,7 +73,7 @@ void FileSearchWorker::run()
for (QString &dir : searchDirs) {
if (QFileInfo::exists(dir)) {
if (dir.endsWith("/")) {
if (dir.endsWith("/") && dir != "/") {
dir.remove(dir.length() - 1, 1);
}