diff options
Diffstat (limited to 'tools/assistant/lib/qhelpsearchindexreader_default.cpp')
-rw-r--r-- | tools/assistant/lib/qhelpsearchindexreader_default.cpp | 57 |
1 files changed, 9 insertions, 48 deletions
diff --git a/tools/assistant/lib/qhelpsearchindexreader_default.cpp b/tools/assistant/lib/qhelpsearchindexreader_default.cpp index 86c1b6d..df3d9a9 100644 --- a/tools/assistant/lib/qhelpsearchindexreader_default.cpp +++ b/tools/assistant/lib/qhelpsearchindexreader_default.cpp @@ -1,7 +1,6 @@ /**************************************************************************** ** ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). -** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the Qt Assistant of the Qt Toolkit. @@ -21,9 +20,10 @@ ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** -** In addition, as a special exception, Nokia gives you certain additional -** rights. These rights are described in the Nokia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. +** In addition, as a special exception, Nokia gives you certain +** additional rights. These rights are described in the Nokia Qt LGPL +** Exception version 1.1, included in the file LGPL_EXCEPTION.txt in this +** package. ** ** If you have questions regarding the use of this file, please contact ** Nokia at qt-info@nokia.com. @@ -492,56 +492,17 @@ void Reader::cleanupIndex(EntryTable &entryTable) } -QHelpSearchIndexReader::QHelpSearchIndexReader() - : QThread() - , m_cancel(false) +QHelpSearchIndexReaderDefault::QHelpSearchIndexReaderDefault() + : QHelpSearchIndexReader() { // nothing todo } -QHelpSearchIndexReader::~QHelpSearchIndexReader() +QHelpSearchIndexReaderDefault::~QHelpSearchIndexReaderDefault() { - mutex.lock(); - this->m_cancel = true; - waitCondition.wakeOne(); - mutex.unlock(); - - wait(); -} - -void QHelpSearchIndexReader::cancelSearching() -{ - mutex.lock(); - this->m_cancel = true; - mutex.unlock(); -} - -void QHelpSearchIndexReader::search(const QString &collectionFile, - const QString &indexFilesFolder, - const QList<QHelpSearchQuery> &queryList) -{ - QMutexLocker lock(&mutex); - - this->hitList.clear(); - this->m_cancel = false; - this->m_query = queryList; - this->m_collectionFile = collectionFile; - this->m_indexFilesFolder = indexFilesFolder; - - start(QThread::NormalPriority); -} - -int QHelpSearchIndexReader::hitsCount() const -{ - return hitList.count(); } -QHelpSearchEngine::SearchHit QHelpSearchIndexReader::hit(int index) const -{ - return hitList.at(index); -} - -void QHelpSearchIndexReader::run() +void QHelpSearchIndexReaderDefault::run() { mutex.lock(); @@ -571,7 +532,7 @@ void QHelpSearchIndexReader::run() QHelpEngineCore engine(collectionFile, 0); if (!engine.setupData()) return; - + const QStringList registeredDocs = engine.registeredDocumentations(); const QStringList indexedNamespaces = engine.customValue(key).toString(). split(QLatin1String("|"), QString::SkipEmptyParts); |