- Timestamp:
- Feb 11, 2010, 11:19:06 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
-
Property svn:mergeinfo
set to (toggle deleted branches)
/branches/vendor/nokia/qt/4.6.1 merged eligible /branches/vendor/nokia/qt/current merged eligible /branches/vendor/trolltech/qt/current 3-149
-
Property svn:mergeinfo
set to (toggle deleted branches)
-
trunk/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp
r2 r561 2 2 ** 3 3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies). 4 ** Contact: Qt Software Information (qt-info@nokia.com) 4 ** All rights reserved. 5 ** Contact: Nokia Corporation (qt-info@nokia.com) 5 6 ** 6 7 ** This file is part of the Qt Assistant of the Qt Toolkit. … … 21 22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. 22 23 ** 23 ** In addition, as a special exception, Nokia gives you certain 24 ** additional rights. These rights are described in the Nokia Qt LGPL 25 ** Exception version 1.0, included in the file LGPL_EXCEPTION.txt in this 26 ** package. 24 ** In addition, as a special exception, Nokia gives you certain additional 25 ** rights. These rights are described in the Nokia Qt LGPL Exception 26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. 27 27 ** 28 28 ** GNU General Public License Usage … … 34 34 ** met: http://www.gnu.org/copyleft/gpl.html. 35 35 ** 36 ** If you are unsure which license is appropriate for your use, please37 ** contact the sales department at qt-sales@nokia.com.36 ** If you have questions regarding the use of this file, please contact 37 ** Nokia at qt-info@nokia.com. 38 38 ** $QT_END_LICENSE$ 39 39 ** … … 60 60 namespace clucene { 61 61 62 QHelpSearchIndexReader::QHelpSearchIndexReader() 63 : QThread() 64 , m_cancel(false) 62 QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene() 63 : QHelpSearchIndexReader() 65 64 { 66 65 // nothing todo 67 66 } 68 67 69 QHelpSearchIndexReader::~QHelpSearchIndexReader() 70 { 71 mutex.lock(); 72 this->m_cancel = true; 73 waitCondition.wakeOne(); 74 mutex.unlock(); 75 76 wait(); 77 } 78 79 void QHelpSearchIndexReader::cancelSearching() 80 { 81 mutex.lock(); 82 this->m_cancel = true; 83 mutex.unlock(); 84 } 85 86 void QHelpSearchIndexReader::search(const QString &collectionFile, const QString &indexFilesFolder, 87 const QList<QHelpSearchQuery> &queryList) 88 { 89 QMutexLocker lock(&mutex); 90 91 this->hitList.clear(); 92 this->m_cancel = false; 93 this->m_query = queryList; 94 this->m_collectionFile = collectionFile; 95 this->m_indexFilesFolder = indexFilesFolder; 96 97 start(QThread::NormalPriority); 98 } 99 100 int QHelpSearchIndexReader::hitsCount() const 101 { 102 return hitList.count(); 103 } 104 105 QHelpSearchEngine::SearchHit QHelpSearchIndexReader::hit(int index) const 106 { 107 return hitList.at(index); 108 } 109 110 void QHelpSearchIndexReader::run() 68 QHelpSearchIndexReaderClucene::~QHelpSearchIndexReaderClucene() 69 { 70 } 71 72 73 void QHelpSearchIndexReaderClucene::run() 111 74 { 112 75 mutex.lock(); … … 214 177 #if !defined(QT_NO_EXCEPTIONS) 215 178 } catch(...) { 179 mutex.lock(); 216 180 hitList.clear(); 181 mutex.unlock(); 217 182 emit searchingFinished(0); 218 183 } … … 221 186 } 222 187 223 bool QHelpSearchIndexReader ::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery,188 bool QHelpSearchIndexReaderClucene::defaultQuery(const QString &term, QCLuceneBooleanQuery &booleanQuery, 224 189 QCLuceneStandardAnalyzer &analyzer) 225 190 { … … 238 203 } 239 204 240 bool QHelpSearchIndexReader ::buildQuery(QCLuceneBooleanQuery &booleanQuery,205 bool QHelpSearchIndexReaderClucene::buildQuery(QCLuceneBooleanQuery &booleanQuery, 241 206 const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer) 242 207 { … … 338 303 } 339 304 340 bool QHelpSearchIndexReader ::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery,305 bool QHelpSearchIndexReaderClucene::buildTryHarderQuery(QCLuceneBooleanQuery &booleanQuery, 341 306 const QList<QHelpSearchQuery> &queryList, QCLuceneStandardAnalyzer &analyzer) 342 307 { … … 361 326 } 362 327 363 void QHelpSearchIndexReader ::boostSearchHits(const QHelpEngineCore &engine,328 void QHelpSearchIndexReaderClucene::boostSearchHits(const QHelpEngineCore &engine, 364 329 QList<QHelpSearchEngine::SearchHit> &hitList, const QList<QHelpSearchQuery> &queryList) 365 330 { … … 417 382 } while (it != hitMap.constBegin()); 418 383 boostedList += hitList.mid(count, hitList.count()); 419 384 mutex.lock(); 420 385 hitList = boostedList; 386 mutex.unlock(); 421 387 } 422 388 }
Note:
See TracChangeset
for help on using the changeset viewer.