Changeset 769 for trunk/tools/assistant


Ignore:
Timestamp:
Aug 2, 2010, 9:27:30 PM (15 years ago)
Author:
Dmitry A. Kuminov
Message:

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

Location:
trunk
Files:
24 edited

Legend:

Unmodified
Added
Removed
  • trunk

  • trunk/tools/assistant/lib/fulltextsearch/qclucene-config_p.h

    r703 r769  
    530530/* #undef _CL__CND_DEBUG */
    531531
    532 /* debuging option */
     532/* debuging option */
    533533/* #undef _DEBUG */
    534534
  • trunk/tools/assistant/lib/qhelpcollectionhandler.cpp

    r651 r769  
    253253        "Value BLOB )");
    254254
    255     foreach (QString q, tables) {
     255    foreach (q, tables) {
    256256        if (!query->exec(q))
    257257            return false;
     
    324324    }
    325325
    326     foreach (QString id, idsToInsert) {
     326    foreach (id, idsToInsert) {
    327327        m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)"));
    328328        m_query.bindValue(0, id);
     
    347347    m_query.exec();
    348348
    349     foreach (QString att, attributes) {
     349    foreach (att, attributes) {
    350350        m_query.prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)"));
    351351        m_query.bindValue(0, nameId);
     
    401401
    402402    addFilterAttributes(reader.filterAttributes());
    403     foreach (QString filterName, reader.customFilters())
     403    foreach (filterName, reader.customFilters())
    404404        addCustomFilter(filterName, reader.filterAttributes(filterName));
    405405
     
    500500        atts.insert(m_query.value(0).toString());
    501501
    502     foreach (QString s, attributes) {
     502    foreach (s, attributes) {
    503503        if (!atts.contains(s)) {
    504504            m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)"));
  • trunk/tools/assistant/lib/qhelpcontentwidget.cpp

    r651 r769  
    254254    m_mutex.unlock();
    255255
    256     foreach (QString dbFileName, fileNames) {
     256    foreach (dbFileName, fileNames) {
    257257        m_mutex.lock();
    258258        if (m_abort) {
  • trunk/tools/assistant/lib/qhelpdbreader.cpp

    r651 r769  
    516516{
    517517    QString str;
    518     foreach (QString s, list)
     518    foreach (s, list)
    519519        str.append(QLatin1Char('\'') + quote(s) + QLatin1String("\', "));
    520520    if (str.endsWith(QLatin1String(", ")))
     
    568568    bool needUpdate = !m_viewAttributes.count();
    569569
    570     foreach (QString s, attributes)
     570    foreach (s, attributes)
    571571        m_viewAttributes.remove(s);
    572572
     
    575575        m_indicesCache = indexIds;       
    576576    }
    577     foreach (QString s, attributes)
     577    foreach (s, attributes)
    578578        m_viewAttributes.insert(s);
    579579    m_useAttributesCache = true;
  • trunk/tools/assistant/lib/qhelpenginecore.cpp

    r651 r769  
    169169    all defined filters.
    170170
    171     The help engine also offers the possiblity to set and read values
     171    The help engine also offers the possiblity to set and read values
    172172    in a persistant way comparable to ini files or Windows registry
    173173    entries. For more information see setValue() or value().
     
    363363        const QHelpCollectionHandler::DocInfoList docList =
    364364            d->collectionHandler->registeredDocumentations();
    365         foreach(const QHelpCollectionHandler::DocInfo info, docList) {
     365        foreach(const QHelpCollectionHandler::DocInfo info, docList) {
    366366            if (info.namespaceName == namespaceName) {
    367367                if (QDir::isAbsolutePath(info.fileName))
     
    387387        return list;
    388388    const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations();
    389     foreach(const QHelpCollectionHandler::DocInfo info, docList) {
     389    foreach(const QHelpCollectionHandler::DocInfo info, docList) {
    390390        list.append(info.namespaceName);
    391391    }
     
    532532
    533533    const QStringList files = reader->files(filterAttributes, extensionFilter);
    534     foreach (const QString file, files) {
     534    foreach (const QString file, files) {
    535535        url.setPath(QLatin1String("/") + file);
    536536        res.append(url);
  • trunk/tools/assistant/lib/qhelpgenerator.cpp

    r651 r769  
    204204
    205205    emit statusChanged(tr("Insert custom filters..."));
    206     foreach (QHelpDataCustomFilter f, helpData->customFilters()) {
     206    foreach (f, helpData->customFilters()) {
    207207        if (!registerCustomFilter(f.name, f.filterAttributes, true)) {
    208208            cleanupDB();
     
    368368            "Value BLOB )");
    369369
    370     foreach (QString q, tables) {
     370    foreach (q, tables) {
    371371        if (!d->query->exec(q)) {
    372372            d->error = tr("Cannot create tables!");
     
    630630    }
    631631
    632     foreach (QString id, idsToInsert) {
     632    foreach (id, idsToInsert) {
    633633        d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)"));
    634634        d->query->bindValue(0, id);
     
    665665    d->query->exec();
    666666
    667     foreach (QString att, filterAttribs) {
     667    foreach (att, filterAttribs) {
    668668        d->query->prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)"));
    669669        d->query->bindValue(0, nameId);
     
    688688
    689689    QList<int> filterAtts;
    690     foreach (QString filterAtt, filterAttributes) {
     690    foreach (filterAtt, filterAttributes) {
    691691        d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable WHERE Name=?"));
    692692        d->query->bindValue(0, filterAtt);
     
    705705    int i = 0;
    706706    d->query->exec(QLatin1String("BEGIN"));
    707     foreach (QHelpDataIndexItem itm, keywords) {
     707    foreach (itm, keywords) {
    708708        pos = itm.reference.indexOf(QLatin1Char('#'));
    709709        fileName = itm.reference.left(pos);
     
    774774
    775775    // associate the filter attributes
    776     foreach (QString filterAtt, filterAttributes) {
     776    foreach (filterAtt, filterAttributes) {
    777777        d->query->prepare(QLatin1String("INSERT INTO ContentsFilterTable (FilterAttributeId, ContentsId) "
    778778            "SELECT Id, ? FROM FilterAttributeTable WHERE Name=?"));
     
    799799        atts.insert(d->query->value(0).toString());
    800800
    801     foreach (QString s, attributes) {
     801    foreach (s, attributes) {
    802802        if (!atts.contains(s)) {
    803803            d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)"));
  • trunk/tools/assistant/lib/qhelpindexwidget.cpp

    r651 r769  
    163163    m_mutex.unlock();
    164164
    165     foreach (QString dbFileName, m_helpEngine->fileNameReaderMap.keys()) {
     165    foreach (dbFileName, m_helpEngine->fileNameReaderMap.keys()) {
    166166        m_mutex.lock();
    167167        if (m_abort) {
     
    179179        if (!lst.isEmpty()) {
    180180            m_mutex.lock();
    181             foreach (QString s, lst)
     181            foreach (s, lst)
    182182                indicesSet.insert(s);
    183183            if (m_abort) {
     
    318318        QRegExp regExp(wildcard, Qt::CaseInsensitive);
    319319        regExp.setPatternSyntax(QRegExp::Wildcard);
    320         foreach (QString index, d->indices) {
     320        foreach (index, d->indices) {
    321321            if (index.contains(regExp)) {
    322322                lst.append(index);
     
    333333        }
    334334    } else {
    335         foreach (QString index, d->indices) {
     335        foreach (index, d->indices) {
    336336            if (index.contains(filter, Qt::CaseInsensitive)) {
    337337                lst.append(index);
  • trunk/tools/assistant/lib/qhelpsearchengine.cpp

    r651 r769  
    6464
    6565#if defined(QT_CLUCENE_SUPPORT)
    66     using namespace qt::fulltextsearch::clucene;
     66    using namespace fulltextsearch::clucene;
    6767#else
    68     using namespace qt::fulltextsearch::std;
     68    using namespace fulltextsearch::std;
    6969#endif
    7070
     
    196196    QHelpSearchResultWidget *resultWidget;
    197197
    198     qt::fulltextsearch::QHelpSearchIndexReader *indexReader;
     198    fulltextsearch::QHelpSearchIndexReader *indexReader;
    199199    QHelpSearchIndexWriter *indexWriter;
    200200
     
    215215
    216216    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 seperate
     217    term. Depending on the field the search term might get split up into seprate
    218218    terms to be parsed differently by the search engine.
    219219
     
    239239    \value DEFAULT  the default field provided by the search widget, several terms should be
    240240                    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 seperate
     241    \value FUZZY    a field only provided in use with clucene. Terms should be split in seprate
    242242                    words and passed to the search engine.
    243     \value WITHOUT  a field only provided in use with clucene. Terms should be split in seperate
     243    \value WITHOUT  a field only provided in use with clucene. Terms should be split in seprate
    244244                    words and passed to the search engine.
    245     \value PHRASE   a field only provided in use with clucene. Terms should not be split in seperate
     245    \value PHRASE   a field only provided in use with clucene. Terms should not be split in seprate
    246246                    words.
    247     \value ALL      a field only provided in use with clucene. Terms should be split in seperate
     247    \value ALL      a field only provided in use with clucene. Terms should be split in seprate
    248248                    words and passed to the search engine
    249     \value ATLEAST  a field only provided in use with clucene. Terms should be split in seperate
     249    \value ATLEAST  a field only provided in use with clucene. Terms should be split in seprate
    250250                    words and passed to the search engine
    251251*/
  • trunk/tools/assistant/lib/qhelpsearchindexreader.cpp

    r651 r769  
    4444QT_BEGIN_NAMESPACE
    4545
    46 namespace qt {
    47     namespace fulltextsearch {
     46namespace fulltextsearch {
    4847
    4948QHelpSearchIndexReader::QHelpSearchIndexReader()
     
    101100
    102101
    103     }   // namespace fulltextsearch
    104 }   // namespace qt
     102}   // namespace fulltextsearch
    105103
    106104QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp

    r651 r769  
    5656QT_BEGIN_NAMESPACE
    5757
    58 namespace qt {
    59     namespace fulltextsearch {
    60         namespace clucene {
     58namespace fulltextsearch {
     59namespace clucene {
    6160
    6261QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene()
     
    388387}
    389388
    390         }   // namespace clucene
    391     }   // namespace fulltextsearch
    392 }   // namespace qt
     389}   // namespace clucene
     390}   // namespace fulltextsearch
    393391
    394392QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h

    r651 r769  
    6161QT_BEGIN_NAMESPACE
    6262
    63 namespace qt {
    64     namespace fulltextsearch {
    65         namespace clucene {
     63namespace fulltextsearch {
     64namespace clucene {
    6665
    6766class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader
     
    8584};
    8685
    87         }   // namespace clucene
    88     }   // namespace fulltextsearch
    89 }   // namespace qt
     86}   // namespace clucene
     87}   // namespace fulltextsearch
    9088
    9189QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexreader_default.cpp

    r651 r769  
    5353QT_BEGIN_NAMESPACE
    5454
    55 namespace qt {
    56     namespace fulltextsearch {
    57         namespace std {
     55namespace fulltextsearch {
     56namespace std {
    5857
    5958namespace {
     
    167166        bool containsAll = true;
    168167        QStringList split = fileName.split(QLatin1String("@"));
    169         foreach (const QString attribute, attributes) {
     168        foreach (const QString attribute, attributes) {
    170169            if (!split.contains(attribute, Qt::CaseInsensitive)) {
    171170                containsAll = false;
     
    181180void Reader::setIndexFile(const QString &namespaceName, const QString &attributes)
    182181{
    183     QString extention = namespaceName + QLatin1String("@") + attributes;
    184     indexFile = indexPath + QLatin1String("/indexdb40.") + extention;
    185     documentFile = indexPath + QLatin1String("/indexdoc40.") + extention;
     182    QString extenion = namespaceName + QLatin1String("@") + attributes;
     183    indexFile = indexPath + QLatin1String("/indexdb40.") + extenion;
     184    documentFile = indexPath + QLatin1String("/indexdoc40.") + extenion;
    186185}
    187186
     
    236235void Reader::searchInIndex(const QStringList &terms)
    237236{
    238     foreach (const QString term, terms) {
     237    foreach (const QString term, terms) {
    239238        QVector<Document> documents;
    240239
     
    255254                QString title, url;
    256255                QVector<DocumentInfo> documentsInfo;
    257                 foreach(const Document doc, documents) {
     256                foreach(const Document doc, documents) {
    258257                    info.docNumber = doc.docNumber;
    259258                    info.frequency = doc.frequency;
     
    520519
    521520    QString queryTerm;
    522     foreach (const QHelpSearchQuery query, queryList) {
     521    foreach (const QHelpSearchQuery query, queryList) {
    523522        if (query.fieldName == QHelpSearchQuery::DEFAULT) {
    524523            queryTerm = query.wordList.at(0);
     
    542541    // setup the reader
    543542    m_reader.setIndexPath(indexPath);
    544     foreach(const QString namespaceName, registeredDocs) {
     543    foreach(const QString namespaceName, registeredDocs) {
    545544        mutex.lock();
    546545        if (m_cancel) {
     
    554553            engine.filterAttributeSets(namespaceName);
    555554
    556         foreach (QStringList attributes, attributeSets) {
     555        foreach (attributes, attributeSets) {
    557556            // read all index files
    558557            m_reader.setIndexFile(namespaceName, attributes.join(QLatin1String("@")));
     
    578577        if (!hits.isEmpty()) {
    579578            if (termSeq.isEmpty()) {
    580                 foreach (const DocumentInfo docInfo, hits) {
     579                foreach (const DocumentInfo docInfo, hits) {
    581580                    mutex.lock();
    582581                    if (m_cancel) {
     
    589588                }
    590589            } else {
    591                 foreach (const DocumentInfo docInfo, hits) {
     590                foreach (const DocumentInfo docInfo, hits) {
    592591                    mutex.lock();
    593592                    if (m_cancel) {
     
    608607}
    609608
    610         }   // namespace std
    611     }   // namespace fulltextsearch
    612 }   // namespace qt
     609}   // namespace std
     610}   // namespace fulltextsearch
    613611
    614612QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexreader_default_p.h

    r651 r769  
    6565struct PosEntry;
    6666
    67 namespace qt {
    68     namespace fulltextsearch {
    69         namespace std {
     67namespace fulltextsearch {
     68namespace std {
    7069
    7170class Reader
     
    128127};
    129128
    130         }   // namespace std
    131     }   // namespace fulltextsearch
    132 }   // namespace qt
     129}   // namespace std
     130}   // namespace fulltextsearch
    133131
    134132QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexreader_p.h

    r651 r769  
    6767class QHelpEngineCore;
    6868
    69 namespace qt {
    70     namespace fulltextsearch {
     69namespace fulltextsearch {
    7170
    7271class QHelpSearchIndexReader : public QThread
     
    101100};
    102101
    103     }   // namespace fulltextsearch
    104 }  // namespace qt
     102}   // namespace fulltextsearch
    105103
    106104QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp

    r651 r769  
    6464QT_BEGIN_NAMESPACE
    6565
    66 namespace qt {
    67     namespace fulltextsearch {
    68         namespace clucene {
     66namespace fulltextsearch {
     67namespace clucene {
    6968
    7069// taken from qtexthtmlparser
     
    587586    mutex.unlock();
    588587
    589     start(QThread::NormalPriority);
     588    start(QThread::Priority);
    590589}
    591590
     
    614613void QHelpSearchIndexWriter::run()
    615614{
    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 
    674615#if !defined(QT_NO_EXCEPTIONS)
    675616    try {
    676617#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
    677678        // check if it's locked, and if the other instance is running
    678679        if (!otherInstancesRunning && QCLuceneIndexReader::isLocked(indexPath))
     
    706707                } else {
    707708                    QString path = engine.documentationFileName(namespaceName);
    708                     if (indexMap.value(namespaceName) < QFileInfo(path).lastModified()) {
     709                    if (indexMap.value(namespaceName)
     710                        < QFileInfo(path).lastModified()) {
    709711                        // make sure we remove some outdated indexed stuff
    710712                        indexMap.remove(namespaceName);
     
    729731            writer = new QCLuceneIndexWriter(indexPath, analyzer, true);
    730732        }
    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
    742734        writer->setMergeFactor(100);
    743735        writer->setMinMergeDocs(1000);
    744736        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
    745806#if !defined(QT_NO_EXCEPTIONS)
    746807    } catch (...) {
    747         qWarning("Full Text Search, could not set writer properties.");
    748         return;
     808        qWarning("%s: Failed because of CLucene exception.", Q_FUNC_INFO);
    749809    }
    750810#endif
    751811
    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     }
    819812    emit indexingFinished();
    820813}
     
    902895}
    903896
    904         }   // namespace clucene
    905     }   // namespace fulltextsearch
    906 }   // namespace qt
     897}   // namespace clucene
     898}   // namespace fulltextsearch
    907899
    908900QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h

    r651 r769  
    7070class QCLuceneIndexWriter;
    7171
    72 namespace qt {
    73     namespace fulltextsearch {
    74         namespace clucene {
     72namespace fulltextsearch {
     73namespace clucene {
    7574
    7675class QHelpSearchIndexWriter : public QThread
     
    117116};
    118117
    119         }   // namespace clucene
    120     }   // namespace fulltextsearch
    121118}   // namespace clucene
     119
     120
    122121
    123122QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexwriter_default.cpp

    r651 r769  
    5656QT_BEGIN_NAMESPACE
    5757
    58 namespace qt {
    59     namespace fulltextsearch {
    60         namespace std {
     58namespace fulltextsearch {
     59namespace std {
    6160
    6261Writer::Writer(const QString &path)
     
    105104
    106105    QDataStream docStream(&docFile);
    107     foreach(const QStringList list, documentList) {
     106    foreach(const QStringList list, documentList) {
    108107        docStream << list.at(0);
    109108        docStream << list.at(1);
     
    127126void Writer::setIndexFile(const QString &namespaceName, const QString &attributes)
    128127{
    129     QString extention = namespaceName + QLatin1String("@") + attributes;
    130     indexFile = indexPath + QLatin1String("/indexdb40.") + extention;
    131     documentFile = indexPath + QLatin1String("/indexdoc40.") + extention;
     128    QString extenion = namespaceName + QLatin1String("@") + attributes;
     129    indexFile = indexPath + QLatin1String("/indexdb40.") + extenion;
     130    documentFile = indexPath + QLatin1String("/indexdoc40.") + extenion;
    132131}
    133132
     
    193192    this->m_indexFilesFolder = indexFilesFolder;
    194193
    195     start(QThread::NormalPriority);
     194    start(QThread::Priority);
    196195}
    197196
     
    227226    QStringList namespaces;
    228227    Writer writer(indexPath);
    229     foreach(const QString namespaceName, registeredDocs) {
     228    foreach(const QString namespaceName, registeredDocs) {
    230229        mutex.lock();
    231230        if (m_cancel) {
     
    243242            engine.filterAttributeSets(namespaceName);
    244243
    245         foreach (QStringList attributes, attributeSets) {
     244        foreach (attributes, attributeSets) {
    246245            // cleanup maybe old or unfinished files
    247246            writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@")));
     
    267266            int docNum = 0;
    268267            const QStringList documentsList(documentsSet.toList());
    269             foreach(const QString url, documentsList) {
     268            foreach(const QString url, documentsList) {
    270269                if (m_cancel)
    271270                    return;
     
    348347            engine.filterAttributeSets(namespaceName);
    349348
    350         foreach (QStringList attributes, attributeSets) {
     349        foreach (attributes, attributeSets) {
    351350            writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@")));
    352351            writer.removeIndex();
     
    380379}
    381380
    382         }   // namespace std
    383     }   // namespace fulltextsearch
    384 }   // namespace qt
     381}   // namespace std
     382}   // namespace fulltextsearch
    385383
    386384QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchindexwriter_default_p.h

    r651 r769  
    6666QT_BEGIN_NAMESPACE
    6767
    68 namespace qt {
    69     namespace fulltextsearch {
    70         namespace std {
     68namespace fulltextsearch {
     69namespace std {
    7170
    7271class Writer
     
    124123};
    125124
    126         }   // namespace std
    127     }   // namespace fulltextsearch
    128 }   // namespace qt
     125}   // namespace std
     126}   // namespace fulltextsearch
    129127
    130128QT_END_NAMESPACE
  • trunk/tools/assistant/lib/qhelpsearchquerywidget.cpp

    r651 r769  
    149149
    150150        // make sure we won't end up with an empty string
    151         foreach (const QString escapeChar, escapableCharsList) {
     151        foreach (const QString escapeChar, escapableCharsList) {
    152152            if (retValue.contains(escapeChar))
    153153                retValue.replace(escapeChar, QLatin1String(""));
     
    156156            return retValue;
    157157
    158         retValue = text; // now realy escape the string...
    159         foreach (const QString escapeChar, escapableCharsList) {
     158        retValue = text; // now realy escape the string...
     159        foreach (const QString escapeChar, escapableCharsList) {
    160160            if (retValue.contains(escapeChar))
    161161                retValue.replace(escapeChar, escape + escapeChar);
     
    318318            if (!lst.isEmpty()) {
    319319                QStringList fuzzy;
    320                 foreach (const QString term, lst)
     320                foreach (const QString term, lst)
    321321                    fuzzy += buildTermList(escapeString(term));
    322322                queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, fuzzy));
     
    326326            if (!lst.isEmpty()) {
    327327                QStringList without;
    328                 foreach (const QString term, lst)
     328                foreach (const QString term, lst)
    329329                    without.append(escapeString(term));
    330330                queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, without));
     
    340340            if (!lst.isEmpty()) {
    341341                QStringList all;
    342                 foreach (const QString term, lst)
     342                foreach (const QString term, lst)
    343343                    all.append(escapeString(term));
    344344                queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all));
     
    348348            if (!lst.isEmpty()) {
    349349                QStringList atLeast;
    350                 foreach (const QString term, lst)
     350                foreach (const QString term, lst)
    351351                    atLeast += buildTermList(escapeString(term));
    352352                queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, atLeast));
     
    534534
    535535/*!
    536     Returns a list of querys to use in combination with the search engines
     536    Returns a list of quers to use in combination with the search engines
    537537    search(QList<QHelpSearchQuery> &query) function.
    538538*/
  • trunk/tools/assistant/lib/qhelpsearchresultwidget.cpp

    r651 r769  
    7474    void showResultPage(const QList<QHelpSearchEngine::SearchHit> hits)
    7575    {
    76         foreach (const QHelpSearchEngine::SearchHit hit, hits)
     76        foreach (const QHelpSearchEngine::SearchHit hit, hits)
    7777            new QTreeWidgetItem(this, QStringList(hit.first) << hit.second);
    7878    }
     
    119119                            "documentation is still being indexed!"));
    120120
    121             foreach (const QHelpSearchEngine::SearchHit hit, hits) {
     121            foreach (const QHelpSearchEngine::SearchHit hit, hits) {
    122122                htmlFile += QString(QLatin1String("<div style=\"text-align:left; font-weight:bold\""
    123123                "><a href=\"%1\">%2</a><div style=\"color:green; font-weight:normal;"
  • trunk/tools/assistant/tools/assistant/centralwidget.cpp

    r651 r769  
    11191119
    11201120    QStringList terms;
    1121     foreach (QHelpSearchQuery query, queryList) {
     1121    foreach (query, queryList) {
    11221122        switch (query.fieldName) {
    11231123            default: break;
  • trunk/tools/assistant/tools/assistant/doc/assistant.qdocconf

    r651 r769  
    1313              "<td width=\"30%\" align=\"left\">Copyright &copy; 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \
    1414              "<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" \
    1616              "</tr></table></div></address>"
  • trunk/tools/assistant/tools/assistant/helpviewer.cpp

    r651 r769  
    152152    }
    153153
    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);
    156157}
    157158
Note: See TracChangeset for help on using the changeset viewer.