From e554789059cf507b1f0a855f1f6c2bf92dacba2d Mon Sep 17 00:00:00 2001 From: zhangpengfei Date: Mon, 11 Jan 2021 20:49:42 +0800 Subject: [PATCH] Modified mode of search thread exit. --- libsearch/index/file-searcher.cpp | 39 +++++++++++++++---------------- libsearch/index/file-searcher.h | 4 ++-- src/main.cpp | 2 +- 3 files changed, 22 insertions(+), 23 deletions(-) diff --git a/libsearch/index/file-searcher.cpp b/libsearch/index/file-searcher.cpp index e4e3ef4..1831639 100644 --- a/libsearch/index/file-searcher.cpp +++ b/libsearch/index/file-searcher.cpp @@ -120,7 +120,10 @@ int FileSearcher::keywordSearchfile(size_t uniqueSymbol, QString keyword, QStrin Xapian::MSet result = enquire.get_mset(begin, begin+num); int resultCount = static_cast(result.get_matches_estimated()); qDebug()<< "find results count=" <(result.get_matches_estimated()); + if(result.size() == 0) + return 0; qDebug()<< "find results count=" <