Changeset 769 for trunk/tools


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:
2 deleted
124 edited
25 copied

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/* debugging option */
    533533/* #undef _DEBUG */
    534534
  • trunk/tools/assistant/lib/qhelpcollectionhandler.cpp

    r651 r769  
    253253        "Value BLOB )");
    254254
    255     foreach (QString q, tables) {
     255    foreach (const QString &q, tables) {
    256256        if (!query->exec(q))
    257257            return false;
     
    324324    }
    325325
    326     foreach (QString id, idsToInsert) {
     326    foreach (const QString &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 (const QString &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 (const QString &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 (const QString &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 (const QString &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 (const QString &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 (const QString &s, attributes)
    571571        m_viewAttributes.remove(s);
    572572
     
    575575        m_indicesCache = indexIds;       
    576576    }
    577     foreach (QString s, attributes)
     577    foreach (const QString &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 possibility 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 (const QHelpDataCustomFilter &f, helpData->customFilters()) {
    207207        if (!registerCustomFilter(f.name, f.filterAttributes, true)) {
    208208            cleanupDB();
     
    368368            "Value BLOB )");
    369369
    370     foreach (QString q, tables) {
     370    foreach (const QString &q, tables) {
    371371        if (!d->query->exec(q)) {
    372372            d->error = tr("Cannot create tables!");
     
    630630    }
    631631
    632     foreach (QString id, idsToInsert) {
     632    foreach (const QString &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 (const QString &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 (const QString &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 (const QHelpDataIndexItem &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 (const QString &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 (const QString &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 (const QString &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 (const QString &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 (const QString &index, d->indices) {
    321321            if (index.contains(regExp)) {
    322322                lst.append(index);
     
    333333        }
    334334    } else {
    335         foreach (QString index, d->indices) {
     335        foreach (const QString &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 separate
    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 separate
    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 separate
    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 separate
    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 separate
    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 separate
    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 extension = namespaceName + QLatin1String("@") + attributes;
     183    indexFile = indexPath + QLatin1String("/indexdb40.") + extension;
     184    documentFile = indexPath + QLatin1String("/indexdoc40.") + extension;
    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 (const QStringList &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::LowestPriority);
    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        QMutexLocker mutexLocker(&mutex);
     619
     620        if (m_cancel)
     621            return;
     622
     623        const bool reindex = this->m_reindex;
     624        const QString collectionFile(this->m_collectionFile);
     625
     626        mutexLocker.unlock();
     627
     628        QHelpEngineCore engine(collectionFile, 0);
     629        if (!engine.setupData())
     630            return;
     631
     632        const QLatin1String key("CluceneIndexedNamespaces");
     633        if (reindex)
     634            engine.setCustomValue(key, QLatin1String(""));
     635
     636        QMap<QString, QDateTime> indexMap;
     637        const QLatin1String oldKey("CluceneSearchNamespaces");
     638        if (!engine.customValue(oldKey, QString()).isNull()) {
     639            // old style qhc file < 4.4.2, need to convert...
     640            const QStringList indexedNamespaces
     641                = engine.customValue(oldKey).toString()
     642                  .split(QLatin1String("|"), QString::SkipEmptyParts);
     643            foreach (const QString &nameSpace, indexedNamespaces)
     644                indexMap.insert(nameSpace, QDateTime());
     645            engine.removeCustomValue(oldKey);
     646        } else {
     647            QDataStream dataStream(engine.customValue(key).toByteArray());
     648            dataStream >> indexMap;
     649        }
     650
     651        QString indexPath = m_indexFilesFolder;
     652
     653        QFileInfo fInfo(indexPath);
     654        if (fInfo.exists() && !fInfo.isWritable()) {
     655            qWarning("Full Text Search, could not create index (missing permissions for '%s').",
     656                     qPrintable(indexPath));
     657            return;
     658        }
     659
     660        emit indexingStarted();
     661
     662        QCLuceneIndexWriter *writer = 0;
     663        QCLuceneStandardAnalyzer analyzer;
     664        const QStringList registeredDocs = engine.registeredDocumentations();
     665
     666        QLocalSocket localSocket;
     667        localSocket.connectToServer(QString(QLatin1String("QtAssistant%1"))
     668                                    .arg(QLatin1String(QT_VERSION_STR)));
     669
     670        QLocalServer localServer;
     671        bool otherInstancesRunning = true;
     672        if (!localSocket.waitForConnected()) {
     673            otherInstancesRunning = false;
     674            localServer.listen(QString(QLatin1String("QtAssistant%1"))
     675                               .arg(QLatin1String(QT_VERSION_STR)));
     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        QStringList namespaces;
     739        foreach(const QString &namespaceName, registeredDocs) {
     740            mutexLocker.relock();
     741            if (m_cancel) {
     742                closeIndexWriter(writer);
     743                emit indexingFinished();
     744                return;
     745            }
     746            mutexLocker.unlock();
     747
     748            namespaces.append(namespaceName);
     749            if (indexMap.contains(namespaceName))
     750                continue;
     751
     752            const QList<QStringList> attributeSets =
     753                    engine.filterAttributeSets(namespaceName);
     754
     755            if (attributeSets.isEmpty()) {
     756                const QList<QUrl> docFiles = indexableFiles(&engine, namespaceName,
     757                                                            QStringList());
     758                if (!addDocuments(docFiles, engine, QStringList(), namespaceName,
     759                                  writer, analyzer))
     760                    break;
     761            } else {
     762                bool bail = false;
     763                foreach (const QStringList &attributes, attributeSets) {
     764                    const QList<QUrl> docFiles = indexableFiles(&engine,
     765                                                                namespaceName, attributes);
     766                    if (!addDocuments(docFiles, engine, attributes, namespaceName,
     767                                      writer, analyzer)) {
     768                        bail = true;
     769                        break;
     770                    }
     771                }
     772                if (bail)
     773                    break;
     774            }
     775
     776            mutexLocker.relock();
     777            if (!m_cancel) {
     778                QString path(engine.documentationFileName(namespaceName));
     779                indexMap.insert(namespaceName, QFileInfo(path).lastModified());
     780                writeIndexMap(engine, indexMap);
     781            }
     782            mutexLocker.unlock();
     783        }
     784
     785        closeIndexWriter(writer);
     786
     787        mutexLocker.relock();
     788        if (!m_cancel) {
     789            mutexLocker.unlock();
     790
     791            QStringList indexedNamespaces = indexMap.keys();
     792            foreach(const QString &namespaceName, indexedNamespaces) {
     793                mutexLocker.relock();
     794                if (m_cancel)
     795                    break;
     796                mutexLocker.unlock();
     797
     798                if (!namespaces.contains(namespaceName)) {
     799                    indexMap.remove(namespaceName);
     800                    writeIndexMap(engine, indexMap);
     801                    removeDocuments(indexPath, namespaceName);
     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}   // namespace fulltextsearch
     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 extension = namespaceName + QLatin1String("@") + attributes;
     129    indexFile = indexPath + QLatin1String("/indexdb40.") + extension;
     130    documentFile = indexPath + QLatin1String("/indexdoc40.") + extension;
    132131}
    133132
     
    193192    this->m_indexFilesFolder = indexFilesFolder;
    194193
    195     start(QThread::NormalPriority);
     194    start(QThread::LowestPriority);
    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 (const QStringList &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 (const QStringList &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 really 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 queries 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 (const QHelpSearchQuery &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.3</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
  • trunk/tools/configure/configure.pro

    r561 r769  
    44CONFIG   += console flat
    55CONFIG   -= moc qt
    6 DEFINES  = UNICODE QT_NODLL QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_STL QT_NO_COMPRESS QT_BUILD_QMAKE QT_NO_THREAD QT_NO_QOBJECT _CRT_SECURE_NO_DEPRECATE
    7 
     6DEFINES  = UNICODE QT_NODLL QT_NO_CODECS QT_NO_TEXTCODEC QT_NO_UNICODETABLES QT_LITE_COMPONENT QT_NO_STL QT_NO_COMPRESS QT_NO_THREAD QT_NO_QOBJECT _CRT_SECURE_NO_DEPRECATE
     7DEFINES  += QT_BOOTSTRAPPED
    88
    99win32 : LIBS += -lole32 -ladvapi32
     
    2828           $$QT_BUILD_TREE/include \
    2929           $$QT_BUILD_TREE/include/QtCore \
     30           $$QT_BUILD_TREE/tools/shared
    3031
    3132HEADERS  = configureapp.h environment.h tools.h\
     
    5960           $$QT_SOURCE_TREE/src/corelib/tools/qstringlist.h \
    6061           $$QT_SOURCE_TREE/src/corelib/tools/qstringmatcher.h \
    61            $$QT_SOURCE_TREE/src/corelib/tools/qunicodetables_p.h
     62           $$QT_SOURCE_TREE/src/corelib/tools/qunicodetables_p.h \
     63           $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.h \
     64           $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils_p.h \
     65           $$QT_SOURCE_TREE/tools/shared/symbian/epocroot.h \
     66           $$QT_SOURCE_TREE/tools/shared/windows/registry.h
    6267
    6368
     
    103108           $$QT_SOURCE_TREE/src/corelib/tools/qrect.cpp \
    104109           $$QT_SOURCE_TREE/src/corelib/kernel/qmetatype.cpp \
    105            $$QT_SOURCE_TREE/src/corelib/global/qmalloc.cpp
     110           $$QT_SOURCE_TREE/src/corelib/global/qmalloc.cpp \
     111           $$QT_SOURCE_TREE/src/corelib/xml/qxmlstream.cpp \
     112           $$QT_SOURCE_TREE/src/corelib/xml/qxmlutils.cpp \
     113           $$QT_SOURCE_TREE/tools/shared/symbian/epocroot.cpp \
     114           $$QT_SOURCE_TREE/tools/shared/windows/registry.cpp
    106115
    107116win32:SOURCES += $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine_win.cpp
  • trunk/tools/configure/configureapp.cpp

    r651 r769  
    248248    dictionary[ "PHONON_BACKEND" ]  = "yes";
    249249    dictionary[ "MULTIMEDIA" ]      = "yes";
    250     dictionary[ "AUDIO_BACKEND" ]   = "yes";
     250    dictionary[ "AUDIO_BACKEND" ]   = "auto";
    251251    dictionary[ "DIRECTSHOW" ]      = "no";
    252252    dictionary[ "WEBKIT" ]          = "auto";
     
    318318    dictionary[ "DBUS" ]            = "auto";
    319319    dictionary[ "S60" ]             = "yes";
    320     dictionary[ "SYMBIAN_DEFFILES" ] = "yes";
    321320
    322321    dictionary[ "STYLE_WINDOWS" ]   = "yes";
     
    971970                break;
    972971            dictionary[ "QT_LIBINFIX" ] = configCmdLine.at(i);
     972            if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
     973                dictionary[ "QT_INSTALL_PLUGINS" ] =
     974                    QString("\\resource\\qt%1\\plugins").arg(dictionary[ "QT_LIBINFIX" ]);
     975            }
    973976        } else if( configCmdLine.at(i) == "-D" ) {
    974977            ++i;
     
    14781481        dictionary[ "QT_GLIB" ]             = "no";
    14791482        dictionary[ "S60" ]                 = "yes";
     1483        dictionary[ "SYMBIAN_DEFFILES" ]    = "yes";
    14801484        // iconv makes makes apps start and run ridiculously slowly in symbian emulator (HW not tested)
    14811485        // iconv_open seems to return -1 always, so something is probably missing from the platform.
     
    14851489        dictionary[ "QT_INSTALL_PREFIX" ]   = "";
    14861490        dictionary[ "QT_INSTALL_PLUGINS" ]  = "\\resource\\qt\\plugins";
     1491        dictionary[ "QT_INSTALL_TRANSLATIONS" ]  = "\\resource\\qt\\translations";
    14871492        dictionary[ "ARM_FPU_TYPE" ]        = "softvfp";
    14881493        dictionary[ "SQL_SQLITE" ]          = "yes";
     
    20662071    } else if (part == "DECLARATIVE") {
    20672072        available = QFile::exists(sourcePath + "/src/declarative/qml/qmlcomponent.h");
     2073    } else if (part == "AUDIO_BACKEND") {
     2074        available = true;
     2075        if (dictionary.contains("XQMAKESPEC") && dictionary["XQMAKESPEC"].startsWith("symbian")) {
     2076            QString epocRoot = Environment::symbianEpocRoot();
     2077            const QDir epocRootDir(epocRoot);
     2078            if (epocRootDir.exists()) {
     2079                QStringList paths;
     2080                paths << "epoc32/release/armv5/lib/mmfdevsound.dso"
     2081                      << "epoc32/release/armv5/lib/mmfdevsound.lib"
     2082                      << "epoc32/release/winscw/udeb/mmfdevsound.dll"
     2083                      << "epoc32/release/winscw/udeb/mmfdevsound.lib"
     2084                      << "epoc32/include/mmf/server/sounddevice.h";
     2085
     2086                QStringList::iterator i = paths.begin();
     2087                while (i != paths.end()) {
     2088                    const QString &path = epocRoot + *i;
     2089                    if (QFile::exists(path))
     2090                        i = paths.erase(i);
     2091                    else
     2092                        ++i;
     2093                }
     2094
     2095                available = (paths.size() == 0);
     2096                if (!available) {
     2097                    if (epocRoot.isNull() || epocRoot == "")
     2098                        epocRoot = "<empty string>";
     2099                    cout << endl
     2100                         << "The QtMultimedia audio backend will not be built because required" << endl
     2101                         << "support for CMMFDevSound was not found in the SDK." << endl
     2102                         << "The SDK which was examined was located at the following path:" << endl
     2103                         << "    " << epocRoot << endl
     2104                         << "The following required files were missing from the SDK:" << endl;
     2105                    QString path;
     2106                    foreach (path, paths)
     2107                        cout << "    " << path << endl;
     2108                    cout << endl;
     2109                }
     2110            } else {
     2111                cout << endl
     2112                     << "The SDK root was determined to be '" << epocRoot << "'." << endl
     2113                     << "This directory was not found, so the SDK could not be checked for" << endl
     2114                     << "CMMFDevSound support.  The QtMultimedia audio backend will therefore" << endl
     2115                     << "not be built." << endl << endl;
     2116                available = false;
     2117            }
     2118        }
    20682119    }
    20692120
     
    21542205    if (dictionary["DECLARATIVE"] == "auto")
    21552206        dictionary["DECLARATIVE"] = checkAvailability("DECLARATIVE") ? "yes" : "no";
     2207    if (dictionary["AUDIO_BACKEND"] == "auto")
     2208        dictionary["AUDIO_BACKEND"] = checkAvailability("AUDIO_BACKEND") ? "yes" : "no";
    21562209
    21572210    // Qt/WinCE remote test application
     
    22662319    QString build32Key = buildKey + "Windows " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" ");
    22672320    QString build64Key = buildKey + "Windows x64 " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" ");
     2321    QString buildSymbianKey = buildKey + "Symbian " + build_options.join(" ") + " " + build_defines.join(" ");
    22682322    build32Key = build32Key.simplified();
    22692323    build64Key = build64Key.simplified();
    2270     build32Key.prepend("#  define ");
    2271     build64Key.prepend("#  define ");
    2272 
    2273     QString buildkey = // Debug builds
    2274                        "#if (defined(_DEBUG) || defined(DEBUG))\n"
    2275                        "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
     2324    buildSymbianKey = buildSymbianKey.simplified();
     2325    build32Key.prepend("#   define ");
     2326    build64Key.prepend("#   define ");
     2327    buildSymbianKey.prepend("# define ");
     2328
     2329    QString buildkey = "#if defined(__SYMBIAN32__)\n"
     2330                       + buildSymbianKey + "\"\n"
     2331                       "#else\n"
     2332                       // Debug builds
     2333                       "# if (defined(_DEBUG) || defined(DEBUG))\n"
     2334                       "#  if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
    22762335                       + build64Key.arg("debug") + "\"\n"
     2336                       "#  else\n"
     2337                       + build32Key.arg("debug") + "\"\n"
     2338                       "#  endif\n"
    22772339                       "# else\n"
    2278                        + build32Key.arg("debug") + "\"\n"
    2279                        "# endif\n"
    2280                        "#else\n"
    22812340                       // Release builds
    2282                        "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
     2341                       "#  if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"
    22832342                       + build64Key.arg("release") + "\"\n"
    2284                        "# else\n"
     2343                       "#  else\n"
    22852344                       + build32Key.arg("release") + "\"\n"
     2345                       "#  endif\n"
    22862346                       "# endif\n"
    22872347                       "#endif\n";
     
    29683028            qconfigList += "QT_NO_PRINTER";
    29693029            qconfigList += "QT_NO_SYSTEMTRAYICON";
     3030            if (dictionary.contains("QT_LIBINFIX"))
     3031                tmpStream << QString("#define QT_LIBINFIX \"%1\"").arg(dictionary["QT_LIBINFIX"]) << endl;
    29703032        }
    29713033
     
    36463708                    txt << "all:\n";
    36473709                    txt << "\t" << args.join(" ") << "\n";
    3648                     txt << "\t" << dictionary[ "MAKE" ] << " -f " << it->target << "\n";
     3710                    txt << "\t\"$(MAKE)\" -$(MAKEFLAGS) -f " << it->target << "\n";
    36493711                    txt << "first: all\n";
    36503712                    txt << "qmake:\n";
  • trunk/tools/configure/environment.cpp

    r651 r769  
    6161#endif
    6262
     63#include <symbian/epocroot.h> // from tools/shared
     64#include <windows/registry.h> // from tools/shared
    6365
    6466QT_BEGIN_NAMESPACE
     
    9597        ++i;
    9698    return &(compiler_info[i]);
    97 }
    98 
    99 /*!
    100     Returns the path part of a registry key.
    101     Ei.
    102         For a key
    103             "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir"
    104         it returns
    105             "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\"
    106 */
    107 QString Environment::keyPath(const QString &rKey)
    108 {
    109     int idx = rKey.lastIndexOf(QLatin1Char('\\'));
    110     if (idx == -1)
    111         return QString();
    112     return rKey.left(idx + 1);
    113 }
    114 
    115 /*!
    116     Returns the name part of a registry key.
    117     Ei.
    118         For a key
    119             "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir"
    120         it returns
    121             "ProductDir"
    122 */
    123 QString Environment::keyName(const QString &rKey)
    124 {
    125     int idx = rKey.lastIndexOf(QLatin1Char('\\'));
    126     if (idx == -1)
    127         return rKey;
    128 
    129     QString res(rKey.mid(idx + 1));
    130     if (res == "Default" || res == ".")
    131         res = "";
    132     return res;
    133 }
    134 
    135 /*!
    136     Returns a registry keys value in string form.
    137     If the registry key does not exist, or cannot be accessed, a
    138     QString() is returned.
    139 */
    140 QString Environment::readRegistryKey(HKEY parentHandle, const QString &rSubkey)
    141 {
    142 #ifndef Q_OS_WIN32
    143     return QString();
    144 #else
    145     QString rSubkeyName = keyName(rSubkey);
    146     QString rSubkeyPath = keyPath(rSubkey);
    147 
    148     HKEY handle = 0;
    149     LONG res = RegOpenKeyEx(parentHandle, (wchar_t*)rSubkeyPath.utf16(), 0, KEY_READ, &handle);
    150     if (res != ERROR_SUCCESS)
    151         return QString();
    152 
    153     // get the size and type of the value
    154     DWORD dataType;
    155     DWORD dataSize;
    156     res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, &dataType, 0, &dataSize);
    157     if (res != ERROR_SUCCESS) {
    158         RegCloseKey(handle);
    159         return QString();
    160     }
    161 
    162     // get the value
    163     QByteArray data(dataSize, 0);
    164     res = RegQueryValueEx(handle, (wchar_t*)rSubkeyName.utf16(), 0, 0,
    165                            reinterpret_cast<unsigned char*>(data.data()), &dataSize);
    166     if (res != ERROR_SUCCESS) {
    167         RegCloseKey(handle);
    168         return QString();
    169     }
    170 
    171     QString result;
    172     switch (dataType) {
    173         case REG_EXPAND_SZ:
    174         case REG_SZ: {
    175             result = QString::fromWCharArray(((const wchar_t *)data.constData()));
    176             break;
    177         }
    178 
    179         case REG_MULTI_SZ: {
    180             QStringList l;
    181             int i = 0;
    182             for (;;) {
    183                 QString s = QString::fromWCharArray((const wchar_t *)data.constData() + i);
    184                 i += s.length() + 1;
    185 
    186                 if (s.isEmpty())
    187                     break;
    188                 l.append(s);
    189             }
    190             result = l.join(", ");
    191             break;
    192         }
    193 
    194         case REG_NONE:
    195         case REG_BINARY: {
    196             result = QString::fromWCharArray((const wchar_t *)data.constData(), data.size() / 2);
    197             break;
    198         }
    199 
    200         case REG_DWORD_BIG_ENDIAN:
    201         case REG_DWORD: {
    202             Q_ASSERT(data.size() == sizeof(int));
    203             int i;
    204             memcpy((char*)&i, data.constData(), sizeof(int));
    205             result = QString::number(i);
    206             break;
    207         }
    208 
    209         default:
    210             qWarning("QSettings: unknown data %d type in windows registry", dataType);
    211             break;
    212     }
    213 
    214     RegCloseKey(handle);
    215     return result;
    216 #endif
    21799}
    218100
     
    580462}
    581463
     464QString Environment::symbianEpocRoot()
     465{
     466    // Call function defined in tools/shared/symbian/epocroot.h
     467    return ::epocRoot();
     468}
     469
    582470QT_END_NAMESPACE
  • trunk/tools/configure/environment.h

    r651 r769  
    7272    static bool rmdir(const QString &name);
    7373
     74    static QString symbianEpocRoot();
     75
    7476private:
    7577    static Compiler detectedCompiler;
    7678
    7779    static CompilerInfo *compilerInfo(Compiler compiler);
    78     static QString keyPath(const QString &rKey);
    79     static QString keyName(const QString &rKey);
    80     static QString readRegistryKey(HKEY parentHandle, const QString &rSubkey);
    8180};
    8281
  • trunk/tools/configure/tools.cpp

    r651 r769  
    147147            dictionary["EDITION"] = "Evaluation";
    148148            dictionary["QT_EDITION"] = "QT_EDITION_EVALUATION";
     149            licenseType = "Evaluation";
    149150        }
    150151    }
     
    213214
    214215    // Override for evaluation licenses
    215     if (dictionary["Edition"] == "Evaluation")
     216    if (dictionary["EDITION"] == "Evaluation")
    216217        dictionary["LICENSE_EXTENSION"] = "-EVALUATION";
    217218
  • trunk/tools/designer/src/components/formeditor/formwindow.cpp

    r651 r769  
    22202220        }
    22212221
     2222        if (manager->actionLower()->isEnabled()) {
     2223            popup->addAction(manager->actionLower());
     2224            popup->addAction(manager->actionRaise());
     2225            popup->addSeparator();
     2226        }
    22222227        popup->addAction(manager->actionCut());
    22232228        popup->addAction(manager->actionCopy());
  • trunk/tools/designer/src/components/formeditor/formwindow.h

    r651 r769  
    279279    void checkPreviewGeometry(QRect &r);
    280280
    281     void finishContextMenu(QWidget *w, QWidget *menuParent, QContextMenuEvent *e);
    282 
    283281    bool handleContextMenu(QWidget *widget, QWidget *managedWidget, QContextMenuEvent *e);
    284282    bool handleMouseButtonDblClickEvent(QWidget *widget, QWidget *managedWidget, QMouseEvent *e);
  • trunk/tools/designer/src/components/formeditor/qdesigner_resource.cpp

    r651 r769  
    14471447
    14481448    QList<QWidget*> tabOrder;
    1449     foreach (QString widgetName, tabStops->elementTabStop()) {
     1449    foreach (const QString &widgetName, tabStops->elementTabStop()) {
    14501450        if (QWidget *w = qFindChild<QWidget*>(widget, widgetName)) {
    14511451            tabOrder.append(w);
     
    24192419    if (resourceSet) {
    24202420        const QStringList activePaths = resourceSet->activeQrcPaths();
    2421         foreach (QString path, activePaths) {
     2421        foreach (const QString &path, activePaths) {
    24222422            if (qrcPaths.contains(path)) {
    24232423                DomResource *dom_res = new DomResource;
  • trunk/tools/designer/src/components/propertyeditor/designerpropertymanager.h

    r651 r769  
    103103    Q_OBJECT
    104104public:
    105     DesignerPropertyManager(QDesignerFormEditorInterface *core, QObject *parent = 0);
     105    explicit DesignerPropertyManager(QDesignerFormEditorInterface *core, QObject *parent = 0);
    106106    ~DesignerPropertyManager();
    107107
  • trunk/tools/designer/src/designer/qdesigner_actions.cpp

    r651 r769  
    581581
    582582    bool atLeastOne = false;
    583     foreach (QString fileName, fileNames) {
     583    foreach (const QString &fileName, fileNames) {
    584584        if (readInForm(fileName) && !atLeastOne)
    585585            atLeastOne = true;
     
    870870                removeBackup(backupFile);
    871871                fi.setFile(fileName);
    872                 backupFile = QString();
     872                backupFile.clear();
    873873                if (fi.exists())
    874874                    backupFile = createBackup(fileName);
  • trunk/tools/designer/src/designer/qdesigner_server.cpp

    r651 r769  
    8484    if(sSocket->waitForConnected(3000))
    8585    {
    86         foreach(QString file, files)
     86        foreach(const QString &file, files)
    8787        {
    8888            QFileInfo fi(file);
     
    9797void QDesignerServer::readFromClient()
    9898{
    99     QString file = QString();
    10099    while (m_socket->canReadLine()) {
    101         file = QString::fromUtf8(m_socket->readLine());
     100        QString file = QString::fromUtf8(m_socket->readLine());
    102101        if (!file.isNull()) {
    103102            file.remove(QLatin1Char('\n'));
     
    144143void QDesignerClient::readFromSocket()
    145144{
    146     QString file = QString();
    147145    while (m_socket->canReadLine()) {
    148146        QString file = QString::fromUtf8(m_socket->readLine());
  • trunk/tools/designer/src/designer/qdesigner_server.h

    r651 r769  
    5454    Q_OBJECT
    5555public:
    56     QDesignerServer(QObject *parent = 0);
     56    explicit QDesignerServer(QObject *parent = 0);
    5757    virtual ~QDesignerServer();
    5858
     
    7575    Q_OBJECT
    7676public:
    77     QDesignerClient(quint16 port, QObject *parent = 0);
     77    explicit QDesignerClient(quint16 port, QObject *parent = 0);
    7878    virtual ~QDesignerClient();
    7979
  • trunk/tools/designer/src/designer/versiondialog.cpp

    r651 r769  
    114114            m_path.lineTo(me->pos());
    115115            bool gotIt = true;
    116             QPoint pt;
    117             foreach(pt, hitPoints) {
     116            foreach(const QPoint &pt, hitPoints) {
    118117                if (!m_path.contains(pt)) {
    119118                    gotIt = false;
     
    122121            }
    123122            if (gotIt) {
    124                 foreach(pt, missPoints) {
     123                foreach(const QPoint &pt, missPoints) {
    125124                    if (m_path.contains(pt)) {
    126125                        gotIt = false;
  • trunk/tools/designer/src/lib/shared/actioneditor.cpp

    r651 r769  
    429429}
    430430
    431 // Set an intial property and mark it as changed in the sheet
     431// Set an initial property and mark it as changed in the sheet
    432432static void setInitialProperty(QDesignerPropertySheetExtension *sheet, const QString &name, const QVariant &value)
    433433{
  • trunk/tools/designer/src/lib/shared/actionrepository.cpp

    r651 r769  
    7878}
    7979
    80 static QIcon fixActionIcon(const QIcon &icon)
    81 {
    82     if (icon.isNull())
    83         return qdesigner_internal::emptyIcon();
    84     return icon;
    85 }
    86 
    8780namespace qdesigner_internal {
    8881
     
    9083ActionModel::ActionModel(QWidget *parent ) :
    9184    QStandardItemModel(parent),
     85    m_emptyIcon(emptyIcon()),
    9286    m_core(0)
    9387{
     
    128122       list += item(row, i);
    129123
    130     setItems(m_core, actionOfItem(list.front()), list);
     124    setItems(m_core, actionOfItem(list.front()), m_emptyIcon, list);
    131125}
    132126
     
    151145        items.push_back(item);
    152146    }
    153     setItems(m_core, action, items);
     147    setItems(m_core, action, m_emptyIcon, items);
    154148    appendRow(items);
    155149    return indexFromItem(items.front());
     
    186180}
    187181
    188 void  ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action, QStandardItemList &sl)
     182void  ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action,
     183                            const QIcon &defaultIcon,
     184                            QStandardItemList &sl)
    189185{
    190186
     
    201197    QStandardItem *item =  sl[NameColumn];
    202198    item->setText(action->objectName());
    203     item->setIcon(fixActionIcon(action->icon()));
     199    QIcon icon = action->icon();
     200    if (icon.isNull())
     201        icon = defaultIcon;
     202    item->setIcon(icon);
    204203    item->setToolTip(firstTooltip);
    205204    item->setWhatsThis(firstTooltip);
     
    245244
    246245    QSet<QAction*> actions;
    247     foreach (const  QModelIndex &index, indexes)
     246    foreach (const QModelIndex &index, indexes)
    248247        if (QStandardItem *item = itemFromIndex(index))
    249248            if (QAction *action = actionOfItem(item))
  • trunk/tools/designer/src/lib/shared/actionrepository_p.h

    r651 r769  
    6060#include <QtGui/QListView>
    6161#include <QtGui/QStackedWidget>
     62#include <QtGui/QIcon>
    6263
    6364QT_BEGIN_NAMESPACE
     
    111112
    112113private:
     114    typedef QList<QStandardItem *> QStandardItemList;
     115
    113116    void initializeHeaders();
    114 
    115     typedef QList<QStandardItem *> QStandardItemList;
    116     static void setItems(QDesignerFormEditorInterface *core, QAction *a, QStandardItemList &sl);
     117    static void setItems(QDesignerFormEditorInterface *core, QAction *a,
     118                         const QIcon &defaultIcon,
     119                         QStandardItemList &sl);
     120
     121    const QIcon m_emptyIcon;
    117122
    118123    QDesignerFormEditorInterface *m_core;
  • trunk/tools/designer/src/lib/shared/connectionedit_p.h

    r651 r769  
    8888    public:
    8989        enum Type { Source, Target };
    90         EndPoint(Connection *_con = 0, Type _type = Source) : con(_con), type(_type) {}
     90        explicit EndPoint(Connection *_con = 0, Type _type = Source) : con(_con), type(_type) {}
    9191        bool isNull() const { return con == 0; }
    9292        bool operator == (const EndPoint &other) const { return con == other.con && type == other.type; }
  • trunk/tools/designer/src/lib/shared/filterwidget_p.h

    r651 r769  
    6767
    6868/* A line edit that displays a grayed hintText (like "Type Here to Filter")
    69  * when not focussed and empty. When connecting to the changed signals and
     69 * when not focused and empty. When connecting to the changed signals and
    7070 * querying text, one has to be aware that the text is set to that hint
    7171 * text if isShowingHintText() returns true (that is, does not contain
  • trunk/tools/designer/src/lib/shared/iconloader.cpp

    r651 r769  
    6161        << (QString::fromUtf8(":/trolltech/formeditor/images/designer_") + name);
    6262
    63     foreach (QString f, candidates) {
     63    foreach (const QString &f, candidates) {
    6464        if (QFile::exists(f))
    6565            return QIcon(f);
     
    7171QDESIGNER_SHARED_EXPORT QIcon emptyIcon()
    7272{
    73     static const QIcon empty_icon(QLatin1String(":/trolltech/formeditor/images/emptyicon.png"));
    74     return  empty_icon;
     73    return QIcon(QLatin1String(":/trolltech/formeditor/images/emptyicon.png"));
    7574}
    7675
  • trunk/tools/designer/src/lib/shared/iconselector_p.h

    r651 r769  
    7777    Q_OBJECT
    7878
    79     LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0);
     79    explicit LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0);
    8080
    8181public:
  • trunk/tools/designer/src/lib/shared/plugindialog.cpp

    r651 r769  
    106106        QFont boldFont = topLevelItem->font(0);
    107107
    108         foreach (QString fileName, fileNames) {
     108        foreach (const QString &fileName, fileNames) {
    109109            QPluginLoader loader(fileName);
    110110            const QFileInfo fileInfo(fileName);
     
    128128        QTreeWidgetItem *topLevelItem = setTopLevelItem(QLatin1String("Failed Plugins"));
    129129        const QFont boldFont = topLevelItem->font(0);
    130         foreach (const QString plugin, notLoadedPlugins) {
     130        foreach (const QString &plugin, notLoadedPlugins) {
    131131            const QString failureReason = pluginManager->failureReason(plugin);
    132132            QTreeWidgetItem *pluginItem = setPluginItem(topLevelItem, plugin, boldFont);
  • trunk/tools/designer/src/lib/shared/qdesigner_introspection.cpp

    r651 r769  
    6464{
    6565    if (!c)
    66         return QString::null;
     66        return QString();
    6767    return QString::fromUtf8(c);
    6868}
  • trunk/tools/designer/src/lib/shared/qdesigner_menu.cpp

    r651 r769  
    8989QDesignerMenu::QDesignerMenu(QWidget *parent) :
    9090    QMenu(parent),
     91    m_subMenuPixmap(QPixmap(QLatin1String(":/trolltech/formeditor/images/submenu.png"))),
    9192    m_currentIndex(0),
    9293    m_addItem(new SpecialMenuAction(this)),
     
    557558QRect QDesignerMenu::subMenuPixmapRect(QAction *action) const
    558559{
    559     static const QPixmap pm(QLatin1String(":/trolltech/formeditor/images/submenu.png"));
    560560    const QRect g = actionGeometry(action);
    561     const int x = layoutDirection() == Qt::LeftToRight ? (g.right() - pm.width() - 2) : 2;
    562     const int y = g.top() + (g.height() - pm.height())/2 + 1;
    563     return QRect(x, y, pm.width(), pm.height());
     561    const int x = layoutDirection() == Qt::LeftToRight ? (g.right() - m_subMenuPixmap.width() - 2) : 2;
     562    const int y = g.top() + (g.height() - m_subMenuPixmap.height())/2 + 1;
     563    return QRect(x, y, m_subMenuPixmap.width(), m_subMenuPixmap.height());
    564564}
    565565
     
    598598            p.fillRect(g, lg);
    599599        } else if (hasSubMenuPixmap(a)) {
    600             static const QPixmap pm(QLatin1String(":/trolltech/formeditor/images/submenu.png"));
    601             p.drawPixmap(subMenuPixmapRect(a).topLeft(), pm);
     600            p.drawPixmap(subMenuPixmapRect(a).topLeft(), m_subMenuPixmap);
    602601        }
    603602    }
  • trunk/tools/designer/src/lib/shared/qdesigner_menu_p.h

    r651 r769  
    5858#include <QtGui/QAction>
    5959#include <QtGui/QMenu>
     60#include <QtGui/QPixmap>
    6061#include <QtCore/QHash>
    6162
     
    184185    bool hideSubMenuOnCursorKey();
    185186    bool showSubMenuOnCursorKey();
     187    const QPixmap m_subMenuPixmap;
    186188
    187189    QPoint m_startPosition;
  • trunk/tools/designer/src/lib/shared/qdesigner_objectinspector_p.h

    r651 r769  
    8686    Q_OBJECT
    8787public:
    88     QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0);
     88    explicit QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0);
    8989
    9090    // Select a qobject unmanaged by form window
  • trunk/tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h

    r651 r769  
    8181        Q_OBJECT
    8282    public:
    83         NewPromotedClassPanel(const QStringList &baseClasses,
    84                               int selectedBaseClass = -1,
    85                                QWidget *parent = 0);
     83        explicit NewPromotedClassPanel(const QStringList &baseClasses,
     84                                       int selectedBaseClass = -1,
     85                                       QWidget *parent = 0);
    8686
    8787        signals:
     
    115115        enum Mode { ModeEdit, ModeEditChooseClass };
    116116
    117         QDesignerPromotionDialog(QDesignerFormEditorInterface *core,
    118                                  QWidget *parent = 0,
    119                                  const QString &promotableWidgetClassName = QString(),
    120                                  QString *promoteTo = 0);
     117        explicit QDesignerPromotionDialog(QDesignerFormEditorInterface *core,
     118                                          QWidget *parent = 0,
     119                                          const QString &promotableWidgetClassName = QString(),
     120                                          QString *promoteTo = 0);
    121121        // Return an alphabetically ordered list of base class names for adding new classes.
    122122        static const QStringList &baseClassNames(const QDesignerPromotionInterface *promotion);
  • trunk/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h

    r651 r769  
    7070    Q_OBJECT
    7171public:
    72     QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);
     72    explicit QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);
    7373
    7474    // A pair <ValidationMode, bool isTranslatable>.
  • trunk/tools/designer/src/lib/shared/qdesigner_taskmenu.cpp

    r651 r769  
    676676        const QStringList parameterNames = qVariantValue<QStringList>(selectedItem->data(0, Qt::UserRole));
    677677
    678         // TODO: Check wether signal is connected to slot
     678        // TODO: Check whether signal is connected to slot
    679679        integr->emitNavigateToSlot(objectName, signalSignature, parameterNames);
    680680    }
  • trunk/tools/designer/src/lib/shared/qdesigner_toolbar.cpp

    r651 r769  
    449449}
    450450
    451 //that's a trick to get acces to the initStyleOption which is a protected member
     451//that's a trick to get access to the initStyleOption which is a protected member
    452452class FriendlyToolBar : public QToolBar {
    453453public:
  • trunk/tools/designer/src/lib/shared/qdesigner_utils_p.h

    r651 r769  
    299299    Q_OBJECT
    300300public:
    301     DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0);
     301    explicit DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0);
    302302    QIcon icon(const PropertySheetIconValue &value) const;
    303303    void clear();
     
    314314{
    315315public:
    316     PropertySheetStringValue(const QString &value = QString(),
     316    explicit PropertySheetStringValue(const QString &value = QString(),
    317317                             bool translatable = true,
    318318                             const QString &disambiguation = QString(),
     
    346346{
    347347public:
    348     PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(),
     348    explicit PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(),
    349349                                  bool translatable = true,
    350350                                  const QString &disambiguation = QString(),
    351351                                  const QString &comment = QString());
    352     PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey,
     352    explicit PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey,
    353353                                  bool translatable = true,
    354354                                  const QString &disambiguation = QString(),
  • trunk/tools/designer/src/lib/shared/qdesigner_widgetbox_p.h

    r651 r769  
    7171    enum LoadMode { LoadMerge, LoadReplace, LoadCustomWidgetsOnly };
    7272
    73     QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0);
     73    explicit QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0);
    7474
    7575    LoadMode loadMode() const;
  • trunk/tools/designer/src/lib/shared/qtresourceview_p.h

    r651 r769  
    6969    Q_OBJECT
    7070public:
    71     QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0);
     71    explicit QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0);
    7272    ~QtResourceView();
    7373
     
    121121    Q_OBJECT
    122122public:
    123     QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
     123    explicit QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
    124124    virtual ~QtResourceViewDialog();
    125125
  • trunk/tools/designer/src/lib/shared/richtexteditor_p.h

    r651 r769  
    7373    Q_OBJECT
    7474public:
    75     RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
     75    explicit RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);
    7676    ~RichTextEditorDialog();
    7777
  • trunk/tools/designer/src/lib/shared/shared_settings.cpp

    r651 r769  
    162162    // get template paths excluding internal ones
    163163    QStringList rc = formTemplatePaths();
    164     foreach (QString internalTemplatePath, defaultFormTemplatePaths()) {
     164    foreach (const QString &internalTemplatePath, defaultFormTemplatePaths()) {
    165165        const int index = rc.indexOf(internalTemplatePath);
    166166        if (index != -1)
  • trunk/tools/designer/src/lib/shared/textpropertyeditor_p.h

    r651 r769  
    9191        };
    9292
    93         TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine);
     93        explicit TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine);
    9494
    9595        TextPropertyValidationMode textPropertyValidationMode() const { return m_validationMode; }
  • trunk/tools/designer/src/lib/shared/widgetdatabase_p.h

    r651 r769  
    7575{
    7676public:
    77     WidgetDataBaseItem(const QString &name = QString(),
    78                        const QString &group = QString());
     77    explicit WidgetDataBaseItem(const QString &name = QString(),
     78                                const QString &group = QString());
    7979
    8080    QString name() const;
     
    160160    Q_OBJECT
    161161public:
    162     WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0);
     162    explicit WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0);
    163163    virtual ~WidgetDataBase();
    164164
  • trunk/tools/designer/src/lib/uilib/abstractformbuilder.cpp

    r651 r769  
    365365    if (!zOrderNames.isEmpty()) {
    366366        QList<QWidget *> zOrder = qVariantValue<QWidgetList>(w->property("_q_zOrder"));
    367         foreach (QString widgetName, zOrderNames) {
     367        foreach (const QString &widgetName, zOrderNames) {
    368368            if (QWidget *child = qFindChild<QWidget*>(w, widgetName)) {
    369369                if (child->parentWidget() == w) {
  • trunk/tools/designer/src/lib/uilib/formbuilder.cpp

    r651 r769  
    495495    m_customWidgets.clear();
    496496
    497     foreach (QString path, m_pluginPaths) {
     497    foreach (const QString &path, m_pluginPaths) {
    498498        const QDir dir(path);
    499499        const QStringList candidates = dir.entryList(QDir::Files);
  • trunk/tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.h

    r651 r769  
    7878    Q_OBJECT
    7979public:
    80     QAxWidgetExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
     80    explicit QAxWidgetExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
    8181
    8282protected:
  • trunk/tools/designer/src/plugins/activeqt/qdesigneraxwidget.h

    r651 r769  
    106106class QDesignerAxPluginWidget : public QDesignerAxWidget
    107107{
    108    // No Q_OBJECT here! - meta functionality is overriden
     108   // No Q_OBJECT here! - meta functionality is overridden
    109109public:
    110110    explicit QDesignerAxPluginWidget(QWidget *parent);
  • trunk/tools/designer/src/plugins/widgets/q3iconview/q3iconview_extrainfo.h

    r651 r769  
    8282    Q_OBJECT
    8383public:
    84     Q3IconViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
     84    explicit Q3IconViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
    8585
    8686protected:
  • trunk/tools/designer/src/plugins/widgets/q3iconview/q3iconview_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3IconViewPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3IconViewPlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3listbox/q3listbox_extrainfo.h

    r651 r769  
    8080    Q_OBJECT
    8181public:
    82     Q3ListBoxExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
     82    explicit Q3ListBoxExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
    8383
    8484protected:
  • trunk/tools/designer/src/plugins/widgets/q3listbox/q3listbox_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3ListBoxPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3ListBoxPlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3listview/q3listview_extrainfo.h

    r651 r769  
    8383    Q_OBJECT
    8484public:
    85     Q3ListViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
     85    explicit Q3ListViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
    8686
    8787protected:
  • trunk/tools/designer/src/plugins/widgets/q3listview/q3listview_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3ListViewPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3ListViewPlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3MainWindowPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3MainWindowPlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3table/q3table_extrainfo.h

    r651 r769  
    8080    Q_OBJECT
    8181public:
    82     Q3TableExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
     82    explicit Q3TableExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
    8383
    8484protected:
  • trunk/tools/designer/src/plugins/widgets/q3table/q3table_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3TablePlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3TablePlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3textedit/q3textedit_extrainfo.h

    r651 r769  
    8080    Q_OBJECT
    8181public:
    82     Q3TextEditExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
     82    explicit Q3TextEditExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
    8383
    8484protected:
  • trunk/tools/designer/src/plugins/widgets/q3textedit/q3textedit_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3TextEditPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3TextEditPlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h

    r651 r769  
    7979    Q_OBJECT
    8080public:
    81     Q3ToolBarExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
     81    explicit Q3ToolBarExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);
    8282
    8383protected:
  • trunk/tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3ToolBarPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3ToolBarPlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3widgets/q3widget_plugins.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3ButtonGroupPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3ButtonGroupPlugin(const QIcon &icon, QObject *parent = 0);
    5555    virtual ~Q3ButtonGroupPlugin();
    5656
     
    8181    Q_INTERFACES(QDesignerCustomWidgetInterface)
    8282public:
    83     Q3ComboBoxPlugin(const QIcon &icon, QObject *parent = 0);
     83    explicit Q3ComboBoxPlugin(const QIcon &icon, QObject *parent = 0);
    8484    virtual ~Q3ComboBoxPlugin();
    8585
     
    110110    Q_INTERFACES(QDesignerCustomWidgetInterface)
    111111public:
    112     Q3DateEditPlugin(const QIcon &icon, QObject *parent = 0);
     112    explicit Q3DateEditPlugin(const QIcon &icon, QObject *parent = 0);
    113113
    114114    virtual QString name() const;
     
    134134    Q_INTERFACES(QDesignerCustomWidgetInterface)
    135135public:
    136     Q3DateTimeEditPlugin(const QIcon &icon, QObject *parent = 0);
     136    explicit Q3DateTimeEditPlugin(const QIcon &icon, QObject *parent = 0);
    137137
    138138    virtual QString name() const;
     
    158158    Q_INTERFACES(QDesignerCustomWidgetInterface)
    159159public:
    160     Q3FramePlugin(const QIcon &icon, QObject *parent = 0);
     160    explicit Q3FramePlugin(const QIcon &icon, QObject *parent = 0);
    161161    virtual ~Q3FramePlugin();
    162162
     
    187187    Q_INTERFACES(QDesignerCustomWidgetInterface)
    188188public:
    189     Q3GroupBoxPlugin(const QIcon &icon, QObject *parent = 0);
     189    explicit Q3GroupBoxPlugin(const QIcon &icon, QObject *parent = 0);
    190190    virtual ~Q3GroupBoxPlugin();
    191191
     
    216216    Q_INTERFACES(QDesignerCustomWidgetInterface)
    217217public:
    218     Q3ProgressBarPlugin(const QIcon &icon, QObject *parent = 0);
     218    explicit Q3ProgressBarPlugin(const QIcon &icon, QObject *parent = 0);
    219219
    220220    virtual QString name() const;
     
    240240    Q_INTERFACES(QDesignerCustomWidgetInterface)
    241241public:
    242     Q3TextBrowserPlugin(const QIcon &icon, QObject *parent = 0);
     242    explicit Q3TextBrowserPlugin(const QIcon &icon, QObject *parent = 0);
    243243
    244244    virtual QString name() const;
     
    264264    Q_INTERFACES(QDesignerCustomWidgetInterface)
    265265public:
    266     Q3TimeEditPlugin(const QIcon &icon, QObject *parent = 0);
     266    explicit Q3TimeEditPlugin(const QIcon &icon, QObject *parent = 0);
    267267
    268268    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3widgetstack/q3widgetstack_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3WidgetStackPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3WidgetStackPlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/plugins/widgets/q3wizard/q3wizard_container.h

    r651 r769  
    6060    Q_OBJECT
    6161public:
    62     Q3WizardHelper(Q3Wizard *wizard);
     62    explicit Q3WizardHelper(Q3Wizard *wizard);
    6363private slots:
    6464    void slotCurrentChanged();
     
    7272    Q_INTERFACES(QDesignerExtraInfoExtension)
    7373public:
    74     Q3WizardExtraInfo(Q3Wizard *wizard, QDesignerFormEditorInterface *core, QObject *parent);
     74    explicit Q3WizardExtraInfo(Q3Wizard *wizard, QDesignerFormEditorInterface *core, QObject *parent);
    7575
    7676    virtual QWidget *widget() const;
  • trunk/tools/designer/src/plugins/widgets/q3wizard/q3wizard_plugin.h

    r651 r769  
    5252    Q_INTERFACES(QDesignerCustomWidgetInterface)
    5353public:
    54     Q3WizardPlugin(const QIcon &icon, QObject *parent = 0);
     54    explicit Q3WizardPlugin(const QIcon &icon, QObject *parent = 0);
    5555
    5656    virtual QString name() const;
  • trunk/tools/designer/src/src.pro

    r561 r769  
    1010CONFIG(shared,shared|static):SUBDIRS += plugins
    1111
    12 wince*: SUBDIRS -= designer plugins
    13 symbian: SUBDIRS = uitools
    14 contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= lib components
     12symbian|wince*: SUBDIRS = uitools
  • trunk/tools/doxygen/config/phonon.doxyfile

    r651 r769  
    66#---------------------------------------------------------------------------
    77PROJECT_NAME           = Qt
    8 PROJECT_NUMBER         = 4.6.2
     8PROJECT_NUMBER         = 4.6.3
    99OUTPUT_DIRECTORY       = doc
    1010CREATE_SUBDIRS         = NO
  • trunk/tools/linguist/linguist.pro

    r2 r769  
    55    lupdate \
    66    lconvert
    7 CONFIG  += ordered
    8 
  • trunk/tools/linguist/linguist/linguist.pro

    r561 r769  
    9999TR_DIR = $$PWD/../../../translations
    100100TRANSLATIONS = \
     101    $$TR_DIR/linguist_cs.ts \
    101102    $$TR_DIR/linguist_de.ts \
    102103    $$TR_DIR/linguist_fr.ts \
  • trunk/tools/linguist/linguist/linguist.qrc

    r561 r769  
    11<RCC>
    2     <qresource prefix="/" >
     2    <qresource prefix="/">
    33        <file>images/appicon.png</file>
    44        <file>images/mac/accelerator.png</file>
     
    2929        <file>images/s_check_warning.png</file>
    3030        <file>images/splash.png</file>
    31         <file>images/transbox.png</file>
    3231        <file>images/up.png</file>
    3332        <file>images/down.png</file>
  • trunk/tools/linguist/linguist/mainwindow.cpp

    r663 r769  
    9494#include <QUrl>
    9595#include <QWhatsThis>
     96
     97#include <ctype.h>
    9698
    9799QT_BEGIN_NAMESPACE
     
    23672369static bool haveMnemonic(const QString &str)
    23682370{
    2369     QString mnemonic = QKeySequence::mnemonic(str);
    2370     if (mnemonic == QLatin1String("Alt+Space")) {
    2371         // "Nobody" ever really uses these, and they are highly annoying
    2372         // because we get a lot of false positives.
    2373         return false;
    2374     }
    2375     return !mnemonic.isEmpty();
     2371    for (const ushort *p = (ushort *)str.constData();; ) { // Assume null-termination
     2372        ushort c = *p++;
     2373        if (!c)
     2374            break;
     2375        if (c == '&') {
     2376            c = *p++;
     2377            if (!c)
     2378                return false;
     2379            // "Nobody" ever really uses these alt-space, and they are highly annoying
     2380            // because we get a lot of false positives.
     2381            if (c != '&' && c != ' ' && QChar(c).isPrint()) {
     2382                const ushort *pp = p;
     2383                for (; *p < 256 && ::isalpha(*p); p++) ;
     2384                if (pp == p || *p != ';')
     2385                    return true;
     2386                // This looks like a HTML &entity;, so ignore it. As a HTML string
     2387                // won't contain accels anyway, we can stop scanning here.
     2388                break;
     2389            }
     2390        }
     2391    }
     2392    return false;
    23762393}
    23772394
  • trunk/tools/linguist/linguist/messageeditor.cpp

    r651 r769  
    9999    setObjectName(QLatin1String("scroll area"));
    100100
    101     // Use white explicitly as the background color for the editor page.
    102101    QPalette p;
    103     p.setColor(QPalette::Active,   QPalette::Base,   Qt::white);
    104     p.setColor(QPalette::Inactive, QPalette::Base,   Qt::white);
    105     p.setColor(QPalette::Disabled, QPalette::Base,   Qt::white);
    106     p.setColor(QPalette::Active,   QPalette::Window, Qt::white);
    107     p.setColor(QPalette::Inactive, QPalette::Window, Qt::white);
    108     p.setColor(QPalette::Disabled, QPalette::Window, Qt::white);
     102    p.setBrush(QPalette::Window, p.brush(QPalette::Active, QPalette::Base));
    109103    setPalette(p);
    110104
     
    136130{
    137131    QFrame *editorPage = new QFrame;
    138 
    139     editorPage->setStyleSheet(QLatin1String(
    140             "QLabel { font-weight: bold; }"
    141             ));
    142132    editorPage->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
    143133
  • trunk/tools/linguist/linguist/messageeditorwidgets.cpp

    r651 r769  
    172172
    173173    m_label = new QLabel(this);
     174    QFont fnt;
     175    fnt.setBold(true);
     176    m_label->setFont(fnt);
    174177    m_label->setText(label);
    175178    layout->addWidget(m_label);
     
    250253{
    251254    m_label = new QLabel(this);
     255    QFont fnt;
     256    fnt.setBold(true);
     257    m_label->setFont(fnt);
    252258    m_label->setText(label);
    253259
  • trunk/tools/linguist/linguist/messagemodel.cpp

    r651 r769  
    585585}
    586586
    587 void MultiContextItem::appendMessageItem(MessageItem *m)
    588 {
     587void MultiContextItem::appendMessageItems(const QList<MessageItem *> &m)
     588{
     589    QList<MessageItem *> nullItems = m; // Basically, just a reservation
     590    for (int i = 0; i < nullItems.count(); ++i)
     591        nullItems[i] = 0;
    589592    for (int i = 0; i < m_messageLists.count() - 1; ++i)
    590         m_messageLists[i].append(0);
    591     m_messageLists.last().append(m);
    592     m_multiMessageList.append(MultiMessageItem(m));
     593        m_messageLists[i] += nullItems;
     594    m_messageLists.last() += m;
     595    foreach (MessageItem *mi, m)
     596        m_multiMessageList.append(MultiMessageItem(mi));
    593597}
    594598
     
    711715    }
    712716    m_msgModel->endInsertColumns();
     717    int appendedContexts = 0;
    713718    for (int i = 0; i < dm->contextCount(); ++i) {
    714719        ContextItem *c = dm->contextItem(i);
     
    717722            MultiContextItem *mc = multiContextItem(mcx);
    718723            mc->assignLastModel(c, readWrite);
     724            QList<MessageItem *> appendItems;
    719725            for (int j = 0; j < c->messageCount(); ++j) {
    720726                MessageItem *m = c->messageItem(j);
    721727                int msgIdx = mc->findMessage(m->text(), m->comment());
    722                 if (msgIdx >= 0) {
     728                if (msgIdx >= 0)
    723729                    mc->putMessageItem(msgIdx, m);
    724                 } else {
    725                     int msgCnt = mc->messageCount();
    726                     m_msgModel->beginInsertRows(m_msgModel->createIndex(mcx, 0, 0), msgCnt, msgCnt);
    727                     mc->appendMessageItem(m);
    728                     m_msgModel->endInsertRows();
    729                     ++m_numMessages;
    730                 }
     730                else
     731                    appendItems << m;
     732            }
     733            if (!appendItems.isEmpty()) {
     734                int msgCnt = mc->messageCount();
     735                m_msgModel->beginInsertRows(m_msgModel->createIndex(mcx, 0, 0),
     736                                            msgCnt, msgCnt + appendItems.size() - 1);
     737                mc->appendMessageItems(appendItems);
     738                m_msgModel->endInsertRows();
     739                m_numMessages += appendItems.size();
    731740            }
    732741        } else {
    733             MultiContextItem item(modelCount() - 1, c, readWrite);
    734             m_msgModel->beginInsertRows(QModelIndex(), contextCount(), contextCount());
    735             m_multiContextList.append(item);
    736             m_msgModel->endInsertRows();
    737             m_numMessages += item.messageCount();
    738         }
     742            m_multiContextList << MultiContextItem(modelCount() - 1, c, readWrite);
     743            m_numMessages += c->messageCount();
     744            ++appendedContexts;
     745        }
     746    }
     747    if (appendedContexts) {
     748        // Do that en block to avoid itemview inefficiency. It doesn't hurt that we
     749        // announce the availability of the data "long" after it was actually added.
     750        m_msgModel->beginInsertRows(QModelIndex(),
     751                                    contextCount() - appendedContexts, contextCount() - 1);
     752        m_msgModel->endInsertRows();
    739753    }
    740754    dm->setWritable(readWrite);
  • trunk/tools/linguist/linguist/messagemodel.h

    r651 r769  
    333333    void moveModel(int oldPos, int newPos); // newPos is *before* removing at oldPos
    334334    void putMessageItem(int pos, MessageItem *m);
    335     void appendMessageItem(MessageItem *m);
     335    void appendMessageItems(const QList<MessageItem *> &m);
    336336    void removeMultiMessageItem(int pos);
    337337    void incrementFinishedCount() { ++m_finishedCount; }
  • trunk/tools/linguist/lupdate/cpp.cpp

    r651 r769  
    6666class HashString {
    6767public:
    68     HashString() : m_hashed(false) {}
    69     explicit HashString(const QString &str) : m_str(str), m_hashed(false) {}
    70     void setValue(const QString &str) { m_str = str; m_hashed = false; }
     68    HashString() : m_hash(0x80000000) {}
     69    explicit HashString(const QString &str) : m_str(str), m_hash(0x80000000) {}
     70    void setValue(const QString &str) { m_str = str; m_hash = 0x80000000; }
    7171    const QString &value() const { return m_str; }
    7272    bool operator==(const HashString &other) const { return m_str == other.m_str; }
    7373private:
    7474    QString m_str;
     75    // qHash() of a QString is only 28 bits wide, so we can use
     76    // the highest bit(s) as the "hash valid" flag.
    7577    mutable uint m_hash;
    76     mutable bool m_hashed;
    7778    friend uint qHash(const HashString &str);
    7879};
     
    8081uint qHash(const HashString &str)
    8182{
    82     if (!str.m_hashed) {
    83         str.m_hashed = true;
     83    if (str.m_hash & 0x80000000)
    8484        str.m_hash = qHash(str.m_str);
    85     }
    8685    return str.m_hash;
    8786}
     
    8988class HashStringList {
    9089public:
    91     explicit HashStringList(const QList<HashString> &list) : m_list(list), m_hashed(false) {}
     90    explicit HashStringList(const QList<HashString> &list) : m_list(list), m_hash(0x80000000) {}
    9291    const QList<HashString> &value() const { return m_list; }
    9392    bool operator==(const HashStringList &other) const { return m_list == other.m_list; }
     
    9594    QList<HashString> m_list;
    9695    mutable uint m_hash;
    97     mutable bool m_hashed;
    9896    friend uint qHash(const HashStringList &list);
    9997};
     
    10199uint qHash(const HashStringList &list)
    102100{
    103     if (!list.m_hashed) {
    104         list.m_hashed = true;
     101    if (list.m_hash & 0x80000000) {
    105102        uint hash = 0;
    106103        foreach (const HashString &qs, list.m_list) {
    107             hash ^= qHash(qs) ^ 0xa09df22f;
    108             hash = (hash << 13) | (hash >> 19);
     104            hash ^= qHash(qs) ^ 0x0ad9f526;
     105            hash = ((hash << 13) & 0x0fffffff) | (hash >> 15);
    109106        }
    110107        list.m_hash = hash;
     
    216213    struct IfdefState {
    217214        IfdefState() {}
    218         IfdefState(int _braceDepth, int _parenDepth) :
     215        IfdefState(int _bracketDepth, int _braceDepth, int _parenDepth) :
     216            bracketDepth(_bracketDepth),
    219217            braceDepth(_braceDepth),
    220218            parenDepth(_parenDepth),
     
    223221
    224222        SavedState state;
     223        int bracketDepth, bracketDepth1st;
    225224        int braceDepth, braceDepth1st;
    226225        int parenDepth, parenDepth1st;
     
    260259    bool qualifyOneCallbackOwn(const Namespace *ns, void *context) const;
    261260    bool qualifyOneCallbackUsing(const Namespace *ns, void *context) const;
     261    bool qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment,
     262                    NamespaceList *resolved, QSet<HashStringList> *visitedUsings) const;
    262263    bool qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment,
    263264                    NamespaceList *resolved) const;
     
    279280    enum {
    280281        Tok_Eof, Tok_class, Tok_friend, Tok_namespace, Tok_using, Tok_return,
    281         Tok_tr = 10, Tok_trUtf8, Tok_translate, Tok_translateUtf8, Tok_trid,
    282         Tok_Q_OBJECT = 20, Tok_Q_DECLARE_TR_FUNCTIONS,
     282        Tok_tr, Tok_trUtf8, Tok_translate, Tok_translateUtf8, Tok_trid,
     283        Tok_Q_OBJECT, Tok_Q_DECLARE_TR_FUNCTIONS,
    283284        Tok_Ident, Tok_Comment, Tok_String, Tok_Arrow, Tok_Colon, Tok_ColonColon,
    284         Tok_Equals,
    285         Tok_LeftBrace = 30, Tok_RightBrace, Tok_LeftParen, Tok_RightParen, Tok_Comma, Tok_Semicolon,
    286         Tok_Null = 40, Tok_Integer,
    287         Tok_QuotedInclude = 50, Tok_AngledInclude,
    288         Tok_Other = 99
     285        Tok_Equals, Tok_LeftBracket, Tok_RightBracket,
     286        Tok_LeftBrace, Tok_RightBrace, Tok_LeftParen, Tok_RightParen, Tok_Comma, Tok_Semicolon,
     287        Tok_Null, Tok_Integer,
     288        Tok_QuotedInclude, Tok_AngledInclude,
     289        Tok_Other
    289290    };
    290291
     
    298299    qlonglong yyInteger;
    299300    QStack<IfdefState> yyIfdefStack;
     301    int yyBracketDepth;
    300302    int yyBraceDepth;
    301303    int yyParenDepth;
    302304    int yyLineNo;
    303305    int yyCurLineNo;
     306    int yyBracketLineNo;
    304307    int yyBraceLineNo;
    305308    int yyParenLineNo;
     
    338341        directInclude = false;
    339342    }
     343    yyBracketDepth = 0;
    340344    yyBraceDepth = 0;
    341345    yyParenDepth = 0;
    342346    yyCurLineNo = 1;
     347    yyBracketLineNo = 1;
    343348    yyBraceLineNo = 1;
    344349    yyParenLineNo = 1;
     
    567572                if (yyCh == 'f') {
    568573                    // if, ifdef, ifndef
    569                     yyIfdefStack.push(IfdefState(yyBraceDepth, yyParenDepth));
     574                    yyIfdefStack.push(IfdefState(yyBracketDepth, yyBraceDepth, yyParenDepth));
    570575                    yyCh = getChar();
    571576                } else if (yyCh == 'n') {
     
    606611                        IfdefState &is = yyIfdefStack.top();
    607612                        if (is.elseLine != -1) {
    608                             if (yyBraceDepth != is.braceDepth1st || yyParenDepth != is.parenDepth1st)
    609                                 qWarning("%s:%d: Parenthesis/brace mismatch between "
     613                            if (yyBracketDepth != is.bracketDepth1st
     614                                || yyBraceDepth != is.braceDepth1st
     615                                || yyParenDepth != is.parenDepth1st)
     616                                qWarning("%s:%d: Parenthesis/bracket/brace mismatch between "
    610617                                         "#if and #else branches; using #if branch\n",
    611618                                         qPrintable(yyFileName), is.elseLine);
    612619                        } else {
     620                            is.bracketDepth1st = yyBracketDepth;
    613621                            is.braceDepth1st = yyBraceDepth;
    614622                            is.parenDepth1st = yyParenDepth;
     
    616624                        }
    617625                        is.elseLine = yyLineNo;
     626                        yyBracketDepth = is.bracketDepth;
    618627                        yyBraceDepth = is.braceDepth;
    619628                        yyParenDepth = is.parenDepth;
     
    625634                        IfdefState is = yyIfdefStack.pop();
    626635                        if (is.elseLine != -1) {
    627                             if (yyBraceDepth != is.braceDepth1st || yyParenDepth != is.parenDepth1st)
     636                            if (yyBracketDepth != is.bracketDepth1st
     637                                || yyBraceDepth != is.braceDepth1st
     638                                || yyParenDepth != is.parenDepth1st)
    628639                                qWarning("%s:%d: Parenthesis/brace mismatch between "
    629640                                         "#if and #else branches; using #if branch\n",
    630641                                         qPrintable(yyFileName), is.elseLine);
     642                            yyBracketDepth = is.bracketDepth1st;
    631643                            yyBraceDepth = is.braceDepth1st;
    632644                            yyParenDepth = is.parenDepth1st;
     
    901913                yyCh = getChar();
    902914                return Tok_RightParen;
     915            case '[':
     916                if (yyBracketDepth == 0)
     917                    yyBracketLineNo = yyCurLineNo;
     918                yyBracketDepth++;
     919                yyCh = getChar();
     920                return Tok_LeftBracket;
     921            case ']':
     922                if (yyBracketDepth == 0)
     923                    qWarning("%s:%d: Excess closing bracket in C++ code"
     924                             " (or abuse of the C++ preprocessor)\n",
     925                             qPrintable(yyFileName), yyCurLineNo);
     926                else
     927                    yyBracketDepth--;
     928                yyCh = getChar();
     929                return Tok_RightBracket;
    903930            case ',':
    904931                yyCh = getChar();
     
    10371064
    10381065struct QualifyOneData {
    1039     QualifyOneData(const NamespaceList &ns, int nsc, const HashString &seg, NamespaceList *rslvd)
    1040         : namespaces(ns), nsCount(nsc), segment(seg), resolved(rslvd)
     1066    QualifyOneData(const NamespaceList &ns, int nsc, const HashString &seg, NamespaceList *rslvd,
     1067                   QSet<HashStringList> *visited)
     1068        : namespaces(ns), nsCount(nsc), segment(seg), resolved(rslvd), visitedUsings(visited)
    10411069    {}
    10421070
     
    10451073    const HashString &segment;
    10461074    NamespaceList *resolved;
    1047     QSet<HashStringList> visitedUsings;
     1075    QSet<HashStringList> *visitedUsings;
    10481076};
    10491077
     
    10791107    QualifyOneData *data = (QualifyOneData *)context;
    10801108    foreach (const HashStringList &use, ns->usings)
    1081         if (!data->visitedUsings.contains(use)) {
    1082             data->visitedUsings.insert(use);
    1083             if (qualifyOne(use.value(), use.value().count(), data->segment, data->resolved))
     1109        if (!data->visitedUsings->contains(use)) {
     1110            data->visitedUsings->insert(use);
     1111            if (qualifyOne(use.value(), use.value().count(), data->segment, data->resolved,
     1112                           data->visitedUsings))
    10841113                return true;
    10851114        }
     
    10881117
    10891118bool CppParser::qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment,
    1090                            NamespaceList *resolved) const
    1091 {
    1092     QualifyOneData data(namespaces, nsCnt, segment, resolved);
     1119                           NamespaceList *resolved, QSet<HashStringList> *visitedUsings) const
     1120{
     1121    QualifyOneData data(namespaces, nsCnt, segment, resolved, visitedUsings);
    10931122
    10941123    if (visitNamespace(namespaces, nsCnt, &CppParser::qualifyOneCallbackOwn, &data))
     
    10961125
    10971126    return visitNamespace(namespaces, nsCnt, &CppParser::qualifyOneCallbackUsing, &data);
     1127}
     1128
     1129bool CppParser::qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment,
     1130                           NamespaceList *resolved) const
     1131{
     1132    QSet<HashStringList> visitedUsings;
     1133
     1134    return qualifyOne(namespaces, nsCnt, segment, resolved, &visitedUsings);
    10981135}
    10991136
     
    15261563    yyTok = getToken();
    15271564    while (yyTok != Tok_Eof) {
     1565        // these are array indexing operations. we ignore them entirely
     1566        // so they don't confuse our scoping of static initializers.
     1567        // we enter the loop by either reading a left bracket or by an
     1568        // #else popping the state.
     1569        while (yyBracketDepth)
     1570            yyTok = getToken();
    15281571        //qDebug() << "TOKEN: " << yyTok;
    15291572        switch (yyTok) {
     
    19932036                        context = comment.left(k);
    19942037                        comment.remove(0, k + 1);
    1995                         recordMessage(yyLineNo, context, QString(), comment, extracomment,
    1996                                       QString(), TranslatorMessage::ExtraData(), false, false);
     2038                        TranslatorMessage msg(
     2039                                transcode(context, false), QString(),
     2040                                transcode(comment, false), QString(),
     2041                                yyFileName, yyLineNo, QStringList(),
     2042                                TranslatorMessage::Finished, false);
     2043                        msg.setExtraComment(transcode(extracomment.simplified(), false));
    19972044                        extracomment.clear();
     2045                        tor->append(msg);
    19982046                        tor->setExtras(extra);
    19992047                        extra.clear();
     
    20662114            if (!yyParenDepth)
    20672115                prospectiveContext.clear();
     2116            // fallthrough
     2117        case Tok_Equals: // for static initializers; other cases make no difference
     2118        case Tok_RightBracket: // ignoring indexing; same reason
    20682119        case_default:
    20692120            yyTok = getToken();
     
    20802131                 " (or abuse of the C++ preprocessor)\n",
    20812132                 qPrintable(yyFileName), yyParenLineNo);
     2133    else if (yyBracketDepth != 0)
     2134        qWarning("%s:%d: Unbalanced opening bracket in C++ code"
     2135                 " (or abuse of the C++ preprocessor)\n",
     2136                 qPrintable(yyFileName), yyBracketLineNo);
    20822137}
    20832138
  • trunk/tools/linguist/lupdate/main.cpp

    r651 r769  
    137137
    138138static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFileNames,
    139     const QByteArray &codecForTr, const QString &sourceLanguage, const QString &targetLanguage,
     139    bool setCodec, const QString &sourceLanguage, const QString &targetLanguage,
    140140    UpdateOptions options, bool *fail)
    141141{
     
    155155            tor.resolveDuplicates();
    156156            cd.clearErrors();
    157             if (!codecForTr.isEmpty() && codecForTr != tor.codecName())
     157            if (setCodec && fetchedTor.codec() != tor.codec())
    158158                qWarning("lupdate warning: Codec for tr() '%s' disagrees with "
    159159                         "existing file's codec '%s'. Expect trouble.",
    160                          codecForTr.constData(), tor.codecName().constData());
     160                         fetchedTor.codecName().constData(), tor.codecName().constData());
    161161            if (!targetLanguage.isEmpty() && targetLanguage != tor.languageCode())
    162162                qWarning("lupdate warning: Specified target language '%s' disagrees with "
     
    168168                         qPrintable(sourceLanguage), qPrintable(tor.sourceLanguageCode()));
    169169        } else {
    170             if (!codecForTr.isEmpty())
    171                 tor.setCodecName(codecForTr);
     170            if (setCodec)
     171                tor.setCodec(fetchedTor.codec());
    172172            if (!targetLanguage.isEmpty())
    173173                tor.setLanguageCode(targetLanguage);
     
    191191            theseOptions |= NoLocations;
    192192        Translator out = merge(tor, fetchedTor, theseOptions, err);
    193         if (!codecForTr.isEmpty())
    194             out.setCodecName(codecForTr);
     193        if (setCodec)
     194            out.setCodec(fetchedTor.codec());
    195195
    196196        if ((options & Verbose) && !err.isEmpty()) {
     
    375375            }
    376376            Translator tor;
    377             QByteArray codecForTr;
     377            bool setCodec = false;
    378378            QStringList tmp = visitor.values(QLatin1String("CODEC"))
    379379                              + visitor.values(QLatin1String("DEFAULTCODEC"))
    380380                              + visitor.values(QLatin1String("CODECFORTR"));
    381381            if (!tmp.isEmpty()) {
    382                 codecForTr = tmp.last().toLatin1();
    383                 tor.setCodecName(codecForTr);
     382                tor.setCodecName(tmp.last().toLatin1());
     383                setCodec = true;
    384384            }
    385385            processProject(false, pfi, visitor, options, codecForSource,
    386386                           targetLanguage, sourceLanguage, &tor, fail);
    387             updateTsFiles(tor, tsFiles, codecForTr, sourceLanguage, targetLanguage, options, fail);
     387            updateTsFiles(tor, tsFiles, setCodec, sourceLanguage, targetLanguage, options, fail);
    388388            continue;
    389389        }
     
    658658        fetchedTor.setCodecName(codecForTr);
    659659        processSources(fetchedTor, sourceFiles, cd);
    660         updateTsFiles(fetchedTor, tsFileNames, codecForTr,
     660        updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(),
    661661                      sourceLanguage, targetLanguage, options, &fail);
    662662    } else {
     
    670670            processProjects(true, true, proFiles, options, QByteArray(),
    671671                            targetLanguage, sourceLanguage, &fetchedTor, &fail);
    672             updateTsFiles(fetchedTor, tsFileNames, codecForTr,
     672            updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(),
    673673                          sourceLanguage, targetLanguage, options, &fail);
    674674        } else {
  • trunk/tools/linguist/phrasebooks/russian.qph

    r561 r769  
    11761176    <target>ОглавлеМОе</target>
    11771177</phrase>
     1178<phrase>
     1179    <source>parse</source>
     1180    <target>разПбрать</target>
     1181</phrase>
     1182<phrase>
     1183    <source>parsing</source>
     1184    <target>разбПр</target>
     1185</phrase>
     1186<phrase>
     1187    <source>phrasebook</source>
     1188    <target>глПссарОй</target>
     1189</phrase>
     1190<phrase>
     1191    <source>phrase book</source>
     1192    <target>глПссарОй</target>
     1193</phrase>
     1194<phrase>
     1195    <source>In use</source>
     1196    <target>ИспПльзуется</target>
     1197</phrase>
     1198<phrase>
     1199    <source>Access denied</source>
     1200    <target>ДПступ запрещёМ</target>
     1201</phrase>
     1202<phrase>
     1203    <source>No error</source>
     1204    <target>Нет ПшОбкО</target>
     1205</phrase>
     1206<phrase>
     1207    <source>Not supported</source>
     1208    <target>Не пПЎЎержОвается</target>
     1209</phrase>
     1210<phrase>
     1211    <source>Already exists</source>
     1212    <target>Уже существует</target>
     1213</phrase>
     1214<phrase>
     1215    <source>Permission denied</source>
     1216    <target>ДПступ запрещёМ</target>
     1217</phrase>
    11781218</QPH>
  • trunk/tools/linguist/shared/qm.cpp

    r651 r769  
    595595                }
    596596                m += 4;
    597                 QString str = QString::fromUtf16((const ushort *)m, len/2);
     597                QString str = QString((const QChar *)m, len/2);
    598598                if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) {
    599599                    for (int i = 0; i < str.length(); ++i)
  • trunk/tools/linguist/shared/translator.h

    r651 r769  
    154154
    155155    void setCodecName(const QByteArray &name);
     156    void setCodec(QTextCodec *codec) { m_codec = codec; }
    156157    QByteArray codecName() const;
    157158    QTextCodec *codec() const { return m_codec; }
  • trunk/tools/qdoc3/test/assistant.qdocconf

    r651 r769  
    1818qhp.Assistant.indexTitle          = Qt Assistant Manual
    1919qhp.Assistant.extraFiles          = classic.css images/qt-logo.png images/trolltech-logo.png
    20 qhp.Assistant.filterAttributes    = qt 4.6.2 tools assistant
     20qhp.Assistant.filterAttributes    = qt 4.6.3 tools assistant
    2121qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual
    2222qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant
  • trunk/tools/qdoc3/test/designer.qdocconf

    r651 r769  
    1818qhp.Designer.indexTitle          = Qt Designer Manual
    1919qhp.Designer.extraFiles          = classic.css images/qt-logo.png images/trolltech-logo.png
    20 qhp.Designer.filterAttributes    = qt 4.6.2 tools designer
     20qhp.Designer.filterAttributes    = qt 4.6.3 tools designer
    2121qhp.Designer.customFilters.Designer.name = Qt Designer Manual
    2222qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer
  • trunk/tools/qdoc3/test/linguist.qdocconf

    r651 r769  
    1818qhp.Linguist.indexTitle          = Qt Linguist Manual
    1919qhp.Linguist.extraFiles          = classic.css images/qt-logo.png images/trolltech-logo.png
    20 qhp.Linguist.filterAttributes    = qt 4.6.2 tools linguist
     20qhp.Linguist.filterAttributes    = qt 4.6.3 tools linguist
    2121qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual
    2222qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist
  • trunk/tools/qdoc3/test/qmake.qdocconf

    r651 r769  
    1818qhp.qmake.indexTitle          = QMake Manual
    1919qhp.qmake.extraFiles          = classic.css images/qt-logo.png images/trolltech-logo.png
    20 qhp.qmake.filterAttributes    = qt 4.6.2 tools qmake
     20qhp.qmake.filterAttributes    = qt 4.6.3 tools qmake
    2121qhp.qmake.customFilters.qmake.name = qmake Manual
    2222qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake
  • trunk/tools/qdoc3/test/qt-build-docs.qdocconf

    r651 r769  
    3333                             images/stylesheet-coffee-plastique.png
    3434
    35 qhp.Qt.filterAttributes    = qt 4.6.2 qtrefdoc
    36 qhp.Qt.customFilters.Qt.name = Qt 4.6.2
    37 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.2
     35qhp.Qt.filterAttributes    = qt 4.6.3 qtrefdoc
     36qhp.Qt.customFilters.Qt.name = Qt 4.6.3
     37qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.3
    3838qhp.Qt.subprojects         = classes overviews examples
    3939qhp.Qt.subprojects.classes.title = Classes
  • trunk/tools/qdoc3/test/qt.qdocconf

    r651 r769  
    77project                 = Qt
    88versionsym              =
    9 version                 = 4.6.2
     9version                 = 4.6.3
    1010description             = Qt Reference Documentation
    1111url                     = http://qt.nokia.com/doc/4.6
     
    3535                             images/stylesheet-coffee-plastique.png
    3636
    37 qhp.Qt.filterAttributes    = qt 4.6.2 qtrefdoc
    38 qhp.Qt.customFilters.Qt.name = Qt 4.6.2
    39 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.2
     37qhp.Qt.filterAttributes    = qt 4.6.3 qtrefdoc
     38qhp.Qt.customFilters.Qt.name = Qt 4.6.3
     39qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.3
    4040qhp.Qt.subprojects         = classes overviews examples
    4141qhp.Qt.subprojects.classes.title = Classes
  • trunk/tools/qtestlib/wince/cetest/activesyncconnection.cpp

    r651 r769  
    444444}
    445445
     446bool ActiveSyncConnection::setDeviceAwake(bool activate, int *returnValue)
     447{
     448    if (!isConnected()) {
     449        qWarning("Cannot execute, connect to device first!");
     450        return false;
     451    }
     452    bool result = false;
     453
     454    // If we want to wait, we have to use CeRapiInvoke, as CeCreateProcess has no way to wait
     455    // until the process ends. The lib must have been build and also deployed already.
     456    if (!isConnected() && !connect())
     457        return false;
     458
     459    HRESULT res = S_OK;
     460
     461    //SYSTEM_POWER_STATUS_EX systemPowerState;
     462
     463    //res = CeGetSystemPowerStatusEx(&systemPowerState, true);
     464
     465    QString dllLocation = "\\Windows\\QtRemote.dll";
     466    QString functionName = "qRemoteToggleUnattendedPowerMode";
     467
     468    DWORD outputSize;
     469    BYTE* output;
     470    IRAPIStream *stream;
     471    int returned = 0;
     472    int toggle = int(activate);
     473
     474    res = CeRapiInvoke(dllLocation.utf16(), functionName.utf16(), 0, 0, &outputSize, &output, &stream, 0);
     475    if (S_OK != res) {
     476        DWORD ce_error = CeGetLastError();
     477        if (S_OK != ce_error) {
     478            qWarning("Error invoking %s on %s: %s", qPrintable(functionName),
     479                qPrintable(dllLocation), strwinerror(ce_error).constData());
     480        } else {
     481            qWarning("Error: %s on %s unexpectedly returned %d", qPrintable(functionName),
     482                qPrintable(dllLocation), res);
     483        }
     484    } else {
     485        DWORD written;
     486
     487        if (S_OK != stream->Write(&toggle, sizeof(toggle), &written)) {
     488            qWarning("   Could not write toggle option to process");
     489            return false;
     490        }
     491
     492        if (S_OK != stream->Read(&returned, sizeof(returned), &written)) {
     493            qWarning("   Could not access return value of process");
     494        }
     495        else
     496            result = true;
     497    }
     498
     499    if (returnValue)
     500        *returnValue = returned;
     501
     502    return result;
     503}
     504
     505bool ActiveSyncConnection::resetDevice()
     506{
     507    if (!isConnected()) {
     508        qWarning("Cannot execute, connect to device first!");
     509        return false;
     510    }
     511
     512    bool result = false;
     513    if (!isConnected() && !connect())
     514        return false;
     515
     516    QString dllLocation = "\\Windows\\QtRemote.dll";
     517    QString functionName = "qRemoteSoftReset";
     518
     519    DWORD outputSize;
     520    BYTE* output;
     521    IRAPIStream *stream;
     522
     523    int returned = 0;
     524
     525    HRESULT res = CeRapiInvoke(dllLocation.utf16(), functionName.utf16(), 0, 0, &outputSize, &output, &stream, 0);
     526    if (S_OK != res) {
     527        DWORD ce_error = CeGetLastError();
     528        if (S_OK != ce_error) {
     529            qWarning("Error invoking %s on %s: %s", qPrintable(functionName),
     530                qPrintable(dllLocation), strwinerror(ce_error).constData());
     531        } else {
     532            qWarning("Error: %s on %s unexpectedly returned %d", qPrintable(functionName),
     533                qPrintable(dllLocation), res);
     534        }
     535    } else {
     536        result = true;
     537    }
     538    return result;
     539}
     540
     541bool ActiveSyncConnection::toggleDevicePower(int *returnValue)
     542{
     543    if (!isConnected()) {
     544        qWarning("Cannot execute, connect to device first!");
     545        return false;
     546    }
     547
     548    bool result = false;
     549    if (!isConnected() && !connect())
     550        return false;
     551
     552    QString dllLocation = "\\Windows\\QtRemote.dll";
     553    QString functionName = "qRemotePowerButton";
     554
     555    DWORD outputSize;
     556    BYTE* output;
     557    IRAPIStream *stream;
     558    int returned = 0;
     559
     560    HRESULT res = CeRapiInvoke(dllLocation.utf16(), functionName.utf16(), 0, 0, &outputSize, &output, &stream, 0);
     561    if (S_OK != res) {
     562        DWORD ce_error = CeGetLastError();
     563        if (S_OK != ce_error) {
     564            qWarning("Error invoking %s on %s: %s", qPrintable(functionName),
     565                qPrintable(dllLocation), strwinerror(ce_error).constData());
     566        } else {
     567            qWarning("Error: %s on %s unexpectedly returned %d", qPrintable(functionName),
     568                qPrintable(dllLocation), res);
     569        }
     570    } else {
     571        DWORD written;
     572        if (S_OK != stream->Read(&returned, sizeof(returned), &written)) {
     573            qWarning("   Could not access return value of process");
     574        }
     575        else {
     576            result = true;
     577        }
     578    }
     579
     580    if (returnValue)
     581        *returnValue = returned;
     582    return result;
     583}
     584
    446585bool ActiveSyncConnection::createDirectory(const QString &path, bool deleteBefore)
    447586{
  • trunk/tools/qtestlib/wince/cetest/activesyncconnection.h

    r651 r769  
    8080
    8181    bool execute(QString program, QString arguments = QString(), int timeout = -1, int *returnValue = NULL);
     82    bool resetDevice();
     83    bool toggleDevicePower(int *returnValue = NULL);
     84    bool setDeviceAwake(bool activate, int *returnValue = NULL);
    8285private:
    8386    bool connected;
  • trunk/tools/qtestlib/wince/cetest/cetest.pro

    r561 r769  
    2020              $$QT_SOURCE_TREE/qmake \
    2121              $$QT_SOURCE_TREE/qmake/generators/symbian \
     22                          $$QT_SOURCE_TREE/tools/shared \
    2223              $$QT_BUILD_TREE/include \
    2324              $$QT_BUILD_TREE/include/QtCore \
    2425              $$QT_BUILD_TREE/src/corelib/global
     26                         
     27VPATH += $$QT_SOURCE_TREE/tools/shared
    2528
    2629DEPENDPATH += $$QT_BUILD_TREE/src/corelib/tools $$QT_BUILD_TREE/src/corelib/io
     
    3437        remoteconnection.cpp \
    3538        deployment.cpp \
     39        symbian/epocroot.cpp \
     40                windows/registry.cpp \
    3641        main.cpp
    3742
  • trunk/tools/qtestlib/wince/cetest/main.cpp

    r651 r769  
    4545#   include "activesyncconnection.h"
    4646#endif
     47
     48const int SLEEP_AFTER_RESET = 60000; // sleep for 1 minute
     49const int SLEEP_RECONNECT   = 2000;  // sleep for 2 seconds before trying another reconnect
    4750
    4851#include "deployment.h"
     
    124127        " -release          : Test release version\n"
    125128        " -libpath <path>   : Remote path to deploy Qt libraries to\n"
     129        " -reset            : Reset device before starting a test\n"
     130        " -awake            : Device does not go sleep mode\n"
    126131        " -qt-delete        : Delete the Qt libraries after execution\n"
    127132        " -project-delete   : Delete the project file(s) after execution\n"
     
    153158    bool cleanupQt = false;
    154159    bool cleanupProject = false;
     160    bool deviceReset = false;
     161    bool keepAwake = false;
    155162
    156163    for (int i=1; i<arguments.size(); ++i) {
     
    197204            cleanupQt = true;
    198205            cleanupProject = true;
     206        } else if (arguments.at(i).toLower() == QLatin1String("-reset")) {
     207            deviceReset = true;
     208        } else if (arguments.at(i).toLower() == QLatin1String("-awake")) {
     209            keepAwake = true;
    199210        } else if (arguments.at(i).toLower() == QLatin1String("-conf")) {
    200211            if (++i == arguments.size()) {
     
    353364        cout << "Error: Could not copy file(s) to device" << endl;
    354365        return -1;
     366    }
     367    // device power mode
     368    if (keepAwake)
     369    {
     370        int retVal = 0;
     371        if (!connection.setDeviceAwake(true, &retVal)) {
     372            cout << "Error: Could not set unattended mode on device" << endl;
     373            return -1;
     374        }
     375    }
     376
     377    // reset device
     378    if (deviceReset)
     379    {
     380        if (!connection.resetDevice()) {
     381        //if (!connection.toggleDevicePower( &retVal)) {
     382            cout << "Error: Could not reset the device" << endl;
     383            return -1;
     384        }
     385        cout << " Entering sleep after reset for " << SLEEP_AFTER_RESET / 1000 << " seconds ... " << endl;
     386        Sleep(SLEEP_AFTER_RESET);
     387        cout << " ... woke up. " << endl;
     388        connection.disconnect();
     389        // reconnect after reset
     390        int retryCount = 21;
     391        while (--retryCount)
     392        {
     393            if (!connection.connect())
     394                Sleep(SLEEP_RECONNECT);
     395            else
     396                break;
     397        }
     398        if (!connection.isConnected())
     399        {
     400            cout << "Error: Could not connect to device!" << endl;
     401            return -1;
     402        }
    355403    }
    356404
  • trunk/tools/qtestlib/wince/cetest/qmake_include.pri

    r561 r769  
    66           $$QT_SOURCE_TREE/qmake/project.cpp \
    77           $$QT_SOURCE_TREE/qmake/property.cpp \
    8            $$QT_SOURCE_TREE/qmake/generators/symbian/initprojectdeploy_symbian.cpp
     8           $$QT_SOURCE_TREE/qmake/generators/symbian/initprojectdeploy_symbian.cpp \
     9           $$QT_SOURCE_TREE/tools/shared/symbian/epocroot.cpp \
     10           $$QT_SOURCE_TREE/tools/shared/windows/registry.cpp
    911
  • trunk/tools/qtestlib/wince/remotelib/commands.cpp

    r651 r769  
    4040****************************************************************************/
    4141#include "commands.h"
     42#include <Pm.h>
     43#include <Pmpolicy.h>
     44
    4245
    4346#define CLEAN_FAIL(a) {delete appName; \
     
    125128    return true;
    126129}
     130/**
     131\brief Reset the device.
     132*/
     133int qRemoteSoftReset(DWORD, BYTE*, DWORD*, BYTE**, IRAPIStream* stream)
     134{   
     135    //POWER_STATE_ON        On state
     136    //POWER_STATE_OFF       Off state
     137    //POWER_STATE_CRITICAL  Critical state
     138    //POWER_STATE_BOOT      Boot state
     139    //POWER_STATE_IDLE      Idle state
     140    //POWER_STATE_SUSPEND   Suspend state
     141    //POWER_STATE_RESET     Reset state
     142
     143    DWORD returnValue  = SetSystemPowerState(0, POWER_STATE_RESET, POWER_FORCE);
     144    return returnValue;
     145}
     146
     147/**
     148\brief Toggle the unattended powermode of the device
     149*/
     150int qRemoteToggleUnattendedPowerMode(DWORD, BYTE*, DWORD*, BYTE**, IRAPIStream* stream)
     151{
     152    if (!stream)
     153        return -1;
     154
     155    DWORD bytesRead;
     156    int toggleVal   = 0;
     157    int returnValue = S_OK;
     158
     159    if (S_OK != stream->Read(&toggleVal, sizeof(toggleVal), &bytesRead))
     160        return -2;
     161
     162    //PPN_REEVALUATESTATE 0x0001 Reserved. Set dwData to zero (0).
     163    //PPN_POWERCHANGE 0x0002 Reserved. Set dwData to zero (0).
     164    //PPN_UNATTENDEDMODE 0x0003 Set dwData to TRUE or FALSE.
     165    //PPN_SUSPENDKEYPRESSED or
     166    //PPN_POWERBUTTONPRESSED 0x0004 Reserved. Set dwData to zero (0).
     167    //PPN_SUSPENDKEYRELEASED 0x0005 Reserved. Set dwData to zero (0).
     168    //PPN_APPBUTTONPRESSED 0x0006 Reserved. Set dwData to zero (0).
     169    //PPN_OEMBASE Greater than or equal to 0x10000
     170    //You can define higher values, such as 0x10001, 0x10002, and so on.
     171    // Reserved. Set dwData to zero (0).
     172    returnValue = PowerPolicyNotify(PPN_UNATTENDEDMODE, toggleVal);
     173
     174    if (S_OK != stream->Write(&returnValue, sizeof(returnValue), &bytesRead))
     175        return -3;
     176    else
     177        return S_OK;
     178}
     179
     180/**
     181\brief Virtually press the power button of the device
     182*/
     183int qRemotePowerButton(DWORD, BYTE*, DWORD*, BYTE**, IRAPIStream* stream)
     184{
     185    if (!stream)
     186        return -1;
     187
     188    DWORD bytesRead;
     189    int toggleVal   = 0;
     190    int returnValue = S_OK;
     191
     192    if (S_OK != stream->Read(&toggleVal, sizeof(toggleVal), &bytesRead))
     193        return -2;
     194
     195    //PPN_REEVALUATESTATE 0x0001 Reserved. Set dwData to zero (0).
     196    //PPN_POWERCHANGE 0x0002 Reserved. Set dwData to zero (0).
     197    //PPN_UNATTENDEDMODE 0x0003 Set dwData to TRUE or FALSE.
     198    //PPN_SUSPENDKEYPRESSED or
     199    //PPN_POWERBUTTONPRESSED 0x0004 Reserved. Set dwData to zero (0).
     200    //PPN_SUSPENDKEYRELEASED 0x0005 Reserved. Set dwData to zero (0).
     201    //PPN_APPBUTTONPRESSED 0x0006 Reserved. Set dwData to zero (0).
     202    //PPN_OEMBASE Greater than or equal to 0x10000
     203    //You can define higher values, such as 0x10001, 0x10002, and so on.
     204    // Reserved. Set dwData to zero (0).
     205    returnValue = PowerPolicyNotify(PPN_POWERBUTTONPRESSED, 0);
     206
     207    if (S_OK != stream->Write(&returnValue, sizeof(returnValue), &bytesRead))
     208        return -3;
     209    else
     210        return S_OK;
     211}
     212
  • trunk/tools/qtestlib/wince/remotelib/commands.h

    r651 r769  
    4646extern "C" {
    4747    int __declspec(dllexport) qRemoteLaunch(DWORD, BYTE*, DWORD*, BYTE**, IRAPIStream*);
     48    int __declspec(dllexport) qRemoteSoftReset(DWORD, BYTE*, DWORD*, BYTE**, IRAPIStream* stream);
     49    int __declspec(dllexport) qRemoteToggleUnattendedPowerMode(DWORD, BYTE*, DWORD*, BYTE**, IRAPIStream* stream);
     50    int __declspec(dllexport) qRemotePowerButton(DWORD, BYTE*, DWORD*, BYTE**, IRAPIStream* stream);
    4851    bool __declspec(dllexport) qRemoteExecute(const wchar_t* program, const wchar_t* arguments = NULL, int *returnValue = NULL , DWORD* error = NULL, int timeout = -1);
    4952}
  • trunk/tools/runonphone/main.cpp

    r651 r769  
    4545#include <QScopedPointer>
    4646#include <QTimer>
    47 #include "trkutils.h"
    48 #include "trkdevice.h"
    49 #include "launcher.h"
     47#include "symbianutils/trkutils.h"
     48#include "symbianutils/trkdevice.h"
     49#include "symbianutils/launcher.h"
    5050
    5151#include "trksignalhandler.h"
     
    134134    }
    135135
    136     if(serialPortName.isEmpty()) {
    137         if(loglevel > 0)
     136    if (serialPortName.isEmpty()) {
     137        if (loglevel > 0)
    138138            outstream << "Detecting serial ports" << endl;
    139139        QList <SerialPortId> ports = enumerateSerialPorts();
    140140        foreach(SerialPortId id, ports) {
    141             if(loglevel > 0)
     141            if (loglevel > 0)
    142142                outstream << "Port Name: " << id.portName << ", "
    143143                     << "Friendly Name:" << id.friendlyName << endl;
    144             if(serialPortName.isEmpty()) {
    145                 if(!id.friendlyName.isEmpty() &&
    146                    serialPortFriendlyName.isEmpty() &&
    147                     (id.friendlyName.contains("symbian", Qt::CaseInsensitive) ||
    148                        id.friendlyName.contains("s60", Qt::CaseInsensitive) ||
    149                        id.friendlyName.contains("nokia", Qt::CaseInsensitive)))
     144            if (serialPortName.isEmpty()) {
     145                if (!id.friendlyName.isEmpty()
     146                        && serialPortFriendlyName.isEmpty()
     147                        && (id.friendlyName.contains("symbian", Qt::CaseInsensitive)
     148                            || id.friendlyName.contains("s60", Qt::CaseInsensitive)
     149                            || id.friendlyName.contains("nokia", Qt::CaseInsensitive)))
    150150                        serialPortName = id.portName;
    151                 else if (!id.friendlyName.isEmpty() &&
    152                          !serialPortFriendlyName.isEmpty() &&
    153                         id.friendlyName.contains(serialPortFriendlyName))
    154                         serialPortName = id.portName;
     151                else if (!id.friendlyName.isEmpty()
     152                        && !serialPortFriendlyName.isEmpty()
     153                        && id.friendlyName.contains(serialPortFriendlyName))
     154                    serialPortName = id.portName;
    155155            }
    156156        }
    157         if(serialPortName.isEmpty()) {
     157        if (serialPortName.isEmpty()) {
    158158            errstream << "No phone found, ensure USB cable is connected or specify manually with -p" << endl;
    159159            return 1;
     
    163163    QScopedPointer<trk::Launcher> launcher;
    164164
    165     if(sisFile.isEmpty()) {
     165    if (sisFile.isEmpty()) {
    166166        launcher.reset(new trk::Launcher(trk::Launcher::ActionCopyRun));
    167167        launcher->setCopyFileName(exeFile, QString("c:\\sys\\bin\\") + exeFile);
     
    173173        launcher->setInstallFileName("c:\\data\\testtemp.sis");
    174174    }
    175     if(loglevel > 0)
     175    if (loglevel > 0)
    176176        outstream << "Connecting to target via " << serialPortName << endl;
    177 #ifdef Q_OS_WIN
    178     launcher->setTrkServerName(QString("\\\\.\\") + serialPortName);
    179 #else
    180177    launcher->setTrkServerName(serialPortName);
    181 #endif
    182178
    183179    launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile);
    184180    launcher->setCommandLineArgs(cmdLine);
    185181
    186     if(loglevel > 1)
     182    if (loglevel > 1)
    187183        launcher->setVerbose(1);
    188184
     
    217213
    218214    QString errorMessage;
    219     if(!launcher->startServer(&errorMessage)) {
     215    if (!launcher->startServer(&errorMessage)) {
    220216        errstream << errorMessage << endl;
    221217        return 1;
  • trunk/tools/runonphone/runonphone.pro

    r651 r769  
    55CONFIG -= app_bundle
    66
    7 include(trk/trk.pri)
     7include(symbianutils/symbianutils.pri)
    88
    99SOURCES += main.cpp \
     
    1212HEADERS += trksignalhandler.h \
    1313    serenum.h
     14
     15DEFINES += SYMBIANUTILS_INCLUDE_PRI
    1416
    1517windows {
  • trunk/tools/runonphone/serenum_stub.cpp

    r651 r769  
    4848{
    4949    QList<SerialPortId> list;
    50     qWarning() << "enumerateSerialPorts not implemented" << endl;
     50    qWarning() << "enumerateSerialPorts not implemented";
    5151    return list;
    5252}
  • trunk/tools/runonphone/serenum_unix.cpp

    r651 r769  
    5252    QDir dir("/dev/serial/by-id/");
    5353    QFileInfoList ports(dir.entryInfoList());
    54     foreach(QFileInfo info, ports) {
     54    foreach (const QFileInfo &info, ports) {
    5555        if (!info.isDir()) {
    5656            SerialPortId id;
  • trunk/tools/runonphone/trksignalhandler.cpp

    r651 r769  
    5959void TrkSignalHandler::copyingStarted()
    6060{
    61     if(d->loglevel > 0)
     61    if (d->loglevel > 0)
    6262        d->out << "Copying..." << endl;
    6363}
     
    6565void TrkSignalHandler::canNotConnect(const QString &errorMessage)
    6666{
    67     d->err << "Cannot Connect - " << errorMessage << endl;
     67    d->err << "Cannot connect - " << errorMessage << endl;
    6868}
    6969
     
    8585void TrkSignalHandler::installingStarted()
    8686{
    87     if(d->loglevel > 0)
     87    if (d->loglevel > 0)
    8888        d->out << "Installing..." << endl;
    8989}
     
    9696void TrkSignalHandler::installingFinished()
    9797{
    98     if(d->loglevel > 0)
     98    if (d->loglevel > 0)
    9999        d->out << "Installing finished" << endl;
    100100}
     
    102102void TrkSignalHandler::startingApplication()
    103103{
    104     if(d->loglevel > 0)
     104    if (d->loglevel > 0)
    105105        d->out << "Starting app..." << endl;
    106106}
     
    108108void TrkSignalHandler::applicationRunning(uint pid)
    109109{
    110     if(d->loglevel > 0)
     110    if (d->loglevel > 0)
    111111        d->out << "Running..." << endl;
    112112}
     
    119119void TrkSignalHandler::finished()
    120120{
    121     if(d->loglevel > 0)
     121    if (d->loglevel > 0)
    122122        d->out << "Done." << endl;
    123123    QCoreApplication::quit();
     
    126126void TrkSignalHandler::applicationOutputReceived(const QString &output)
    127127{
    128     d->out << output;
     128    d->out << output << flush;
    129129}
    130130
    131131void TrkSignalHandler::copyProgress(int percent)
    132132{
    133     if(d->loglevel > 0) {
     133    if (d->loglevel > 0) {
    134134        d->out << percent << "% ";
    135135        d->out.flush();
    136         if(percent==100)
     136        if (percent==100)
    137137            d->out << endl;
    138138    }
     
    141141void TrkSignalHandler::stateChanged(int state)
    142142{
    143     if(d->loglevel > 1)
     143    if (d->loglevel > 1)
    144144        d->out << "State" << state << endl;
    145145}
     
    165165}
    166166
    167 TrkSignalHandlerPrivate::TrkSignalHandlerPrivate() :
    168         out(stdout),
    169         err(stderr),
    170         loglevel(0)
     167TrkSignalHandlerPrivate::TrkSignalHandlerPrivate()
     168    : out(stdout),
     169    err(stderr),
     170    loglevel(0)
    171171{
    172172
     
    180180
    181181TrkSignalHandler::TrkSignalHandler()
     182    : d(new TrkSignalHandlerPrivate())
    182183{
    183     d = new TrkSignalHandlerPrivate();
    184184}
    185185
  • trunk/tools/shared/findwidget/abstractfindwidget.h

    r651 r769  
    7171    Q_DECLARE_FLAGS(FindFlags, FindFlag)
    7272
    73     AbstractFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);
     73    explicit AbstractFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);
    7474    virtual ~AbstractFindWidget();
    7575
  • trunk/tools/shared/findwidget/itemviewfindwidget.h

    r651 r769  
    5656
    5757public:
    58     ItemViewFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);
     58    explicit ItemViewFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);
    5959
    6060    QAbstractItemView *itemView() const
  • trunk/tools/shared/findwidget/texteditfindwidget.h

    r651 r769  
    5454
    5555public:
    56     TextEditFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);
     56    explicit TextEditFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);
    5757
    5858    QTextEdit *textEdit() const
  • trunk/tools/shared/fontpanel/fontpanel.cpp

    r651 r769  
    218218
    219219    if (hasStyles) {
    220         foreach (QString style, styles) {
     220        foreach (const QString &style, styles) {
    221221            // try to maintain selection or select 'normal' preferably
    222222            const int newIndex = m_styleComboBox->count();
  • trunk/tools/shared/qtgradienteditor/qtgradientutils.cpp

    r651 r769  
    396396{
    397397    QStringList result;
    398     foreach (QGradientStop stop, gradient.stops()) {
     398    foreach (const QGradientStop &stop, gradient.stops()) {
    399399        const QColor color = stop.second;
    400400
  • trunk/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp

    r651 r769  
    9494}
    9595
     96void QtCursorDatabase::clear()
     97{
     98    m_cursorNames.clear();
     99    m_cursorIcons.clear();
     100    m_valueToCursorShape.clear();
     101    m_cursorShapeToValue.clear();
     102}
     103
    96104void QtCursorDatabase::appendCursor(Qt::CursorShape shape, const QString &name, const QIcon &icon)
    97105{
    98106    if (m_cursorShapeToValue.contains(shape))
    99107        return;
    100     int value = m_cursorNames.count();
     108    const int value = m_cursorNames.count();
    101109    m_cursorNames.append(name);
    102     m_cursorIcons[value] = icon;
    103     m_valueToCursorShape[value] = shape;
    104     m_cursorShapeToValue[shape] = value;
     110    m_cursorIcons.insert(value, icon);
     111    m_valueToCursorShape.insert(value, shape);
     112    m_cursorShapeToValue.insert(shape, value);
    105113}
    106114
  • trunk/tools/shared/qtpropertybrowser/qtpropertybrowserutils_p.h

    r651 r769  
    6969public:
    7070    QtCursorDatabase();
     71    void clear();
    7172
    7273    QStringList cursorShapeNames() const;
  • trunk/tools/shared/qtpropertybrowser/qtpropertymanager.cpp

    r651 r769  
    13921392
    13931393// QtBoolPropertyManager
    1394 
    1395 class QtBoolPropertyManagerPrivate
    1396 {
    1397     QtBoolPropertyManager *q_ptr;
    1398     Q_DECLARE_PUBLIC(QtBoolPropertyManager)
    1399 public:
    1400 
    1401     QMap<const QtProperty *, bool> m_values;
    1402 };
    1403 
    1404 /*!
    1405     \class QtBoolPropertyManager
    1406     \internal
    1407     \inmodule QtDesigner
    1408     \since 4.4
    1409 
    1410     \brief The QtBoolPropertyManager class provides and manages boolean properties.
    1411 
    1412     The property's value can be retrieved using the value() function,
    1413     and set using the setValue() slot.
    1414 
    1415     In addition, QtBoolPropertyManager provides the valueChanged() signal
    1416     which is emitted whenever a property created by this manager
    1417     changes.
    1418 
    1419     \sa QtAbstractPropertyManager, QtCheckBoxFactory
    1420 */
    1421 
    1422 /*!
    1423     \fn void QtBoolPropertyManager::valueChanged(QtProperty *property, bool value)
    1424 
    1425     This signal is emitted whenever a property created by this manager
    1426     changes its value, passing a pointer to the \a property and the
    1427     new \a value as parameters.
    1428 */
    1429 
    1430 /*!
    1431     Creates a manager with the given \a parent.
    1432 */
    1433 QtBoolPropertyManager::QtBoolPropertyManager(QObject *parent)
    1434     : QtAbstractPropertyManager(parent), d_ptr(new QtBoolPropertyManagerPrivate)
    1435 {
    1436     d_ptr->q_ptr = this;
    1437 }
    1438 
    1439 /*!
    1440     Destroys this manager, and all the properties it has created.
    1441 */
    1442 QtBoolPropertyManager::~QtBoolPropertyManager()
    1443 {
    1444     clear();
    1445 }
    1446 
    1447 /*!
    1448     Returns the given \a property's value.
    1449 
    1450     If the given \a property is not managed by \e this manager, this
    1451     function returns false.
    1452 
    1453     \sa setValue()
    1454 */
    1455 bool QtBoolPropertyManager::value(const QtProperty *property) const
    1456 {
    1457     return d_ptr->m_values.value(property, false);
    1458 }
    1459 
    1460 /*!
    1461     \reimp
    1462 */
    1463 QString QtBoolPropertyManager::valueText(const QtProperty *property) const
    1464 {
    1465     const QMap<const QtProperty *, bool>::const_iterator it = d_ptr->m_values.constFind(property);
    1466     if (it == d_ptr->m_values.constEnd())
    1467         return QString();
    1468 
    1469     static const QString trueText = tr("True");
    1470     static const QString falseText = tr("False");
    1471     return it.value() ? trueText : falseText;
    1472 }
    1473 
    1474 // Return an icon containing a check box indicator
     1394//     Return an icon containing a check box indicator
    14751395static QIcon drawCheckBox(bool value)
    14761396{
     
    15021422}
    15031423
     1424class QtBoolPropertyManagerPrivate
     1425{
     1426    QtBoolPropertyManager *q_ptr;
     1427    Q_DECLARE_PUBLIC(QtBoolPropertyManager)
     1428public:
     1429    QtBoolPropertyManagerPrivate();
     1430
     1431    QMap<const QtProperty *, bool> m_values;
     1432    const QIcon m_checkedIcon;
     1433    const QIcon m_uncheckedIcon;
     1434};
     1435
     1436QtBoolPropertyManagerPrivate::QtBoolPropertyManagerPrivate() :
     1437    m_checkedIcon(drawCheckBox(true)),
     1438    m_uncheckedIcon(drawCheckBox(false))
     1439{
     1440}
     1441
     1442/*!
     1443    \class QtBoolPropertyManager
     1444    \internal
     1445    \inmodule QtDesigner
     1446    \since 4.4
     1447
     1448    \brief The QtBoolPropertyManager class provides and manages boolean properties.
     1449
     1450    The property's value can be retrieved using the value() function,
     1451    and set using the setValue() slot.
     1452
     1453    In addition, QtBoolPropertyManager provides the valueChanged() signal
     1454    which is emitted whenever a property created by this manager
     1455    changes.
     1456
     1457    \sa QtAbstractPropertyManager, QtCheckBoxFactory
     1458*/
     1459
     1460/*!
     1461    \fn void QtBoolPropertyManager::valueChanged(QtProperty *property, bool value)
     1462
     1463    This signal is emitted whenever a property created by this manager
     1464    changes its value, passing a pointer to the \a property and the
     1465    new \a value as parameters.
     1466*/
     1467
     1468/*!
     1469    Creates a manager with the given \a parent.
     1470*/
     1471QtBoolPropertyManager::QtBoolPropertyManager(QObject *parent)
     1472    : QtAbstractPropertyManager(parent), d_ptr(new QtBoolPropertyManagerPrivate)
     1473{
     1474    d_ptr->q_ptr = this;
     1475}
     1476
     1477/*!
     1478    Destroys this manager, and all the properties it has created.
     1479*/
     1480QtBoolPropertyManager::~QtBoolPropertyManager()
     1481{
     1482    clear();
     1483}
     1484
     1485/*!
     1486    Returns the given \a property's value.
     1487
     1488    If the given \a property is not managed by \e this manager, this
     1489    function returns false.
     1490
     1491    \sa setValue()
     1492*/
     1493bool QtBoolPropertyManager::value(const QtProperty *property) const
     1494{
     1495    return d_ptr->m_values.value(property, false);
     1496}
     1497
     1498/*!
     1499    \reimp
     1500*/
     1501QString QtBoolPropertyManager::valueText(const QtProperty *property) const
     1502{
     1503    const QMap<const QtProperty *, bool>::const_iterator it = d_ptr->m_values.constFind(property);
     1504    if (it == d_ptr->m_values.constEnd())
     1505        return QString();
     1506
     1507    static const QString trueText = tr("True");
     1508    static const QString falseText = tr("False");
     1509    return it.value() ? trueText : falseText;
     1510}
     1511
    15041512/*!
    15051513    \reimp
     
    15111519        return QIcon();
    15121520
    1513     static const QIcon checkedIcon = drawCheckBox(true);
    1514     static const QIcon uncheckedIcon = drawCheckBox(false);
    1515     return it.value() ? checkedIcon : uncheckedIcon;
     1521    return it.value() ? d_ptr->m_checkedIcon : d_ptr->m_uncheckedIcon;
    15161522}
    15171523
     
    62886294// QtCursorPropertyManager
    62896295
    6290 Q_GLOBAL_STATIC(QtCursorDatabase, cursorDatabase)
     6296// Make sure icons are removed as soon as QApplication is destroyed, otherwise,
     6297// handles are leaked on X11.
     6298static void clearCursorDatabase();
     6299Q_GLOBAL_STATIC_WITH_INITIALIZER(QtCursorDatabase, cursorDatabase, qAddPostRoutine(clearCursorDatabase))
     6300
     6301static void clearCursorDatabase()
     6302{
     6303    cursorDatabase()->clear();
     6304}
    62916305
    62926306class QtCursorPropertyManagerPrivate
  • trunk/tools/shared/qttoolbardialog/qttoolbardialog.h

    r651 r769  
    6969public:
    7070
    71     QtToolBarManager(QObject *parent = 0);
     71    explicit QtToolBarManager(QObject *parent = 0);
    7272    ~QtToolBarManager();
    7373
     
    101101public:
    102102
    103     QtToolBarDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
     103    explicit QtToolBarDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);
    104104    ~QtToolBarDialog();
    105105
  • trunk/tools/tools.pro

    r634 r769  
    2929contains(QT_CONFIG, declarative):SUBDIRS += qmlviewer qmldebugger
    3030contains(QT_CONFIG, dbus):SUBDIRS += qdbus
    31 !wince*:contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns xmlpatternsvalidator
     31# We don't need these command line utilities on embedded platforms.
     32!wince*:!symbian:contains(QT_CONFIG, xmlpatterns): SUBDIRS += xmlpatterns xmlpatternsvalidator
    3233embedded: SUBDIRS += makeqpf
    3334
Note: See TracChangeset for help on using the changeset viewer.