Changeset 769 for trunk/tools/assistant
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/tools/assistant/lib/fulltextsearch/qclucene-config_p.h
r703 r769 530 530 /* #undef _CL__CND_DEBUG */ 531 531 532 /* debug ing option */532 /* debuging option */ 533 533 /* #undef _DEBUG */ 534 534 -
trunk/tools/assistant/lib/qhelpcollectionhandler.cpp
r651 r769 253 253 "Value BLOB )"); 254 254 255 foreach ( QStringq, tables) {255 foreach (q, tables) { 256 256 if (!query->exec(q)) 257 257 return false; … … 324 324 } 325 325 326 foreach ( QStringid, idsToInsert) {326 foreach (id, idsToInsert) { 327 327 m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); 328 328 m_query.bindValue(0, id); … … 347 347 m_query.exec(); 348 348 349 foreach ( QStringatt, attributes) {349 foreach (att, attributes) { 350 350 m_query.prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); 351 351 m_query.bindValue(0, nameId); … … 401 401 402 402 addFilterAttributes(reader.filterAttributes()); 403 foreach ( QStringfilterName, reader.customFilters())403 foreach (filterName, reader.customFilters()) 404 404 addCustomFilter(filterName, reader.filterAttributes(filterName)); 405 405 … … 500 500 atts.insert(m_query.value(0).toString()); 501 501 502 foreach ( QStrings, attributes) {502 foreach (s, attributes) { 503 503 if (!atts.contains(s)) { 504 504 m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); -
trunk/tools/assistant/lib/qhelpcontentwidget.cpp
r651 r769 254 254 m_mutex.unlock(); 255 255 256 foreach ( QStringdbFileName, fileNames) {256 foreach (dbFileName, fileNames) { 257 257 m_mutex.lock(); 258 258 if (m_abort) { -
trunk/tools/assistant/lib/qhelpdbreader.cpp
r651 r769 516 516 { 517 517 QString str; 518 foreach ( QStrings, list)518 foreach (s, list) 519 519 str.append(QLatin1Char('\'') + quote(s) + QLatin1String("\', ")); 520 520 if (str.endsWith(QLatin1String(", "))) … … 568 568 bool needUpdate = !m_viewAttributes.count(); 569 569 570 foreach ( QStrings, attributes)570 foreach (s, attributes) 571 571 m_viewAttributes.remove(s); 572 572 … … 575 575 m_indicesCache = indexIds; 576 576 } 577 foreach ( QStrings, attributes)577 foreach (s, attributes) 578 578 m_viewAttributes.insert(s); 579 579 m_useAttributesCache = true; -
trunk/tools/assistant/lib/qhelpenginecore.cpp
r651 r769 169 169 all defined filters. 170 170 171 The help engine also offers the possib lity to set and read values171 The help engine also offers the possiblity to set and read values 172 172 in a persistant way comparable to ini files or Windows registry 173 173 entries. For more information see setValue() or value(). … … 363 363 const QHelpCollectionHandler::DocInfoList docList = 364 364 d->collectionHandler->registeredDocumentations(); 365 foreach(const QHelpCollectionHandler::DocInfo info, docList) {365 foreach(const QHelpCollectionHandler::DocInfo info, docList) { 366 366 if (info.namespaceName == namespaceName) { 367 367 if (QDir::isAbsolutePath(info.fileName)) … … 387 387 return list; 388 388 const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations(); 389 foreach(const QHelpCollectionHandler::DocInfo info, docList) {389 foreach(const QHelpCollectionHandler::DocInfo info, docList) { 390 390 list.append(info.namespaceName); 391 391 } … … 532 532 533 533 const QStringList files = reader->files(filterAttributes, extensionFilter); 534 foreach (const QString file, files) {534 foreach (const QString file, files) { 535 535 url.setPath(QLatin1String("/") + file); 536 536 res.append(url); -
trunk/tools/assistant/lib/qhelpgenerator.cpp
r651 r769 204 204 205 205 emit statusChanged(tr("Insert custom filters...")); 206 foreach ( QHelpDataCustomFilterf, helpData->customFilters()) {206 foreach (f, helpData->customFilters()) { 207 207 if (!registerCustomFilter(f.name, f.filterAttributes, true)) { 208 208 cleanupDB(); … … 368 368 "Value BLOB )"); 369 369 370 foreach ( QStringq, tables) {370 foreach (q, tables) { 371 371 if (!d->query->exec(q)) { 372 372 d->error = tr("Cannot create tables!"); … … 630 630 } 631 631 632 foreach ( QStringid, idsToInsert) {632 foreach (id, idsToInsert) { 633 633 d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); 634 634 d->query->bindValue(0, id); … … 665 665 d->query->exec(); 666 666 667 foreach ( QStringatt, filterAttribs) {667 foreach (att, filterAttribs) { 668 668 d->query->prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); 669 669 d->query->bindValue(0, nameId); … … 688 688 689 689 QList<int> filterAtts; 690 foreach ( QStringfilterAtt, filterAttributes) {690 foreach (filterAtt, filterAttributes) { 691 691 d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable WHERE Name=?")); 692 692 d->query->bindValue(0, filterAtt); … … 705 705 int i = 0; 706 706 d->query->exec(QLatin1String("BEGIN")); 707 foreach ( QHelpDataIndexItemitm, keywords) {707 foreach (itm, keywords) { 708 708 pos = itm.reference.indexOf(QLatin1Char('#')); 709 709 fileName = itm.reference.left(pos); … … 774 774 775 775 // associate the filter attributes 776 foreach ( QStringfilterAtt, filterAttributes) {776 foreach (filterAtt, filterAttributes) { 777 777 d->query->prepare(QLatin1String("INSERT INTO ContentsFilterTable (FilterAttributeId, ContentsId) " 778 778 "SELECT Id, ? FROM FilterAttributeTable WHERE Name=?")); … … 799 799 atts.insert(d->query->value(0).toString()); 800 800 801 foreach ( QStrings, attributes) {801 foreach (s, attributes) { 802 802 if (!atts.contains(s)) { 803 803 d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); -
trunk/tools/assistant/lib/qhelpindexwidget.cpp
r651 r769 163 163 m_mutex.unlock(); 164 164 165 foreach ( QStringdbFileName, m_helpEngine->fileNameReaderMap.keys()) {165 foreach (dbFileName, m_helpEngine->fileNameReaderMap.keys()) { 166 166 m_mutex.lock(); 167 167 if (m_abort) { … … 179 179 if (!lst.isEmpty()) { 180 180 m_mutex.lock(); 181 foreach ( QStrings, lst)181 foreach (s, lst) 182 182 indicesSet.insert(s); 183 183 if (m_abort) { … … 318 318 QRegExp regExp(wildcard, Qt::CaseInsensitive); 319 319 regExp.setPatternSyntax(QRegExp::Wildcard); 320 foreach ( QStringindex, d->indices) {320 foreach (index, d->indices) { 321 321 if (index.contains(regExp)) { 322 322 lst.append(index); … … 333 333 } 334 334 } else { 335 foreach ( QStringindex, d->indices) {335 foreach (index, d->indices) { 336 336 if (index.contains(filter, Qt::CaseInsensitive)) { 337 337 lst.append(index); -
trunk/tools/assistant/lib/qhelpsearchengine.cpp
r651 r769 64 64 65 65 #if defined(QT_CLUCENE_SUPPORT) 66 using namespace qt::fulltextsearch::clucene;66 using namespace fulltextsearch::clucene; 67 67 #else 68 using namespace qt::fulltextsearch::std;68 using namespace fulltextsearch::std; 69 69 #endif 70 70 … … 196 196 QHelpSearchResultWidget *resultWidget; 197 197 198 qt::fulltextsearch::QHelpSearchIndexReader *indexReader;198 fulltextsearch::QHelpSearchIndexReader *indexReader; 199 199 QHelpSearchIndexWriter *indexWriter; 200 200 … … 215 215 216 216 The QHelpSearchQuery class contains the field name and the associated search 217 term. Depending on the field the search term might get split up into sep erate217 term. Depending on the field the search term might get split up into seprate 218 218 terms to be parsed differently by the search engine. 219 219 … … 239 239 \value DEFAULT the default field provided by the search widget, several terms should be 240 240 split and stored in the word list except search terms enclosed in quotes. 241 \value FUZZY a field only provided in use with clucene. Terms should be split in sep erate241 \value FUZZY a field only provided in use with clucene. Terms should be split in seprate 242 242 words and passed to the search engine. 243 \value WITHOUT a field only provided in use with clucene. Terms should be split in sep erate243 \value WITHOUT a field only provided in use with clucene. Terms should be split in seprate 244 244 words and passed to the search engine. 245 \value PHRASE a field only provided in use with clucene. Terms should not be split in sep erate245 \value PHRASE a field only provided in use with clucene. Terms should not be split in seprate 246 246 words. 247 \value ALL a field only provided in use with clucene. Terms should be split in sep erate247 \value ALL a field only provided in use with clucene. Terms should be split in seprate 248 248 words and passed to the search engine 249 \value ATLEAST a field only provided in use with clucene. Terms should be split in sep erate249 \value ATLEAST a field only provided in use with clucene. Terms should be split in seprate 250 250 words and passed to the search engine 251 251 */ -
trunk/tools/assistant/lib/qhelpsearchindexreader.cpp
r651 r769 44 44 QT_BEGIN_NAMESPACE 45 45 46 namespace qt { 47 namespace fulltextsearch { 46 namespace fulltextsearch { 48 47 49 48 QHelpSearchIndexReader::QHelpSearchIndexReader() … … 101 100 102 101 103 } // namespace fulltextsearch 104 } // namespace qt 102 } // namespace fulltextsearch 105 103 106 104 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp
r651 r769 56 56 QT_BEGIN_NAMESPACE 57 57 58 namespace qt { 59 namespace fulltextsearch { 60 namespace clucene { 58 namespace fulltextsearch { 59 namespace clucene { 61 60 62 61 QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene() … … 388 387 } 389 388 390 } // namespace clucene 391 } // namespace fulltextsearch 392 } // namespace qt 389 } // namespace clucene 390 } // namespace fulltextsearch 393 391 394 392 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h
r651 r769 61 61 QT_BEGIN_NAMESPACE 62 62 63 namespace qt { 64 namespace fulltextsearch { 65 namespace clucene { 63 namespace fulltextsearch { 64 namespace clucene { 66 65 67 66 class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader … … 85 84 }; 86 85 87 } // namespace clucene 88 } // namespace fulltextsearch 89 } // namespace qt 86 } // namespace clucene 87 } // namespace fulltextsearch 90 88 91 89 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_default.cpp
r651 r769 53 53 QT_BEGIN_NAMESPACE 54 54 55 namespace qt { 56 namespace fulltextsearch { 57 namespace std { 55 namespace fulltextsearch { 56 namespace std { 58 57 59 58 namespace { … … 167 166 bool containsAll = true; 168 167 QStringList split = fileName.split(QLatin1String("@")); 169 foreach (const QString attribute, attributes) {168 foreach (const QString attribute, attributes) { 170 169 if (!split.contains(attribute, Qt::CaseInsensitive)) { 171 170 containsAll = false; … … 181 180 void Reader::setIndexFile(const QString &namespaceName, const QString &attributes) 182 181 { 183 QString exten tion = namespaceName + QLatin1String("@") + attributes;184 indexFile = indexPath + QLatin1String("/indexdb40.") + exten tion;185 documentFile = indexPath + QLatin1String("/indexdoc40.") + exten tion;182 QString extenion = namespaceName + QLatin1String("@") + attributes; 183 indexFile = indexPath + QLatin1String("/indexdb40.") + extenion; 184 documentFile = indexPath + QLatin1String("/indexdoc40.") + extenion; 186 185 } 187 186 … … 236 235 void Reader::searchInIndex(const QStringList &terms) 237 236 { 238 foreach (const QString term, terms) {237 foreach (const QString term, terms) { 239 238 QVector<Document> documents; 240 239 … … 255 254 QString title, url; 256 255 QVector<DocumentInfo> documentsInfo; 257 foreach(const Document doc, documents) {256 foreach(const Document doc, documents) { 258 257 info.docNumber = doc.docNumber; 259 258 info.frequency = doc.frequency; … … 520 519 521 520 QString queryTerm; 522 foreach (const QHelpSearchQuery query, queryList) {521 foreach (const QHelpSearchQuery query, queryList) { 523 522 if (query.fieldName == QHelpSearchQuery::DEFAULT) { 524 523 queryTerm = query.wordList.at(0); … … 542 541 // setup the reader 543 542 m_reader.setIndexPath(indexPath); 544 foreach(const QString namespaceName, registeredDocs) {543 foreach(const QString namespaceName, registeredDocs) { 545 544 mutex.lock(); 546 545 if (m_cancel) { … … 554 553 engine.filterAttributeSets(namespaceName); 555 554 556 foreach ( QStringListattributes, attributeSets) {555 foreach (attributes, attributeSets) { 557 556 // read all index files 558 557 m_reader.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); … … 578 577 if (!hits.isEmpty()) { 579 578 if (termSeq.isEmpty()) { 580 foreach (const DocumentInfo docInfo, hits) {579 foreach (const DocumentInfo docInfo, hits) { 581 580 mutex.lock(); 582 581 if (m_cancel) { … … 589 588 } 590 589 } else { 591 foreach (const DocumentInfo docInfo, hits) {590 foreach (const DocumentInfo docInfo, hits) { 592 591 mutex.lock(); 593 592 if (m_cancel) { … … 608 607 } 609 608 610 } // namespace std 611 } // namespace fulltextsearch 612 } // namespace qt 609 } // namespace std 610 } // namespace fulltextsearch 613 611 614 612 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_default_p.h
r651 r769 65 65 struct PosEntry; 66 66 67 namespace qt { 68 namespace fulltextsearch { 69 namespace std { 67 namespace fulltextsearch { 68 namespace std { 70 69 71 70 class Reader … … 128 127 }; 129 128 130 } // namespace std 131 } // namespace fulltextsearch 132 } // namespace qt 129 } // namespace std 130 } // namespace fulltextsearch 133 131 134 132 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_p.h
r651 r769 67 67 class QHelpEngineCore; 68 68 69 namespace qt { 70 namespace fulltextsearch { 69 namespace fulltextsearch { 71 70 72 71 class QHelpSearchIndexReader : public QThread … … 101 100 }; 102 101 103 } // namespace fulltextsearch 104 } // namespace qt 102 } // namespace fulltextsearch 105 103 106 104 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
r651 r769 64 64 QT_BEGIN_NAMESPACE 65 65 66 namespace qt { 67 namespace fulltextsearch { 68 namespace clucene { 66 namespace fulltextsearch { 67 namespace clucene { 69 68 70 69 // taken from qtexthtmlparser … … 587 586 mutex.unlock(); 588 587 589 start(QThread:: NormalPriority);588 start(QThread::Priority); 590 589 } 591 590 … … 614 613 void QHelpSearchIndexWriter::run() 615 614 { 616 QMutexLocker mutexLocker(&mutex);617 618 if (m_cancel)619 return;620 621 const bool reindex = this->m_reindex;622 const QString collectionFile(this->m_collectionFile);623 624 mutexLocker.unlock();625 626 QHelpEngineCore engine(collectionFile, 0);627 if (!engine.setupData())628 return;629 630 const QLatin1String key("CluceneIndexedNamespaces");631 if (reindex)632 engine.setCustomValue(key, QLatin1String(""));633 634 QMap<QString, QDateTime> indexMap;635 const QLatin1String oldKey("CluceneSearchNamespaces");636 if (!engine.customValue(oldKey, QString()).isNull()) {637 // old style qhc file < 4.4.2, need to convert...638 const QStringList indexedNamespaces = engine.customValue(oldKey).639 toString().split(QLatin1String("|"), QString::SkipEmptyParts);640 foreach (const QString &nameSpace, indexedNamespaces)641 indexMap.insert(nameSpace, QDateTime());642 engine.removeCustomValue(oldKey);643 } else {644 QDataStream dataStream(engine.customValue(key).toByteArray());645 dataStream >> indexMap;646 }647 648 QString indexPath = m_indexFilesFolder;649 650 QFileInfo fInfo(indexPath);651 if (fInfo.exists() && !fInfo.isWritable()) {652 qWarning("Full Text Search, could not create index (missing permissions for '%s').", qPrintable(indexPath));653 return;654 }655 656 emit indexingStarted();657 658 QCLuceneIndexWriter *writer = 0;659 QCLuceneStandardAnalyzer analyzer;660 const QStringList registeredDocs = engine.registeredDocumentations();661 662 QLocalSocket localSocket;663 localSocket.connectToServer(QString(QLatin1String("QtAssistant%1"))664 .arg(QLatin1String(QT_VERSION_STR)));665 666 QLocalServer localServer;667 bool otherInstancesRunning = true;668 if (!localSocket.waitForConnected()) {669 otherInstancesRunning = false;670 localServer.listen(QString(QLatin1String("QtAssistant%1"))671 .arg(QLatin1String(QT_VERSION_STR)));672 }673 674 615 #if !defined(QT_NO_EXCEPTIONS) 675 616 try { 676 617 #endif 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 677 678 // check if it's locked, and if the other instance is running 678 679 if (!otherInstancesRunning && QCLuceneIndexReader::isLocked(indexPath)) … … 706 707 } else { 707 708 QString path = engine.documentationFileName(namespaceName); 708 if (indexMap.value(namespaceName) < QFileInfo(path).lastModified()) { 709 if (indexMap.value(namespaceName) 710 < QFileInfo(path).lastModified()) { 709 711 // make sure we remove some outdated indexed stuff 710 712 indexMap.remove(namespaceName); … … 729 731 writer = new QCLuceneIndexWriter(indexPath, analyzer, true); 730 732 } 731 #if !defined(QT_NO_EXCEPTIONS) 732 } catch (...) { 733 qWarning("Full Text Search, could not create index writer in '%s'.", 734 qPrintable(indexPath)); 735 return; 736 } 737 #endif 738 739 #if !defined(QT_NO_EXCEPTIONS) 740 try { 741 #endif 733 742 734 writer->setMergeFactor(100); 743 735 writer->setMinMergeDocs(1000); 744 736 writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH); 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 745 806 #if !defined(QT_NO_EXCEPTIONS) 746 807 } catch (...) { 747 qWarning("Full Text Search, could not set writer properties."); 748 return; 808 qWarning("%s: Failed because of CLucene exception.", Q_FUNC_INFO); 749 809 } 750 810 #endif 751 811 752 QStringList namespaces;753 foreach(const QString &namespaceName, registeredDocs) {754 mutexLocker.relock();755 if (m_cancel) {756 closeIndexWriter(writer);757 emit indexingFinished();758 return;759 }760 mutexLocker.unlock();761 762 namespaces.append(namespaceName);763 if (indexMap.contains(namespaceName))764 continue;765 766 const QList<QStringList> attributeSets =767 engine.filterAttributeSets(namespaceName);768 769 if (attributeSets.isEmpty()) {770 const QList<QUrl> docFiles = indexableFiles(&engine, namespaceName,771 QStringList());772 if (!addDocuments(docFiles, engine, QStringList(), namespaceName,773 writer, analyzer))774 break;775 } else {776 bool bail = false;777 foreach (const QStringList &attributes, attributeSets) {778 const QList<QUrl> docFiles = indexableFiles(&engine,779 namespaceName, attributes);780 if (!addDocuments(docFiles, engine, attributes, namespaceName,781 writer, analyzer)) {782 bail = true;783 break;784 }785 }786 if (bail)787 break;788 }789 790 mutexLocker.relock();791 if (!m_cancel) {792 QString path(engine.documentationFileName(namespaceName));793 indexMap.insert(namespaceName, QFileInfo(path).lastModified());794 writeIndexMap(engine, indexMap);795 }796 mutexLocker.unlock();797 }798 799 closeIndexWriter(writer);800 801 mutexLocker.relock();802 if (!m_cancel) {803 mutexLocker.unlock();804 805 QStringList indexedNamespaces = indexMap.keys();806 foreach(const QString &namespaceName, indexedNamespaces) {807 mutexLocker.relock();808 if (m_cancel)809 break;810 mutexLocker.unlock();811 812 if (!namespaces.contains(namespaceName)) {813 indexMap.remove(namespaceName);814 writeIndexMap(engine, indexMap);815 removeDocuments(indexPath, namespaceName);816 }817 }818 }819 812 emit indexingFinished(); 820 813 } … … 902 895 } 903 896 904 } // namespace clucene 905 } // namespace fulltextsearch 906 } // namespace qt 897 } // namespace clucene 898 } // namespace fulltextsearch 907 899 908 900 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h
r651 r769 70 70 class QCLuceneIndexWriter; 71 71 72 namespace qt { 73 namespace fulltextsearch { 74 namespace clucene { 72 namespace fulltextsearch { 73 namespace clucene { 75 74 76 75 class QHelpSearchIndexWriter : public QThread … … 117 116 }; 118 117 119 } // namespace clucene120 } // namespace fulltextsearch121 118 } // namespace clucene 119 120 122 121 123 122 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexwriter_default.cpp
r651 r769 56 56 QT_BEGIN_NAMESPACE 57 57 58 namespace qt { 59 namespace fulltextsearch { 60 namespace std { 58 namespace fulltextsearch { 59 namespace std { 61 60 62 61 Writer::Writer(const QString &path) … … 105 104 106 105 QDataStream docStream(&docFile); 107 foreach(const QStringList list, documentList) {106 foreach(const QStringList list, documentList) { 108 107 docStream << list.at(0); 109 108 docStream << list.at(1); … … 127 126 void Writer::setIndexFile(const QString &namespaceName, const QString &attributes) 128 127 { 129 QString exten tion = namespaceName + QLatin1String("@") + attributes;130 indexFile = indexPath + QLatin1String("/indexdb40.") + exten tion;131 documentFile = indexPath + QLatin1String("/indexdoc40.") + exten tion;128 QString extenion = namespaceName + QLatin1String("@") + attributes; 129 indexFile = indexPath + QLatin1String("/indexdb40.") + extenion; 130 documentFile = indexPath + QLatin1String("/indexdoc40.") + extenion; 132 131 } 133 132 … … 193 192 this->m_indexFilesFolder = indexFilesFolder; 194 193 195 start(QThread:: NormalPriority);194 start(QThread::Priority); 196 195 } 197 196 … … 227 226 QStringList namespaces; 228 227 Writer writer(indexPath); 229 foreach(const QString namespaceName, registeredDocs) {228 foreach(const QString namespaceName, registeredDocs) { 230 229 mutex.lock(); 231 230 if (m_cancel) { … … 243 242 engine.filterAttributeSets(namespaceName); 244 243 245 foreach ( QStringListattributes, attributeSets) {244 foreach (attributes, attributeSets) { 246 245 // cleanup maybe old or unfinished files 247 246 writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); … … 267 266 int docNum = 0; 268 267 const QStringList documentsList(documentsSet.toList()); 269 foreach(const QString url, documentsList) {268 foreach(const QString url, documentsList) { 270 269 if (m_cancel) 271 270 return; … … 348 347 engine.filterAttributeSets(namespaceName); 349 348 350 foreach ( QStringListattributes, attributeSets) {349 foreach (attributes, attributeSets) { 351 350 writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); 352 351 writer.removeIndex(); … … 380 379 } 381 380 382 } // namespace std 383 } // namespace fulltextsearch 384 } // namespace qt 381 } // namespace std 382 } // namespace fulltextsearch 385 383 386 384 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexwriter_default_p.h
r651 r769 66 66 QT_BEGIN_NAMESPACE 67 67 68 namespace qt { 69 namespace fulltextsearch { 70 namespace std { 68 namespace fulltextsearch { 69 namespace std { 71 70 72 71 class Writer … … 124 123 }; 125 124 126 } // namespace std 127 } // namespace fulltextsearch 128 } // namespace qt 125 } // namespace std 126 } // namespace fulltextsearch 129 127 130 128 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchquerywidget.cpp
r651 r769 149 149 150 150 // make sure we won't end up with an empty string 151 foreach (const QString escapeChar, escapableCharsList) {151 foreach (const QString escapeChar, escapableCharsList) { 152 152 if (retValue.contains(escapeChar)) 153 153 retValue.replace(escapeChar, QLatin1String("")); … … 156 156 return retValue; 157 157 158 retValue = text; // now real y escape the string...159 foreach (const QString escapeChar, escapableCharsList) {158 retValue = text; // now realy escape the string... 159 foreach (const QString escapeChar, escapableCharsList) { 160 160 if (retValue.contains(escapeChar)) 161 161 retValue.replace(escapeChar, escape + escapeChar); … … 318 318 if (!lst.isEmpty()) { 319 319 QStringList fuzzy; 320 foreach (const QString term, lst)320 foreach (const QString term, lst) 321 321 fuzzy += buildTermList(escapeString(term)); 322 322 queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, fuzzy)); … … 326 326 if (!lst.isEmpty()) { 327 327 QStringList without; 328 foreach (const QString term, lst)328 foreach (const QString term, lst) 329 329 without.append(escapeString(term)); 330 330 queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, without)); … … 340 340 if (!lst.isEmpty()) { 341 341 QStringList all; 342 foreach (const QString term, lst)342 foreach (const QString term, lst) 343 343 all.append(escapeString(term)); 344 344 queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all)); … … 348 348 if (!lst.isEmpty()) { 349 349 QStringList atLeast; 350 foreach (const QString term, lst)350 foreach (const QString term, lst) 351 351 atLeast += buildTermList(escapeString(term)); 352 352 queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, atLeast)); … … 534 534 535 535 /*! 536 Returns a list of quer ys to use in combination with the search engines536 Returns a list of quers to use in combination with the search engines 537 537 search(QList<QHelpSearchQuery> &query) function. 538 538 */ -
trunk/tools/assistant/lib/qhelpsearchresultwidget.cpp
r651 r769 74 74 void showResultPage(const QList<QHelpSearchEngine::SearchHit> hits) 75 75 { 76 foreach (const QHelpSearchEngine::SearchHit hit, hits)76 foreach (const QHelpSearchEngine::SearchHit hit, hits) 77 77 new QTreeWidgetItem(this, QStringList(hit.first) << hit.second); 78 78 } … … 119 119 "documentation is still being indexed!")); 120 120 121 foreach (const QHelpSearchEngine::SearchHit hit, hits) {121 foreach (const QHelpSearchEngine::SearchHit hit, hits) { 122 122 htmlFile += QString(QLatin1String("<div style=\"text-align:left; font-weight:bold\"" 123 123 "><a href=\"%1\">%2</a><div style=\"color:green; font-weight:normal;" -
trunk/tools/assistant/tools/assistant/centralwidget.cpp
r651 r769 1119 1119 1120 1120 QStringList terms; 1121 foreach ( QHelpSearchQueryquery, queryList) {1121 foreach (query, queryList) { 1122 1122 switch (query.fieldName) { 1123 1123 default: break; -
trunk/tools/assistant/tools/assistant/doc/assistant.qdocconf
r651 r769 13 13 "<td width=\"30%\" align=\"left\">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ 14 14 "<td width=\"40%\" align=\"center\">Trademarks</td>\n" \ 15 "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6. 2</div></td>\n" \15 "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.</div></td>\n" \ 16 16 "</tr></table></div></address>" -
trunk/tools/assistant/tools/assistant/helpviewer.cpp
r651 r769 152 152 } 153 153 154 const QByteArray &ba = helpEngine->fileData(url); 155 return new HelpNetworkReply(request, ba.isEmpty() ? " " : ba, mimeType); 154 const QByteArray &data = helpEngine->findFile(url).isValid() 155 ? helpEngine->fileData(url) : QByteArray("File not found!"); 156 return new HelpNetworkReply(request, data, mimeType); 156 157 } 157 158
Note:
See TracChangeset
for help on using the changeset viewer.