修复搜索接口当设置搜索目录为‘/’时无法搜到内容的问题
This commit is contained in:
parent
4143c4ea5b
commit
a339b337eb
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue