Changeset 769 for trunk/tools
- Timestamp:
- Aug 2, 2010, 9:27:30 PM (15 years ago)
- Location:
- trunk
- Files:
-
- 2 deleted
- 124 edited
- 25 copied
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.6.3 (added) merged: 768 /branches/vendor/nokia/qt/current merged: 767 /branches/vendor/nokia/qt/4.6.2 removed
- Property svn:mergeinfo changed
-
trunk/tools/assistant/lib/fulltextsearch/qclucene-config_p.h
r703 r769 530 530 /* #undef _CL__CND_DEBUG */ 531 531 532 /* debug ing option */532 /* debugging option */ 533 533 /* #undef _DEBUG */ 534 534 -
trunk/tools/assistant/lib/qhelpcollectionhandler.cpp
r651 r769 253 253 "Value BLOB )"); 254 254 255 foreach ( QStringq, tables) {255 foreach (const QString &q, tables) { 256 256 if (!query->exec(q)) 257 257 return false; … … 324 324 } 325 325 326 foreach ( QStringid, idsToInsert) {326 foreach (const QString &id, idsToInsert) { 327 327 m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); 328 328 m_query.bindValue(0, id); … … 347 347 m_query.exec(); 348 348 349 foreach ( QStringatt, attributes) {349 foreach (const QString &att, attributes) { 350 350 m_query.prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); 351 351 m_query.bindValue(0, nameId); … … 401 401 402 402 addFilterAttributes(reader.filterAttributes()); 403 foreach ( QStringfilterName, reader.customFilters())403 foreach (const QString &filterName, reader.customFilters()) 404 404 addCustomFilter(filterName, reader.filterAttributes(filterName)); 405 405 … … 500 500 atts.insert(m_query.value(0).toString()); 501 501 502 foreach ( QStrings, attributes) {502 foreach (const QString &s, attributes) { 503 503 if (!atts.contains(s)) { 504 504 m_query.prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); -
trunk/tools/assistant/lib/qhelpcontentwidget.cpp
r651 r769 254 254 m_mutex.unlock(); 255 255 256 foreach ( QStringdbFileName, fileNames) {256 foreach (const QString &dbFileName, fileNames) { 257 257 m_mutex.lock(); 258 258 if (m_abort) { -
trunk/tools/assistant/lib/qhelpdbreader.cpp
r651 r769 516 516 { 517 517 QString str; 518 foreach ( QStrings, list)518 foreach (const QString &s, list) 519 519 str.append(QLatin1Char('\'') + quote(s) + QLatin1String("\', ")); 520 520 if (str.endsWith(QLatin1String(", "))) … … 568 568 bool needUpdate = !m_viewAttributes.count(); 569 569 570 foreach ( QStrings, attributes)570 foreach (const QString &s, attributes) 571 571 m_viewAttributes.remove(s); 572 572 … … 575 575 m_indicesCache = indexIds; 576 576 } 577 foreach ( QStrings, attributes)577 foreach (const QString &s, attributes) 578 578 m_viewAttributes.insert(s); 579 579 m_useAttributesCache = true; -
trunk/tools/assistant/lib/qhelpenginecore.cpp
r651 r769 169 169 all defined filters. 170 170 171 The help engine also offers the possib lity to set and read values171 The help engine also offers the possibility to set and read values 172 172 in a persistant way comparable to ini files or Windows registry 173 173 entries. For more information see setValue() or value(). … … 363 363 const QHelpCollectionHandler::DocInfoList docList = 364 364 d->collectionHandler->registeredDocumentations(); 365 foreach(const QHelpCollectionHandler::DocInfo info, docList) {365 foreach(const QHelpCollectionHandler::DocInfo &info, docList) { 366 366 if (info.namespaceName == namespaceName) { 367 367 if (QDir::isAbsolutePath(info.fileName)) … … 387 387 return list; 388 388 const QHelpCollectionHandler::DocInfoList docList = d->collectionHandler->registeredDocumentations(); 389 foreach(const QHelpCollectionHandler::DocInfo info, docList) {389 foreach(const QHelpCollectionHandler::DocInfo &info, docList) { 390 390 list.append(info.namespaceName); 391 391 } … … 532 532 533 533 const QStringList files = reader->files(filterAttributes, extensionFilter); 534 foreach (const QString file, files) {534 foreach (const QString &file, files) { 535 535 url.setPath(QLatin1String("/") + file); 536 536 res.append(url); -
trunk/tools/assistant/lib/qhelpgenerator.cpp
r651 r769 204 204 205 205 emit statusChanged(tr("Insert custom filters...")); 206 foreach ( QHelpDataCustomFilterf, helpData->customFilters()) {206 foreach (const QHelpDataCustomFilter &f, helpData->customFilters()) { 207 207 if (!registerCustomFilter(f.name, f.filterAttributes, true)) { 208 208 cleanupDB(); … … 368 368 "Value BLOB )"); 369 369 370 foreach ( QStringq, tables) {370 foreach (const QString &q, tables) { 371 371 if (!d->query->exec(q)) { 372 372 d->error = tr("Cannot create tables!"); … … 630 630 } 631 631 632 foreach ( QStringid, idsToInsert) {632 foreach (const QString &id, idsToInsert) { 633 633 d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); 634 634 d->query->bindValue(0, id); … … 665 665 d->query->exec(); 666 666 667 foreach ( QStringatt, filterAttribs) {667 foreach (const QString &att, filterAttribs) { 668 668 d->query->prepare(QLatin1String("INSERT INTO FilterTable VALUES(?, ?)")); 669 669 d->query->bindValue(0, nameId); … … 688 688 689 689 QList<int> filterAtts; 690 foreach ( QStringfilterAtt, filterAttributes) {690 foreach (const QString &filterAtt, filterAttributes) { 691 691 d->query->prepare(QLatin1String("SELECT Id FROM FilterAttributeTable WHERE Name=?")); 692 692 d->query->bindValue(0, filterAtt); … … 705 705 int i = 0; 706 706 d->query->exec(QLatin1String("BEGIN")); 707 foreach ( QHelpDataIndexItemitm, keywords) {707 foreach (const QHelpDataIndexItem &itm, keywords) { 708 708 pos = itm.reference.indexOf(QLatin1Char('#')); 709 709 fileName = itm.reference.left(pos); … … 774 774 775 775 // associate the filter attributes 776 foreach ( QStringfilterAtt, filterAttributes) {776 foreach (const QString &filterAtt, filterAttributes) { 777 777 d->query->prepare(QLatin1String("INSERT INTO ContentsFilterTable (FilterAttributeId, ContentsId) " 778 778 "SELECT Id, ? FROM FilterAttributeTable WHERE Name=?")); … … 799 799 atts.insert(d->query->value(0).toString()); 800 800 801 foreach ( QStrings, attributes) {801 foreach (const QString &s, attributes) { 802 802 if (!atts.contains(s)) { 803 803 d->query->prepare(QLatin1String("INSERT INTO FilterAttributeTable VALUES(NULL, ?)")); -
trunk/tools/assistant/lib/qhelpindexwidget.cpp
r651 r769 163 163 m_mutex.unlock(); 164 164 165 foreach ( QStringdbFileName, m_helpEngine->fileNameReaderMap.keys()) {165 foreach (const QString &dbFileName, m_helpEngine->fileNameReaderMap.keys()) { 166 166 m_mutex.lock(); 167 167 if (m_abort) { … … 179 179 if (!lst.isEmpty()) { 180 180 m_mutex.lock(); 181 foreach ( QStrings, lst)181 foreach (const QString &s, lst) 182 182 indicesSet.insert(s); 183 183 if (m_abort) { … … 318 318 QRegExp regExp(wildcard, Qt::CaseInsensitive); 319 319 regExp.setPatternSyntax(QRegExp::Wildcard); 320 foreach ( QStringindex, d->indices) {320 foreach (const QString &index, d->indices) { 321 321 if (index.contains(regExp)) { 322 322 lst.append(index); … … 333 333 } 334 334 } else { 335 foreach ( QStringindex, d->indices) {335 foreach (const QString &index, d->indices) { 336 336 if (index.contains(filter, Qt::CaseInsensitive)) { 337 337 lst.append(index); -
trunk/tools/assistant/lib/qhelpsearchengine.cpp
r651 r769 64 64 65 65 #if defined(QT_CLUCENE_SUPPORT) 66 using namespace qt::fulltextsearch::clucene;66 using namespace fulltextsearch::clucene; 67 67 #else 68 using namespace qt::fulltextsearch::std;68 using namespace fulltextsearch::std; 69 69 #endif 70 70 … … 196 196 QHelpSearchResultWidget *resultWidget; 197 197 198 qt::fulltextsearch::QHelpSearchIndexReader *indexReader;198 fulltextsearch::QHelpSearchIndexReader *indexReader; 199 199 QHelpSearchIndexWriter *indexWriter; 200 200 … … 215 215 216 216 The QHelpSearchQuery class contains the field name and the associated search 217 term. Depending on the field the search term might get split up into sep erate217 term. Depending on the field the search term might get split up into separate 218 218 terms to be parsed differently by the search engine. 219 219 … … 239 239 \value DEFAULT the default field provided by the search widget, several terms should be 240 240 split and stored in the word list except search terms enclosed in quotes. 241 \value FUZZY a field only provided in use with clucene. Terms should be split in sep erate241 \value FUZZY a field only provided in use with clucene. Terms should be split in separate 242 242 words and passed to the search engine. 243 \value WITHOUT a field only provided in use with clucene. Terms should be split in sep erate243 \value WITHOUT a field only provided in use with clucene. Terms should be split in separate 244 244 words and passed to the search engine. 245 \value PHRASE a field only provided in use with clucene. Terms should not be split in sep erate245 \value PHRASE a field only provided in use with clucene. Terms should not be split in separate 246 246 words. 247 \value ALL a field only provided in use with clucene. Terms should be split in sep erate247 \value ALL a field only provided in use with clucene. Terms should be split in separate 248 248 words and passed to the search engine 249 \value ATLEAST a field only provided in use with clucene. Terms should be split in sep erate249 \value ATLEAST a field only provided in use with clucene. Terms should be split in separate 250 250 words and passed to the search engine 251 251 */ -
trunk/tools/assistant/lib/qhelpsearchindexreader.cpp
r651 r769 44 44 QT_BEGIN_NAMESPACE 45 45 46 namespace qt { 47 namespace fulltextsearch { 46 namespace fulltextsearch { 48 47 49 48 QHelpSearchIndexReader::QHelpSearchIndexReader() … … 101 100 102 101 103 } // namespace fulltextsearch 104 } // namespace qt 102 } // namespace fulltextsearch 105 103 106 104 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_clucene.cpp
r651 r769 56 56 QT_BEGIN_NAMESPACE 57 57 58 namespace qt { 59 namespace fulltextsearch { 60 namespace clucene { 58 namespace fulltextsearch { 59 namespace clucene { 61 60 62 61 QHelpSearchIndexReaderClucene::QHelpSearchIndexReaderClucene() … … 388 387 } 389 388 390 } // namespace clucene 391 } // namespace fulltextsearch 392 } // namespace qt 389 } // namespace clucene 390 } // namespace fulltextsearch 393 391 394 392 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_clucene_p.h
r651 r769 61 61 QT_BEGIN_NAMESPACE 62 62 63 namespace qt { 64 namespace fulltextsearch { 65 namespace clucene { 63 namespace fulltextsearch { 64 namespace clucene { 66 65 67 66 class QHelpSearchIndexReaderClucene : public QHelpSearchIndexReader … … 85 84 }; 86 85 87 } // namespace clucene 88 } // namespace fulltextsearch 89 } // namespace qt 86 } // namespace clucene 87 } // namespace fulltextsearch 90 88 91 89 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_default.cpp
r651 r769 53 53 QT_BEGIN_NAMESPACE 54 54 55 namespace qt { 56 namespace fulltextsearch { 57 namespace std { 55 namespace fulltextsearch { 56 namespace std { 58 57 59 58 namespace { … … 167 166 bool containsAll = true; 168 167 QStringList split = fileName.split(QLatin1String("@")); 169 foreach (const QString attribute, attributes) {168 foreach (const QString &attribute, attributes) { 170 169 if (!split.contains(attribute, Qt::CaseInsensitive)) { 171 170 containsAll = false; … … 181 180 void Reader::setIndexFile(const QString &namespaceName, const QString &attributes) 182 181 { 183 QString exten tion = namespaceName + QLatin1String("@") + attributes;184 indexFile = indexPath + QLatin1String("/indexdb40.") + exten tion;185 documentFile = indexPath + QLatin1String("/indexdoc40.") + exten tion;182 QString extension = namespaceName + QLatin1String("@") + attributes; 183 indexFile = indexPath + QLatin1String("/indexdb40.") + extension; 184 documentFile = indexPath + QLatin1String("/indexdoc40.") + extension; 186 185 } 187 186 … … 236 235 void Reader::searchInIndex(const QStringList &terms) 237 236 { 238 foreach (const QString term, terms) {237 foreach (const QString &term, terms) { 239 238 QVector<Document> documents; 240 239 … … 255 254 QString title, url; 256 255 QVector<DocumentInfo> documentsInfo; 257 foreach(const Document doc, documents) {256 foreach(const Document &doc, documents) { 258 257 info.docNumber = doc.docNumber; 259 258 info.frequency = doc.frequency; … … 520 519 521 520 QString queryTerm; 522 foreach (const QHelpSearchQuery query, queryList) {521 foreach (const QHelpSearchQuery &query, queryList) { 523 522 if (query.fieldName == QHelpSearchQuery::DEFAULT) { 524 523 queryTerm = query.wordList.at(0); … … 542 541 // setup the reader 543 542 m_reader.setIndexPath(indexPath); 544 foreach(const QString namespaceName, registeredDocs) {543 foreach(const QString &namespaceName, registeredDocs) { 545 544 mutex.lock(); 546 545 if (m_cancel) { … … 554 553 engine.filterAttributeSets(namespaceName); 555 554 556 foreach ( QStringListattributes, attributeSets) {555 foreach (const QStringList &attributes, attributeSets) { 557 556 // read all index files 558 557 m_reader.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); … … 578 577 if (!hits.isEmpty()) { 579 578 if (termSeq.isEmpty()) { 580 foreach (const DocumentInfo docInfo, hits) {579 foreach (const DocumentInfo &docInfo, hits) { 581 580 mutex.lock(); 582 581 if (m_cancel) { … … 589 588 } 590 589 } else { 591 foreach (const DocumentInfo docInfo, hits) {590 foreach (const DocumentInfo &docInfo, hits) { 592 591 mutex.lock(); 593 592 if (m_cancel) { … … 608 607 } 609 608 610 } // namespace std 611 } // namespace fulltextsearch 612 } // namespace qt 609 } // namespace std 610 } // namespace fulltextsearch 613 611 614 612 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_default_p.h
r651 r769 65 65 struct PosEntry; 66 66 67 namespace qt { 68 namespace fulltextsearch { 69 namespace std { 67 namespace fulltextsearch { 68 namespace std { 70 69 71 70 class Reader … … 128 127 }; 129 128 130 } // namespace std 131 } // namespace fulltextsearch 132 } // namespace qt 129 } // namespace std 130 } // namespace fulltextsearch 133 131 134 132 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexreader_p.h
r651 r769 67 67 class QHelpEngineCore; 68 68 69 namespace qt { 70 namespace fulltextsearch { 69 namespace fulltextsearch { 71 70 72 71 class QHelpSearchIndexReader : public QThread … … 101 100 }; 102 101 103 } // namespace fulltextsearch 104 } // namespace qt 102 } // namespace fulltextsearch 105 103 106 104 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene.cpp
r651 r769 64 64 QT_BEGIN_NAMESPACE 65 65 66 namespace qt { 67 namespace fulltextsearch { 68 namespace clucene { 66 namespace fulltextsearch { 67 namespace clucene { 69 68 70 69 // taken from qtexthtmlparser … … 587 586 mutex.unlock(); 588 587 589 start(QThread:: NormalPriority);588 start(QThread::LowestPriority); 590 589 } 591 590 … … 614 613 void QHelpSearchIndexWriter::run() 615 614 { 616 QMutexLocker mutexLocker(&mutex);617 618 if (m_cancel)619 return;620 621 const bool reindex = this->m_reindex;622 const QString collectionFile(this->m_collectionFile);623 624 mutexLocker.unlock();625 626 QHelpEngineCore engine(collectionFile, 0);627 if (!engine.setupData())628 return;629 630 const QLatin1String key("CluceneIndexedNamespaces");631 if (reindex)632 engine.setCustomValue(key, QLatin1String(""));633 634 QMap<QString, QDateTime> indexMap;635 const QLatin1String oldKey("CluceneSearchNamespaces");636 if (!engine.customValue(oldKey, QString()).isNull()) {637 // old style qhc file < 4.4.2, need to convert...638 const QStringList indexedNamespaces = engine.customValue(oldKey).639 toString().split(QLatin1String("|"), QString::SkipEmptyParts);640 foreach (const QString &nameSpace, indexedNamespaces)641 indexMap.insert(nameSpace, QDateTime());642 engine.removeCustomValue(oldKey);643 } else {644 QDataStream dataStream(engine.customValue(key).toByteArray());645 dataStream >> indexMap;646 }647 648 QString indexPath = m_indexFilesFolder;649 650 QFileInfo fInfo(indexPath);651 if (fInfo.exists() && !fInfo.isWritable()) {652 qWarning("Full Text Search, could not create index (missing permissions for '%s').", qPrintable(indexPath));653 return;654 }655 656 emit indexingStarted();657 658 QCLuceneIndexWriter *writer = 0;659 QCLuceneStandardAnalyzer analyzer;660 const QStringList registeredDocs = engine.registeredDocumentations();661 662 QLocalSocket localSocket;663 localSocket.connectToServer(QString(QLatin1String("QtAssistant%1"))664 .arg(QLatin1String(QT_VERSION_STR)));665 666 QLocalServer localServer;667 bool otherInstancesRunning = true;668 if (!localSocket.waitForConnected()) {669 otherInstancesRunning = false;670 localServer.listen(QString(QLatin1String("QtAssistant%1"))671 .arg(QLatin1String(QT_VERSION_STR)));672 }673 674 615 #if !defined(QT_NO_EXCEPTIONS) 675 616 try { 676 617 #endif 618 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 677 678 // check if it's locked, and if the other instance is running 678 679 if (!otherInstancesRunning && QCLuceneIndexReader::isLocked(indexPath)) … … 706 707 } else { 707 708 QString path = engine.documentationFileName(namespaceName); 708 if (indexMap.value(namespaceName) < QFileInfo(path).lastModified()) { 709 if (indexMap.value(namespaceName) 710 < QFileInfo(path).lastModified()) { 709 711 // make sure we remove some outdated indexed stuff 710 712 indexMap.remove(namespaceName); … … 729 731 writer = new QCLuceneIndexWriter(indexPath, analyzer, true); 730 732 } 731 #if !defined(QT_NO_EXCEPTIONS) 732 } catch (...) { 733 qWarning("Full Text Search, could not create index writer in '%s'.", 734 qPrintable(indexPath)); 735 return; 736 } 737 #endif 738 739 #if !defined(QT_NO_EXCEPTIONS) 740 try { 741 #endif 733 742 734 writer->setMergeFactor(100); 743 735 writer->setMinMergeDocs(1000); 744 736 writer->setMaxFieldLength(QCLuceneIndexWriter::DEFAULT_MAX_FIELD_LENGTH); 737 738 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 745 806 #if !defined(QT_NO_EXCEPTIONS) 746 807 } catch (...) { 747 qWarning("Full Text Search, could not set writer properties."); 748 return; 808 qWarning("%s: Failed because of CLucene exception.", Q_FUNC_INFO); 749 809 } 750 810 #endif 751 811 752 QStringList namespaces;753 foreach(const QString &namespaceName, registeredDocs) {754 mutexLocker.relock();755 if (m_cancel) {756 closeIndexWriter(writer);757 emit indexingFinished();758 return;759 }760 mutexLocker.unlock();761 762 namespaces.append(namespaceName);763 if (indexMap.contains(namespaceName))764 continue;765 766 const QList<QStringList> attributeSets =767 engine.filterAttributeSets(namespaceName);768 769 if (attributeSets.isEmpty()) {770 const QList<QUrl> docFiles = indexableFiles(&engine, namespaceName,771 QStringList());772 if (!addDocuments(docFiles, engine, QStringList(), namespaceName,773 writer, analyzer))774 break;775 } else {776 bool bail = false;777 foreach (const QStringList &attributes, attributeSets) {778 const QList<QUrl> docFiles = indexableFiles(&engine,779 namespaceName, attributes);780 if (!addDocuments(docFiles, engine, attributes, namespaceName,781 writer, analyzer)) {782 bail = true;783 break;784 }785 }786 if (bail)787 break;788 }789 790 mutexLocker.relock();791 if (!m_cancel) {792 QString path(engine.documentationFileName(namespaceName));793 indexMap.insert(namespaceName, QFileInfo(path).lastModified());794 writeIndexMap(engine, indexMap);795 }796 mutexLocker.unlock();797 }798 799 closeIndexWriter(writer);800 801 mutexLocker.relock();802 if (!m_cancel) {803 mutexLocker.unlock();804 805 QStringList indexedNamespaces = indexMap.keys();806 foreach(const QString &namespaceName, indexedNamespaces) {807 mutexLocker.relock();808 if (m_cancel)809 break;810 mutexLocker.unlock();811 812 if (!namespaces.contains(namespaceName)) {813 indexMap.remove(namespaceName);814 writeIndexMap(engine, indexMap);815 removeDocuments(indexPath, namespaceName);816 }817 }818 }819 812 emit indexingFinished(); 820 813 } … … 902 895 } 903 896 904 } // namespace clucene 905 } // namespace fulltextsearch 906 } // namespace qt 897 } // namespace clucene 898 } // namespace fulltextsearch 907 899 908 900 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexwriter_clucene_p.h
r651 r769 70 70 class QCLuceneIndexWriter; 71 71 72 namespace qt { 73 namespace fulltextsearch { 74 namespace clucene { 72 namespace fulltextsearch { 73 namespace clucene { 75 74 76 75 class QHelpSearchIndexWriter : public QThread … … 117 116 }; 118 117 119 } // namespace clucene120 } // namespace fulltextsearch121 118 } // namespace clucene 119 } // namespace fulltextsearch 120 122 121 123 122 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexwriter_default.cpp
r651 r769 56 56 QT_BEGIN_NAMESPACE 57 57 58 namespace qt { 59 namespace fulltextsearch { 60 namespace std { 58 namespace fulltextsearch { 59 namespace std { 61 60 62 61 Writer::Writer(const QString &path) … … 105 104 106 105 QDataStream docStream(&docFile); 107 foreach(const QStringList list, documentList) {106 foreach(const QStringList &list, documentList) { 108 107 docStream << list.at(0); 109 108 docStream << list.at(1); … … 127 126 void Writer::setIndexFile(const QString &namespaceName, const QString &attributes) 128 127 { 129 QString exten tion = namespaceName + QLatin1String("@") + attributes;130 indexFile = indexPath + QLatin1String("/indexdb40.") + exten tion;131 documentFile = indexPath + QLatin1String("/indexdoc40.") + exten tion;128 QString extension = namespaceName + QLatin1String("@") + attributes; 129 indexFile = indexPath + QLatin1String("/indexdb40.") + extension; 130 documentFile = indexPath + QLatin1String("/indexdoc40.") + extension; 132 131 } 133 132 … … 193 192 this->m_indexFilesFolder = indexFilesFolder; 194 193 195 start(QThread:: NormalPriority);194 start(QThread::LowestPriority); 196 195 } 197 196 … … 227 226 QStringList namespaces; 228 227 Writer writer(indexPath); 229 foreach(const QString namespaceName, registeredDocs) {228 foreach(const QString &namespaceName, registeredDocs) { 230 229 mutex.lock(); 231 230 if (m_cancel) { … … 243 242 engine.filterAttributeSets(namespaceName); 244 243 245 foreach ( QStringListattributes, attributeSets) {244 foreach (const QStringList &attributes, attributeSets) { 246 245 // cleanup maybe old or unfinished files 247 246 writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); … … 267 266 int docNum = 0; 268 267 const QStringList documentsList(documentsSet.toList()); 269 foreach(const QString url, documentsList) {268 foreach(const QString &url, documentsList) { 270 269 if (m_cancel) 271 270 return; … … 348 347 engine.filterAttributeSets(namespaceName); 349 348 350 foreach ( QStringListattributes, attributeSets) {349 foreach (const QStringList &attributes, attributeSets) { 351 350 writer.setIndexFile(namespaceName, attributes.join(QLatin1String("@"))); 352 351 writer.removeIndex(); … … 380 379 } 381 380 382 } // namespace std 383 } // namespace fulltextsearch 384 } // namespace qt 381 } // namespace std 382 } // namespace fulltextsearch 385 383 386 384 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchindexwriter_default_p.h
r651 r769 66 66 QT_BEGIN_NAMESPACE 67 67 68 namespace qt { 69 namespace fulltextsearch { 70 namespace std { 68 namespace fulltextsearch { 69 namespace std { 71 70 72 71 class Writer … … 124 123 }; 125 124 126 } // namespace std 127 } // namespace fulltextsearch 128 } // namespace qt 125 } // namespace std 126 } // namespace fulltextsearch 129 127 130 128 QT_END_NAMESPACE -
trunk/tools/assistant/lib/qhelpsearchquerywidget.cpp
r651 r769 149 149 150 150 // make sure we won't end up with an empty string 151 foreach (const QString escapeChar, escapableCharsList) {151 foreach (const QString &escapeChar, escapableCharsList) { 152 152 if (retValue.contains(escapeChar)) 153 153 retValue.replace(escapeChar, QLatin1String("")); … … 156 156 return retValue; 157 157 158 retValue = text; // now real y escape the string...159 foreach (const QString escapeChar, escapableCharsList) {158 retValue = text; // now really escape the string... 159 foreach (const QString &escapeChar, escapableCharsList) { 160 160 if (retValue.contains(escapeChar)) 161 161 retValue.replace(escapeChar, escape + escapeChar); … … 318 318 if (!lst.isEmpty()) { 319 319 QStringList fuzzy; 320 foreach (const QString term, lst)320 foreach (const QString &term, lst) 321 321 fuzzy += buildTermList(escapeString(term)); 322 322 queryList.append(QHelpSearchQuery(QHelpSearchQuery::FUZZY, fuzzy)); … … 326 326 if (!lst.isEmpty()) { 327 327 QStringList without; 328 foreach (const QString term, lst)328 foreach (const QString &term, lst) 329 329 without.append(escapeString(term)); 330 330 queryList.append(QHelpSearchQuery(QHelpSearchQuery::WITHOUT, without)); … … 340 340 if (!lst.isEmpty()) { 341 341 QStringList all; 342 foreach (const QString term, lst)342 foreach (const QString &term, lst) 343 343 all.append(escapeString(term)); 344 344 queryList.append(QHelpSearchQuery(QHelpSearchQuery::ALL, all)); … … 348 348 if (!lst.isEmpty()) { 349 349 QStringList atLeast; 350 foreach (const QString term, lst)350 foreach (const QString &term, lst) 351 351 atLeast += buildTermList(escapeString(term)); 352 352 queryList.append(QHelpSearchQuery(QHelpSearchQuery::ATLEAST, atLeast)); … … 534 534 535 535 /*! 536 Returns a list of quer ys to use in combination with the search engines536 Returns a list of queries to use in combination with the search engines 537 537 search(QList<QHelpSearchQuery> &query) function. 538 538 */ -
trunk/tools/assistant/lib/qhelpsearchresultwidget.cpp
r651 r769 74 74 void showResultPage(const QList<QHelpSearchEngine::SearchHit> hits) 75 75 { 76 foreach (const QHelpSearchEngine::SearchHit hit, hits)76 foreach (const QHelpSearchEngine::SearchHit &hit, hits) 77 77 new QTreeWidgetItem(this, QStringList(hit.first) << hit.second); 78 78 } … … 119 119 "documentation is still being indexed!")); 120 120 121 foreach (const QHelpSearchEngine::SearchHit hit, hits) {121 foreach (const QHelpSearchEngine::SearchHit &hit, hits) { 122 122 htmlFile += QString(QLatin1String("<div style=\"text-align:left; font-weight:bold\"" 123 123 "><a href=\"%1\">%2</a><div style=\"color:green; font-weight:normal;" -
trunk/tools/assistant/tools/assistant/centralwidget.cpp
r651 r769 1119 1119 1120 1120 QStringList terms; 1121 foreach ( QHelpSearchQueryquery, queryList) {1121 foreach (const QHelpSearchQuery &query, queryList) { 1122 1122 switch (query.fieldName) { 1123 1123 default: break; -
trunk/tools/assistant/tools/assistant/doc/assistant.qdocconf
r651 r769 13 13 "<td width=\"30%\" align=\"left\">Copyright © 2010 Nokia Corporation and/or its subsidiary(-ies)</td>\n" \ 14 14 "<td width=\"40%\" align=\"center\">Trademarks</td>\n" \ 15 "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6. 2</div></td>\n" \15 "<td width=\"30%\" align=\"right\"><div align=\"right\">Qt 4.6.3</div></td>\n" \ 16 16 "</tr></table></div></address>" -
trunk/tools/assistant/tools/assistant/helpviewer.cpp
r651 r769 152 152 } 153 153 154 const QByteArray &ba = helpEngine->fileData(url); 155 return new HelpNetworkReply(request, ba.isEmpty() ? " " : ba, mimeType); 154 const QByteArray &data = helpEngine->findFile(url).isValid() 155 ? helpEngine->fileData(url) : QByteArray("File not found!"); 156 return new HelpNetworkReply(request, data, mimeType); 156 157 } 157 158 -
trunk/tools/configure/configure.pro
r561 r769 4 4 CONFIG += console flat 5 5 CONFIG -= 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_DEPRECATE7 6 DEFINES = 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 7 DEFINES += QT_BOOTSTRAPPED 8 8 9 9 win32 : LIBS += -lole32 -ladvapi32 … … 28 28 $$QT_BUILD_TREE/include \ 29 29 $$QT_BUILD_TREE/include/QtCore \ 30 $$QT_BUILD_TREE/tools/shared 30 31 31 32 HEADERS = configureapp.h environment.h tools.h\ … … 59 60 $$QT_SOURCE_TREE/src/corelib/tools/qstringlist.h \ 60 61 $$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 62 67 63 68 … … 103 108 $$QT_SOURCE_TREE/src/corelib/tools/qrect.cpp \ 104 109 $$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 106 115 107 116 win32:SOURCES += $$QT_SOURCE_TREE/src/corelib/io/qfsfileengine_win.cpp -
trunk/tools/configure/configureapp.cpp
r651 r769 248 248 dictionary[ "PHONON_BACKEND" ] = "yes"; 249 249 dictionary[ "MULTIMEDIA" ] = "yes"; 250 dictionary[ "AUDIO_BACKEND" ] = " yes";250 dictionary[ "AUDIO_BACKEND" ] = "auto"; 251 251 dictionary[ "DIRECTSHOW" ] = "no"; 252 252 dictionary[ "WEBKIT" ] = "auto"; … … 318 318 dictionary[ "DBUS" ] = "auto"; 319 319 dictionary[ "S60" ] = "yes"; 320 dictionary[ "SYMBIAN_DEFFILES" ] = "yes";321 320 322 321 dictionary[ "STYLE_WINDOWS" ] = "yes"; … … 971 970 break; 972 971 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 } 973 976 } else if( configCmdLine.at(i) == "-D" ) { 974 977 ++i; … … 1478 1481 dictionary[ "QT_GLIB" ] = "no"; 1479 1482 dictionary[ "S60" ] = "yes"; 1483 dictionary[ "SYMBIAN_DEFFILES" ] = "yes"; 1480 1484 // iconv makes makes apps start and run ridiculously slowly in symbian emulator (HW not tested) 1481 1485 // iconv_open seems to return -1 always, so something is probably missing from the platform. … … 1485 1489 dictionary[ "QT_INSTALL_PREFIX" ] = ""; 1486 1490 dictionary[ "QT_INSTALL_PLUGINS" ] = "\\resource\\qt\\plugins"; 1491 dictionary[ "QT_INSTALL_TRANSLATIONS" ] = "\\resource\\qt\\translations"; 1487 1492 dictionary[ "ARM_FPU_TYPE" ] = "softvfp"; 1488 1493 dictionary[ "SQL_SQLITE" ] = "yes"; … … 2066 2071 } else if (part == "DECLARATIVE") { 2067 2072 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 } 2068 2119 } 2069 2120 … … 2154 2205 if (dictionary["DECLARATIVE"] == "auto") 2155 2206 dictionary["DECLARATIVE"] = checkAvailability("DECLARATIVE") ? "yes" : "no"; 2207 if (dictionary["AUDIO_BACKEND"] == "auto") 2208 dictionary["AUDIO_BACKEND"] = checkAvailability("AUDIO_BACKEND") ? "yes" : "no"; 2156 2209 2157 2210 // Qt/WinCE remote test application … … 2266 2319 QString build32Key = buildKey + "Windows " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" "); 2267 2320 QString build64Key = buildKey + "Windows x64 " + compiler + " %1 " + build_options.join(" ") + " " + build_defines.join(" "); 2321 QString buildSymbianKey = buildKey + "Symbian " + build_options.join(" ") + " " + build_defines.join(" "); 2268 2322 build32Key = build32Key.simplified(); 2269 2323 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" 2276 2335 + build64Key.arg("debug") + "\"\n" 2336 "# else\n" 2337 + build32Key.arg("debug") + "\"\n" 2338 "# endif\n" 2277 2339 "# else\n" 2278 + build32Key.arg("debug") + "\"\n"2279 "# endif\n"2280 "#else\n"2281 2340 // Release builds 2282 "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n"2341 "# if (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))\n" 2283 2342 + build64Key.arg("release") + "\"\n" 2284 "# else\n"2343 "# else\n" 2285 2344 + build32Key.arg("release") + "\"\n" 2345 "# endif\n" 2286 2346 "# endif\n" 2287 2347 "#endif\n"; … … 2968 3028 qconfigList += "QT_NO_PRINTER"; 2969 3029 qconfigList += "QT_NO_SYSTEMTRAYICON"; 3030 if (dictionary.contains("QT_LIBINFIX")) 3031 tmpStream << QString("#define QT_LIBINFIX \"%1\"").arg(dictionary["QT_LIBINFIX"]) << endl; 2970 3032 } 2971 3033 … … 3646 3708 txt << "all:\n"; 3647 3709 txt << "\t" << args.join(" ") << "\n"; 3648 txt << "\t " << dictionary[ "MAKE" ] << "-f " << it->target << "\n";3710 txt << "\t\"$(MAKE)\" -$(MAKEFLAGS) -f " << it->target << "\n"; 3649 3711 txt << "first: all\n"; 3650 3712 txt << "qmake:\n"; -
trunk/tools/configure/environment.cpp
r651 r769 61 61 #endif 62 62 63 #include <symbian/epocroot.h> // from tools/shared 64 #include <windows/registry.h> // from tools/shared 63 65 64 66 QT_BEGIN_NAMESPACE … … 95 97 ++i; 96 98 return &(compiler_info[i]); 97 }98 99 /*!100 Returns the path part of a registry key.101 Ei.102 For a key103 "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir"104 it returns105 "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 key119 "Software\\Microsoft\\VisualStudio\\8.0\\Setup\\VC\\ProductDir"120 it returns121 "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, a138 QString() is returned.139 */140 QString Environment::readRegistryKey(HKEY parentHandle, const QString &rSubkey)141 {142 #ifndef Q_OS_WIN32143 return QString();144 #else145 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 value154 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 value163 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 #endif217 99 } 218 100 … … 580 462 } 581 463 464 QString Environment::symbianEpocRoot() 465 { 466 // Call function defined in tools/shared/symbian/epocroot.h 467 return ::epocRoot(); 468 } 469 582 470 QT_END_NAMESPACE -
trunk/tools/configure/environment.h
r651 r769 72 72 static bool rmdir(const QString &name); 73 73 74 static QString symbianEpocRoot(); 75 74 76 private: 75 77 static Compiler detectedCompiler; 76 78 77 79 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);81 80 }; 82 81 -
trunk/tools/configure/tools.cpp
r651 r769 147 147 dictionary["EDITION"] = "Evaluation"; 148 148 dictionary["QT_EDITION"] = "QT_EDITION_EVALUATION"; 149 licenseType = "Evaluation"; 149 150 } 150 151 } … … 213 214 214 215 // Override for evaluation licenses 215 if (dictionary["E dition"] == "Evaluation")216 if (dictionary["EDITION"] == "Evaluation") 216 217 dictionary["LICENSE_EXTENSION"] = "-EVALUATION"; 217 218 -
trunk/tools/designer/src/components/formeditor/formwindow.cpp
r651 r769 2220 2220 } 2221 2221 2222 if (manager->actionLower()->isEnabled()) { 2223 popup->addAction(manager->actionLower()); 2224 popup->addAction(manager->actionRaise()); 2225 popup->addSeparator(); 2226 } 2222 2227 popup->addAction(manager->actionCut()); 2223 2228 popup->addAction(manager->actionCopy()); -
trunk/tools/designer/src/components/formeditor/formwindow.h
r651 r769 279 279 void checkPreviewGeometry(QRect &r); 280 280 281 void finishContextMenu(QWidget *w, QWidget *menuParent, QContextMenuEvent *e);282 283 281 bool handleContextMenu(QWidget *widget, QWidget *managedWidget, QContextMenuEvent *e); 284 282 bool handleMouseButtonDblClickEvent(QWidget *widget, QWidget *managedWidget, QMouseEvent *e); -
trunk/tools/designer/src/components/formeditor/qdesigner_resource.cpp
r651 r769 1447 1447 1448 1448 QList<QWidget*> tabOrder; 1449 foreach ( QStringwidgetName, tabStops->elementTabStop()) {1449 foreach (const QString &widgetName, tabStops->elementTabStop()) { 1450 1450 if (QWidget *w = qFindChild<QWidget*>(widget, widgetName)) { 1451 1451 tabOrder.append(w); … … 2419 2419 if (resourceSet) { 2420 2420 const QStringList activePaths = resourceSet->activeQrcPaths(); 2421 foreach ( QStringpath, activePaths) {2421 foreach (const QString &path, activePaths) { 2422 2422 if (qrcPaths.contains(path)) { 2423 2423 DomResource *dom_res = new DomResource; -
trunk/tools/designer/src/components/propertyeditor/designerpropertymanager.h
r651 r769 103 103 Q_OBJECT 104 104 public: 105 DesignerPropertyManager(QDesignerFormEditorInterface *core, QObject *parent = 0);105 explicit DesignerPropertyManager(QDesignerFormEditorInterface *core, QObject *parent = 0); 106 106 ~DesignerPropertyManager(); 107 107 -
trunk/tools/designer/src/designer/qdesigner_actions.cpp
r651 r769 581 581 582 582 bool atLeastOne = false; 583 foreach ( QStringfileName, fileNames) {583 foreach (const QString &fileName, fileNames) { 584 584 if (readInForm(fileName) && !atLeastOne) 585 585 atLeastOne = true; … … 870 870 removeBackup(backupFile); 871 871 fi.setFile(fileName); 872 backupFile = QString();872 backupFile.clear(); 873 873 if (fi.exists()) 874 874 backupFile = createBackup(fileName); -
trunk/tools/designer/src/designer/qdesigner_server.cpp
r651 r769 84 84 if(sSocket->waitForConnected(3000)) 85 85 { 86 foreach( QStringfile, files)86 foreach(const QString &file, files) 87 87 { 88 88 QFileInfo fi(file); … … 97 97 void QDesignerServer::readFromClient() 98 98 { 99 QString file = QString();100 99 while (m_socket->canReadLine()) { 101 file = QString::fromUtf8(m_socket->readLine());100 QString file = QString::fromUtf8(m_socket->readLine()); 102 101 if (!file.isNull()) { 103 102 file.remove(QLatin1Char('\n')); … … 144 143 void QDesignerClient::readFromSocket() 145 144 { 146 QString file = QString();147 145 while (m_socket->canReadLine()) { 148 146 QString file = QString::fromUtf8(m_socket->readLine()); -
trunk/tools/designer/src/designer/qdesigner_server.h
r651 r769 54 54 Q_OBJECT 55 55 public: 56 QDesignerServer(QObject *parent = 0);56 explicit QDesignerServer(QObject *parent = 0); 57 57 virtual ~QDesignerServer(); 58 58 … … 75 75 Q_OBJECT 76 76 public: 77 QDesignerClient(quint16 port, QObject *parent = 0);77 explicit QDesignerClient(quint16 port, QObject *parent = 0); 78 78 virtual ~QDesignerClient(); 79 79 -
trunk/tools/designer/src/designer/versiondialog.cpp
r651 r769 114 114 m_path.lineTo(me->pos()); 115 115 bool gotIt = true; 116 QPoint pt; 117 foreach(pt, hitPoints) { 116 foreach(const QPoint &pt, hitPoints) { 118 117 if (!m_path.contains(pt)) { 119 118 gotIt = false; … … 122 121 } 123 122 if (gotIt) { 124 foreach( pt, missPoints) {123 foreach(const QPoint &pt, missPoints) { 125 124 if (m_path.contains(pt)) { 126 125 gotIt = false; -
trunk/tools/designer/src/lib/shared/actioneditor.cpp
r651 r769 429 429 } 430 430 431 // Set an in tial property and mark it as changed in the sheet431 // Set an initial property and mark it as changed in the sheet 432 432 static void setInitialProperty(QDesignerPropertySheetExtension *sheet, const QString &name, const QVariant &value) 433 433 { -
trunk/tools/designer/src/lib/shared/actionrepository.cpp
r651 r769 78 78 } 79 79 80 static QIcon fixActionIcon(const QIcon &icon)81 {82 if (icon.isNull())83 return qdesigner_internal::emptyIcon();84 return icon;85 }86 87 80 namespace qdesigner_internal { 88 81 … … 90 83 ActionModel::ActionModel(QWidget *parent ) : 91 84 QStandardItemModel(parent), 85 m_emptyIcon(emptyIcon()), 92 86 m_core(0) 93 87 { … … 128 122 list += item(row, i); 129 123 130 setItems(m_core, actionOfItem(list.front()), list);124 setItems(m_core, actionOfItem(list.front()), m_emptyIcon, list); 131 125 } 132 126 … … 151 145 items.push_back(item); 152 146 } 153 setItems(m_core, action, items);147 setItems(m_core, action, m_emptyIcon, items); 154 148 appendRow(items); 155 149 return indexFromItem(items.front()); … … 186 180 } 187 181 188 void ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action, QStandardItemList &sl) 182 void ActionModel::setItems(QDesignerFormEditorInterface *core, QAction *action, 183 const QIcon &defaultIcon, 184 QStandardItemList &sl) 189 185 { 190 186 … … 201 197 QStandardItem *item = sl[NameColumn]; 202 198 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); 204 203 item->setToolTip(firstTooltip); 205 204 item->setWhatsThis(firstTooltip); … … 245 244 246 245 QSet<QAction*> actions; 247 foreach (const 246 foreach (const QModelIndex &index, indexes) 248 247 if (QStandardItem *item = itemFromIndex(index)) 249 248 if (QAction *action = actionOfItem(item)) -
trunk/tools/designer/src/lib/shared/actionrepository_p.h
r651 r769 60 60 #include <QtGui/QListView> 61 61 #include <QtGui/QStackedWidget> 62 #include <QtGui/QIcon> 62 63 63 64 QT_BEGIN_NAMESPACE … … 111 112 112 113 private: 114 typedef QList<QStandardItem *> QStandardItemList; 115 113 116 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; 117 122 118 123 QDesignerFormEditorInterface *m_core; -
trunk/tools/designer/src/lib/shared/connectionedit_p.h
r651 r769 88 88 public: 89 89 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) {} 91 91 bool isNull() const { return con == 0; } 92 92 bool operator == (const EndPoint &other) const { return con == other.con && type == other.type; } -
trunk/tools/designer/src/lib/shared/filterwidget_p.h
r651 r769 67 67 68 68 /* A line edit that displays a grayed hintText (like "Type Here to Filter") 69 * when not focus sed and empty. When connecting to the changed signals and69 * when not focused and empty. When connecting to the changed signals and 70 70 * querying text, one has to be aware that the text is set to that hint 71 71 * text if isShowingHintText() returns true (that is, does not contain -
trunk/tools/designer/src/lib/shared/iconloader.cpp
r651 r769 61 61 << (QString::fromUtf8(":/trolltech/formeditor/images/designer_") + name); 62 62 63 foreach ( QStringf, candidates) {63 foreach (const QString &f, candidates) { 64 64 if (QFile::exists(f)) 65 65 return QIcon(f); … … 71 71 QDESIGNER_SHARED_EXPORT QIcon emptyIcon() 72 72 { 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")); 75 74 } 76 75 -
trunk/tools/designer/src/lib/shared/iconselector_p.h
r651 r769 77 77 Q_OBJECT 78 78 79 LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0);79 explicit LanguageResourceDialog(QDesignerResourceBrowserInterface *rb, QWidget *parent = 0); 80 80 81 81 public: -
trunk/tools/designer/src/lib/shared/plugindialog.cpp
r651 r769 106 106 QFont boldFont = topLevelItem->font(0); 107 107 108 foreach ( QStringfileName, fileNames) {108 foreach (const QString &fileName, fileNames) { 109 109 QPluginLoader loader(fileName); 110 110 const QFileInfo fileInfo(fileName); … … 128 128 QTreeWidgetItem *topLevelItem = setTopLevelItem(QLatin1String("Failed Plugins")); 129 129 const QFont boldFont = topLevelItem->font(0); 130 foreach (const QString plugin, notLoadedPlugins) {130 foreach (const QString &plugin, notLoadedPlugins) { 131 131 const QString failureReason = pluginManager->failureReason(plugin); 132 132 QTreeWidgetItem *pluginItem = setPluginItem(topLevelItem, plugin, boldFont); -
trunk/tools/designer/src/lib/shared/qdesigner_introspection.cpp
r651 r769 64 64 { 65 65 if (!c) 66 return QString ::null;66 return QString(); 67 67 return QString::fromUtf8(c); 68 68 } -
trunk/tools/designer/src/lib/shared/qdesigner_menu.cpp
r651 r769 89 89 QDesignerMenu::QDesignerMenu(QWidget *parent) : 90 90 QMenu(parent), 91 m_subMenuPixmap(QPixmap(QLatin1String(":/trolltech/formeditor/images/submenu.png"))), 91 92 m_currentIndex(0), 92 93 m_addItem(new SpecialMenuAction(this)), … … 557 558 QRect QDesignerMenu::subMenuPixmapRect(QAction *action) const 558 559 { 559 static const QPixmap pm(QLatin1String(":/trolltech/formeditor/images/submenu.png"));560 560 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()); 564 564 } 565 565 … … 598 598 p.fillRect(g, lg); 599 599 } 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); 602 601 } 603 602 } -
trunk/tools/designer/src/lib/shared/qdesigner_menu_p.h
r651 r769 58 58 #include <QtGui/QAction> 59 59 #include <QtGui/QMenu> 60 #include <QtGui/QPixmap> 60 61 #include <QtCore/QHash> 61 62 … … 184 185 bool hideSubMenuOnCursorKey(); 185 186 bool showSubMenuOnCursorKey(); 187 const QPixmap m_subMenuPixmap; 186 188 187 189 QPoint m_startPosition; -
trunk/tools/designer/src/lib/shared/qdesigner_objectinspector_p.h
r651 r769 86 86 Q_OBJECT 87 87 public: 88 QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0);88 explicit QDesignerObjectInspector(QWidget *parent = 0, Qt::WindowFlags flags = 0); 89 89 90 90 // Select a qobject unmanaged by form window -
trunk/tools/designer/src/lib/shared/qdesigner_promotiondialog_p.h
r651 r769 81 81 Q_OBJECT 82 82 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); 86 86 87 87 signals: … … 115 115 enum Mode { ModeEdit, ModeEditChooseClass }; 116 116 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); 121 121 // Return an alphabetically ordered list of base class names for adding new classes. 122 122 static const QStringList &baseClassNames(const QDesignerPromotionInterface *promotion); -
trunk/tools/designer/src/lib/shared/qdesigner_propertyeditor_p.h
r651 r769 70 70 Q_OBJECT 71 71 public: 72 QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0);72 explicit QDesignerPropertyEditor(QWidget *parent = 0, Qt::WindowFlags flags = 0); 73 73 74 74 // A pair <ValidationMode, bool isTranslatable>. -
trunk/tools/designer/src/lib/shared/qdesigner_taskmenu.cpp
r651 r769 676 676 const QStringList parameterNames = qVariantValue<QStringList>(selectedItem->data(0, Qt::UserRole)); 677 677 678 // TODO: Check w ether signal is connected to slot678 // TODO: Check whether signal is connected to slot 679 679 integr->emitNavigateToSlot(objectName, signalSignature, parameterNames); 680 680 } -
trunk/tools/designer/src/lib/shared/qdesigner_toolbar.cpp
r651 r769 449 449 } 450 450 451 //that's a trick to get acces to the initStyleOption which is a protected member451 //that's a trick to get access to the initStyleOption which is a protected member 452 452 class FriendlyToolBar : public QToolBar { 453 453 public: -
trunk/tools/designer/src/lib/shared/qdesigner_utils_p.h
r651 r769 299 299 Q_OBJECT 300 300 public: 301 DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0);301 explicit DesignerIconCache(DesignerPixmapCache *pixmapCache, QObject *parent = 0); 302 302 QIcon icon(const PropertySheetIconValue &value) const; 303 303 void clear(); … … 314 314 { 315 315 public: 316 PropertySheetStringValue(const QString &value = QString(),316 explicit PropertySheetStringValue(const QString &value = QString(), 317 317 bool translatable = true, 318 318 const QString &disambiguation = QString(), … … 346 346 { 347 347 public: 348 PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(),348 explicit PropertySheetKeySequenceValue(const QKeySequence &value = QKeySequence(), 349 349 bool translatable = true, 350 350 const QString &disambiguation = QString(), 351 351 const QString &comment = QString()); 352 PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey,352 explicit PropertySheetKeySequenceValue(const QKeySequence::StandardKey &standardKey, 353 353 bool translatable = true, 354 354 const QString &disambiguation = QString(), -
trunk/tools/designer/src/lib/shared/qdesigner_widgetbox_p.h
r651 r769 71 71 enum LoadMode { LoadMerge, LoadReplace, LoadCustomWidgetsOnly }; 72 72 73 QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0);73 explicit QDesignerWidgetBox(QWidget *parent = 0, Qt::WindowFlags flags = 0); 74 74 75 75 LoadMode loadMode() const; -
trunk/tools/designer/src/lib/shared/qtresourceview_p.h
r651 r769 69 69 Q_OBJECT 70 70 public: 71 QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0);71 explicit QtResourceView(QDesignerFormEditorInterface *core, QWidget *parent = 0); 72 72 ~QtResourceView(); 73 73 … … 121 121 Q_OBJECT 122 122 public: 123 QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);123 explicit QtResourceViewDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0); 124 124 virtual ~QtResourceViewDialog(); 125 125 -
trunk/tools/designer/src/lib/shared/richtexteditor_p.h
r651 r769 73 73 Q_OBJECT 74 74 public: 75 RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0);75 explicit RichTextEditorDialog(QDesignerFormEditorInterface *core, QWidget *parent = 0); 76 76 ~RichTextEditorDialog(); 77 77 -
trunk/tools/designer/src/lib/shared/shared_settings.cpp
r651 r769 162 162 // get template paths excluding internal ones 163 163 QStringList rc = formTemplatePaths(); 164 foreach ( QStringinternalTemplatePath, defaultFormTemplatePaths()) {164 foreach (const QString &internalTemplatePath, defaultFormTemplatePaths()) { 165 165 const int index = rc.indexOf(internalTemplatePath); 166 166 if (index != -1) -
trunk/tools/designer/src/lib/shared/textpropertyeditor_p.h
r651 r769 91 91 }; 92 92 93 TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine);93 explicit TextPropertyEditor(QWidget *parent = 0, EmbeddingMode embeddingMode = EmbeddingNone, TextPropertyValidationMode validationMode = ValidationMultiLine); 94 94 95 95 TextPropertyValidationMode textPropertyValidationMode() const { return m_validationMode; } -
trunk/tools/designer/src/lib/shared/widgetdatabase_p.h
r651 r769 75 75 { 76 76 public: 77 WidgetDataBaseItem(const QString &name = QString(),78 const QString &group = QString());77 explicit WidgetDataBaseItem(const QString &name = QString(), 78 const QString &group = QString()); 79 79 80 80 QString name() const; … … 160 160 Q_OBJECT 161 161 public: 162 WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0);162 explicit WidgetDataBase(QDesignerFormEditorInterface *core, QObject *parent = 0); 163 163 virtual ~WidgetDataBase(); 164 164 -
trunk/tools/designer/src/lib/uilib/abstractformbuilder.cpp
r651 r769 365 365 if (!zOrderNames.isEmpty()) { 366 366 QList<QWidget *> zOrder = qVariantValue<QWidgetList>(w->property("_q_zOrder")); 367 foreach ( QStringwidgetName, zOrderNames) {367 foreach (const QString &widgetName, zOrderNames) { 368 368 if (QWidget *child = qFindChild<QWidget*>(w, widgetName)) { 369 369 if (child->parentWidget() == w) { -
trunk/tools/designer/src/lib/uilib/formbuilder.cpp
r651 r769 495 495 m_customWidgets.clear(); 496 496 497 foreach ( QStringpath, m_pluginPaths) {497 foreach (const QString &path, m_pluginPaths) { 498 498 const QDir dir(path); 499 499 const QStringList candidates = dir.entryList(QDir::Files); -
trunk/tools/designer/src/plugins/activeqt/qaxwidgetextrainfo.h
r651 r769 78 78 Q_OBJECT 79 79 public: 80 QAxWidgetExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);80 explicit QAxWidgetExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0); 81 81 82 82 protected: -
trunk/tools/designer/src/plugins/activeqt/qdesigneraxwidget.h
r651 r769 106 106 class QDesignerAxPluginWidget : public QDesignerAxWidget 107 107 { 108 // No Q_OBJECT here! - meta functionality is overrid en108 // No Q_OBJECT here! - meta functionality is overridden 109 109 public: 110 110 explicit QDesignerAxPluginWidget(QWidget *parent); -
trunk/tools/designer/src/plugins/widgets/q3iconview/q3iconview_extrainfo.h
r651 r769 82 82 Q_OBJECT 83 83 public: 84 Q3IconViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);84 explicit Q3IconViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0); 85 85 86 86 protected: -
trunk/tools/designer/src/plugins/widgets/q3iconview/q3iconview_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3IconViewPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3IconViewPlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3listbox/q3listbox_extrainfo.h
r651 r769 80 80 Q_OBJECT 81 81 public: 82 Q3ListBoxExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);82 explicit Q3ListBoxExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0); 83 83 84 84 protected: -
trunk/tools/designer/src/plugins/widgets/q3listbox/q3listbox_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3ListBoxPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3ListBoxPlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3listview/q3listview_extrainfo.h
r651 r769 83 83 Q_OBJECT 84 84 public: 85 Q3ListViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);85 explicit Q3ListViewExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0); 86 86 87 87 protected: -
trunk/tools/designer/src/plugins/widgets/q3listview/q3listview_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3ListViewPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3ListViewPlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3mainwindow/q3mainwindow_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3MainWindowPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3MainWindowPlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3table/q3table_extrainfo.h
r651 r769 80 80 Q_OBJECT 81 81 public: 82 Q3TableExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);82 explicit Q3TableExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0); 83 83 84 84 protected: -
trunk/tools/designer/src/plugins/widgets/q3table/q3table_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3TablePlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3TablePlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3textedit/q3textedit_extrainfo.h
r651 r769 80 80 Q_OBJECT 81 81 public: 82 Q3TextEditExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);82 explicit Q3TextEditExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0); 83 83 84 84 protected: -
trunk/tools/designer/src/plugins/widgets/q3textedit/q3textedit_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3TextEditPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3TextEditPlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_extrainfo.h
r651 r769 79 79 Q_OBJECT 80 80 public: 81 Q3ToolBarExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0);81 explicit Q3ToolBarExtraInfoFactory(QDesignerFormEditorInterface *core, QExtensionManager *parent = 0); 82 82 83 83 protected: -
trunk/tools/designer/src/plugins/widgets/q3toolbar/q3toolbar_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3ToolBarPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3ToolBarPlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3widgets/q3widget_plugins.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3ButtonGroupPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3ButtonGroupPlugin(const QIcon &icon, QObject *parent = 0); 55 55 virtual ~Q3ButtonGroupPlugin(); 56 56 … … 81 81 Q_INTERFACES(QDesignerCustomWidgetInterface) 82 82 public: 83 Q3ComboBoxPlugin(const QIcon &icon, QObject *parent = 0);83 explicit Q3ComboBoxPlugin(const QIcon &icon, QObject *parent = 0); 84 84 virtual ~Q3ComboBoxPlugin(); 85 85 … … 110 110 Q_INTERFACES(QDesignerCustomWidgetInterface) 111 111 public: 112 Q3DateEditPlugin(const QIcon &icon, QObject *parent = 0);112 explicit Q3DateEditPlugin(const QIcon &icon, QObject *parent = 0); 113 113 114 114 virtual QString name() const; … … 134 134 Q_INTERFACES(QDesignerCustomWidgetInterface) 135 135 public: 136 Q3DateTimeEditPlugin(const QIcon &icon, QObject *parent = 0);136 explicit Q3DateTimeEditPlugin(const QIcon &icon, QObject *parent = 0); 137 137 138 138 virtual QString name() const; … … 158 158 Q_INTERFACES(QDesignerCustomWidgetInterface) 159 159 public: 160 Q3FramePlugin(const QIcon &icon, QObject *parent = 0);160 explicit Q3FramePlugin(const QIcon &icon, QObject *parent = 0); 161 161 virtual ~Q3FramePlugin(); 162 162 … … 187 187 Q_INTERFACES(QDesignerCustomWidgetInterface) 188 188 public: 189 Q3GroupBoxPlugin(const QIcon &icon, QObject *parent = 0);189 explicit Q3GroupBoxPlugin(const QIcon &icon, QObject *parent = 0); 190 190 virtual ~Q3GroupBoxPlugin(); 191 191 … … 216 216 Q_INTERFACES(QDesignerCustomWidgetInterface) 217 217 public: 218 Q3ProgressBarPlugin(const QIcon &icon, QObject *parent = 0);218 explicit Q3ProgressBarPlugin(const QIcon &icon, QObject *parent = 0); 219 219 220 220 virtual QString name() const; … … 240 240 Q_INTERFACES(QDesignerCustomWidgetInterface) 241 241 public: 242 Q3TextBrowserPlugin(const QIcon &icon, QObject *parent = 0);242 explicit Q3TextBrowserPlugin(const QIcon &icon, QObject *parent = 0); 243 243 244 244 virtual QString name() const; … … 264 264 Q_INTERFACES(QDesignerCustomWidgetInterface) 265 265 public: 266 Q3TimeEditPlugin(const QIcon &icon, QObject *parent = 0);266 explicit Q3TimeEditPlugin(const QIcon &icon, QObject *parent = 0); 267 267 268 268 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3widgetstack/q3widgetstack_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3WidgetStackPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3WidgetStackPlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/plugins/widgets/q3wizard/q3wizard_container.h
r651 r769 60 60 Q_OBJECT 61 61 public: 62 Q3WizardHelper(Q3Wizard *wizard);62 explicit Q3WizardHelper(Q3Wizard *wizard); 63 63 private slots: 64 64 void slotCurrentChanged(); … … 72 72 Q_INTERFACES(QDesignerExtraInfoExtension) 73 73 public: 74 Q3WizardExtraInfo(Q3Wizard *wizard, QDesignerFormEditorInterface *core, QObject *parent);74 explicit Q3WizardExtraInfo(Q3Wizard *wizard, QDesignerFormEditorInterface *core, QObject *parent); 75 75 76 76 virtual QWidget *widget() const; -
trunk/tools/designer/src/plugins/widgets/q3wizard/q3wizard_plugin.h
r651 r769 52 52 Q_INTERFACES(QDesignerCustomWidgetInterface) 53 53 public: 54 Q3WizardPlugin(const QIcon &icon, QObject *parent = 0);54 explicit Q3WizardPlugin(const QIcon &icon, QObject *parent = 0); 55 55 56 56 virtual QString name() const; -
trunk/tools/designer/src/src.pro
r561 r769 10 10 CONFIG(shared,shared|static):SUBDIRS += plugins 11 11 12 wince*: SUBDIRS -= designer plugins 13 symbian: SUBDIRS = uitools 14 contains(DEFINES, QT_NO_CURSOR): SUBDIRS -= lib components 12 symbian|wince*: SUBDIRS = uitools -
trunk/tools/doxygen/config/phonon.doxyfile
r651 r769 6 6 #--------------------------------------------------------------------------- 7 7 PROJECT_NAME = Qt 8 PROJECT_NUMBER = 4.6. 28 PROJECT_NUMBER = 4.6.3 9 9 OUTPUT_DIRECTORY = doc 10 10 CREATE_SUBDIRS = NO -
trunk/tools/linguist/linguist.pro
r2 r769 5 5 lupdate \ 6 6 lconvert 7 CONFIG += ordered8 -
trunk/tools/linguist/linguist/linguist.pro
r561 r769 99 99 TR_DIR = $$PWD/../../../translations 100 100 TRANSLATIONS = \ 101 $$TR_DIR/linguist_cs.ts \ 101 102 $$TR_DIR/linguist_de.ts \ 102 103 $$TR_DIR/linguist_fr.ts \ -
trunk/tools/linguist/linguist/linguist.qrc
r561 r769 1 1 <RCC> 2 <qresource prefix="/" 2 <qresource prefix="/"> 3 3 <file>images/appicon.png</file> 4 4 <file>images/mac/accelerator.png</file> … … 29 29 <file>images/s_check_warning.png</file> 30 30 <file>images/splash.png</file> 31 <file>images/transbox.png</file>32 31 <file>images/up.png</file> 33 32 <file>images/down.png</file> -
trunk/tools/linguist/linguist/mainwindow.cpp
r663 r769 94 94 #include <QUrl> 95 95 #include <QWhatsThis> 96 97 #include <ctype.h> 96 98 97 99 QT_BEGIN_NAMESPACE … … 2367 2369 static bool haveMnemonic(const QString &str) 2368 2370 { 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; 2376 2393 } 2377 2394 -
trunk/tools/linguist/linguist/messageeditor.cpp
r651 r769 99 99 setObjectName(QLatin1String("scroll area")); 100 100 101 // Use white explicitly as the background color for the editor page.102 101 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)); 109 103 setPalette(p); 110 104 … … 136 130 { 137 131 QFrame *editorPage = new QFrame; 138 139 editorPage->setStyleSheet(QLatin1String(140 "QLabel { font-weight: bold; }"141 ));142 132 editorPage->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed)); 143 133 -
trunk/tools/linguist/linguist/messageeditorwidgets.cpp
r651 r769 172 172 173 173 m_label = new QLabel(this); 174 QFont fnt; 175 fnt.setBold(true); 176 m_label->setFont(fnt); 174 177 m_label->setText(label); 175 178 layout->addWidget(m_label); … … 250 253 { 251 254 m_label = new QLabel(this); 255 QFont fnt; 256 fnt.setBold(true); 257 m_label->setFont(fnt); 252 258 m_label->setText(label); 253 259 -
trunk/tools/linguist/linguist/messagemodel.cpp
r651 r769 585 585 } 586 586 587 void MultiContextItem::appendMessageItem(MessageItem *m) 588 { 587 void 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; 589 592 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)); 593 597 } 594 598 … … 711 715 } 712 716 m_msgModel->endInsertColumns(); 717 int appendedContexts = 0; 713 718 for (int i = 0; i < dm->contextCount(); ++i) { 714 719 ContextItem *c = dm->contextItem(i); … … 717 722 MultiContextItem *mc = multiContextItem(mcx); 718 723 mc->assignLastModel(c, readWrite); 724 QList<MessageItem *> appendItems; 719 725 for (int j = 0; j < c->messageCount(); ++j) { 720 726 MessageItem *m = c->messageItem(j); 721 727 int msgIdx = mc->findMessage(m->text(), m->comment()); 722 if (msgIdx >= 0) {728 if (msgIdx >= 0) 723 729 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(); 731 740 } 732 741 } 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(); 739 753 } 740 754 dm->setWritable(readWrite); -
trunk/tools/linguist/linguist/messagemodel.h
r651 r769 333 333 void moveModel(int oldPos, int newPos); // newPos is *before* removing at oldPos 334 334 void putMessageItem(int pos, MessageItem *m); 335 void appendMessageItem (MessageItem *m);335 void appendMessageItems(const QList<MessageItem *> &m); 336 336 void removeMultiMessageItem(int pos); 337 337 void incrementFinishedCount() { ++m_finishedCount; } -
trunk/tools/linguist/lupdate/cpp.cpp
r651 r769 66 66 class HashString { 67 67 public: 68 HashString() : m_hash ed(false) {}69 explicit HashString(const QString &str) : m_str(str), m_hash ed(false) {}70 void setValue(const QString &str) { m_str = str; m_hash ed = 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; } 71 71 const QString &value() const { return m_str; } 72 72 bool operator==(const HashString &other) const { return m_str == other.m_str; } 73 73 private: 74 74 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. 75 77 mutable uint m_hash; 76 mutable bool m_hashed;77 78 friend uint qHash(const HashString &str); 78 79 }; … … 80 81 uint qHash(const HashString &str) 81 82 { 82 if (!str.m_hashed) { 83 str.m_hashed = true; 83 if (str.m_hash & 0x80000000) 84 84 str.m_hash = qHash(str.m_str); 85 }86 85 return str.m_hash; 87 86 } … … 89 88 class HashStringList { 90 89 public: 91 explicit HashStringList(const QList<HashString> &list) : m_list(list), m_hash ed(false) {}90 explicit HashStringList(const QList<HashString> &list) : m_list(list), m_hash(0x80000000) {} 92 91 const QList<HashString> &value() const { return m_list; } 93 92 bool operator==(const HashStringList &other) const { return m_list == other.m_list; } … … 95 94 QList<HashString> m_list; 96 95 mutable uint m_hash; 97 mutable bool m_hashed;98 96 friend uint qHash(const HashStringList &list); 99 97 }; … … 101 99 uint qHash(const HashStringList &list) 102 100 { 103 if (!list.m_hashed) { 104 list.m_hashed = true; 101 if (list.m_hash & 0x80000000) { 105 102 uint hash = 0; 106 103 foreach (const HashString &qs, list.m_list) { 107 hash ^= qHash(qs) ^ 0x a09df22f;108 hash = ( hash << 13) | (hash >> 19);104 hash ^= qHash(qs) ^ 0x0ad9f526; 105 hash = ((hash << 13) & 0x0fffffff) | (hash >> 15); 109 106 } 110 107 list.m_hash = hash; … … 216 213 struct IfdefState { 217 214 IfdefState() {} 218 IfdefState(int _braceDepth, int _parenDepth) : 215 IfdefState(int _bracketDepth, int _braceDepth, int _parenDepth) : 216 bracketDepth(_bracketDepth), 219 217 braceDepth(_braceDepth), 220 218 parenDepth(_parenDepth), … … 223 221 224 222 SavedState state; 223 int bracketDepth, bracketDepth1st; 225 224 int braceDepth, braceDepth1st; 226 225 int parenDepth, parenDepth1st; … … 260 259 bool qualifyOneCallbackOwn(const Namespace *ns, void *context) const; 261 260 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; 262 263 bool qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment, 263 264 NamespaceList *resolved) const; … … 279 280 enum { 280 281 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, 283 284 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 = 99285 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 289 290 }; 290 291 … … 298 299 qlonglong yyInteger; 299 300 QStack<IfdefState> yyIfdefStack; 301 int yyBracketDepth; 300 302 int yyBraceDepth; 301 303 int yyParenDepth; 302 304 int yyLineNo; 303 305 int yyCurLineNo; 306 int yyBracketLineNo; 304 307 int yyBraceLineNo; 305 308 int yyParenLineNo; … … 338 341 directInclude = false; 339 342 } 343 yyBracketDepth = 0; 340 344 yyBraceDepth = 0; 341 345 yyParenDepth = 0; 342 346 yyCurLineNo = 1; 347 yyBracketLineNo = 1; 343 348 yyBraceLineNo = 1; 344 349 yyParenLineNo = 1; … … 567 572 if (yyCh == 'f') { 568 573 // if, ifdef, ifndef 569 yyIfdefStack.push(IfdefState(yyBrac eDepth, yyParenDepth));574 yyIfdefStack.push(IfdefState(yyBracketDepth, yyBraceDepth, yyParenDepth)); 570 575 yyCh = getChar(); 571 576 } else if (yyCh == 'n') { … … 606 611 IfdefState &is = yyIfdefStack.top(); 607 612 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 " 610 617 "#if and #else branches; using #if branch\n", 611 618 qPrintable(yyFileName), is.elseLine); 612 619 } else { 620 is.bracketDepth1st = yyBracketDepth; 613 621 is.braceDepth1st = yyBraceDepth; 614 622 is.parenDepth1st = yyParenDepth; … … 616 624 } 617 625 is.elseLine = yyLineNo; 626 yyBracketDepth = is.bracketDepth; 618 627 yyBraceDepth = is.braceDepth; 619 628 yyParenDepth = is.parenDepth; … … 625 634 IfdefState is = yyIfdefStack.pop(); 626 635 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) 628 639 qWarning("%s:%d: Parenthesis/brace mismatch between " 629 640 "#if and #else branches; using #if branch\n", 630 641 qPrintable(yyFileName), is.elseLine); 642 yyBracketDepth = is.bracketDepth1st; 631 643 yyBraceDepth = is.braceDepth1st; 632 644 yyParenDepth = is.parenDepth1st; … … 901 913 yyCh = getChar(); 902 914 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; 903 930 case ',': 904 931 yyCh = getChar(); … … 1037 1064 1038 1065 struct 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) 1041 1069 {} 1042 1070 … … 1045 1073 const HashString &segment; 1046 1074 NamespaceList *resolved; 1047 QSet<HashStringList> visitedUsings;1075 QSet<HashStringList> *visitedUsings; 1048 1076 }; 1049 1077 … … 1079 1107 QualifyOneData *data = (QualifyOneData *)context; 1080 1108 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)) 1084 1113 return true; 1085 1114 } … … 1088 1117 1089 1118 bool CppParser::qualifyOne(const NamespaceList &namespaces, int nsCnt, const HashString &segment, 1090 NamespaceList *resolved ) const1091 { 1092 QualifyOneData data(namespaces, nsCnt, segment, resolved );1119 NamespaceList *resolved, QSet<HashStringList> *visitedUsings) const 1120 { 1121 QualifyOneData data(namespaces, nsCnt, segment, resolved, visitedUsings); 1093 1122 1094 1123 if (visitNamespace(namespaces, nsCnt, &CppParser::qualifyOneCallbackOwn, &data)) … … 1096 1125 1097 1126 return visitNamespace(namespaces, nsCnt, &CppParser::qualifyOneCallbackUsing, &data); 1127 } 1128 1129 bool 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); 1098 1135 } 1099 1136 … … 1526 1563 yyTok = getToken(); 1527 1564 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(); 1528 1571 //qDebug() << "TOKEN: " << yyTok; 1529 1572 switch (yyTok) { … … 1993 2036 context = comment.left(k); 1994 2037 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)); 1997 2044 extracomment.clear(); 2045 tor->append(msg); 1998 2046 tor->setExtras(extra); 1999 2047 extra.clear(); … … 2066 2114 if (!yyParenDepth) 2067 2115 prospectiveContext.clear(); 2116 // fallthrough 2117 case Tok_Equals: // for static initializers; other cases make no difference 2118 case Tok_RightBracket: // ignoring indexing; same reason 2068 2119 case_default: 2069 2120 yyTok = getToken(); … … 2080 2131 " (or abuse of the C++ preprocessor)\n", 2081 2132 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); 2082 2137 } 2083 2138 -
trunk/tools/linguist/lupdate/main.cpp
r651 r769 137 137 138 138 static 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, 140 140 UpdateOptions options, bool *fail) 141 141 { … … 155 155 tor.resolveDuplicates(); 156 156 cd.clearErrors(); 157 if ( !codecForTr.isEmpty() && codecForTr != tor.codecName())157 if (setCodec && fetchedTor.codec() != tor.codec()) 158 158 qWarning("lupdate warning: Codec for tr() '%s' disagrees with " 159 159 "existing file's codec '%s'. Expect trouble.", 160 codecForTr.constData(), tor.codecName().constData());160 fetchedTor.codecName().constData(), tor.codecName().constData()); 161 161 if (!targetLanguage.isEmpty() && targetLanguage != tor.languageCode()) 162 162 qWarning("lupdate warning: Specified target language '%s' disagrees with " … … 168 168 qPrintable(sourceLanguage), qPrintable(tor.sourceLanguageCode())); 169 169 } else { 170 if ( !codecForTr.isEmpty())171 tor.setCodec Name(codecForTr);170 if (setCodec) 171 tor.setCodec(fetchedTor.codec()); 172 172 if (!targetLanguage.isEmpty()) 173 173 tor.setLanguageCode(targetLanguage); … … 191 191 theseOptions |= NoLocations; 192 192 Translator out = merge(tor, fetchedTor, theseOptions, err); 193 if ( !codecForTr.isEmpty())194 out.setCodec Name(codecForTr);193 if (setCodec) 194 out.setCodec(fetchedTor.codec()); 195 195 196 196 if ((options & Verbose) && !err.isEmpty()) { … … 375 375 } 376 376 Translator tor; 377 QByteArray codecForTr;377 bool setCodec = false; 378 378 QStringList tmp = visitor.values(QLatin1String("CODEC")) 379 379 + visitor.values(QLatin1String("DEFAULTCODEC")) 380 380 + visitor.values(QLatin1String("CODECFORTR")); 381 381 if (!tmp.isEmpty()) { 382 codecForTr = tmp.last().toLatin1();383 tor.setCodecName(codecForTr);382 tor.setCodecName(tmp.last().toLatin1()); 383 setCodec = true; 384 384 } 385 385 processProject(false, pfi, visitor, options, codecForSource, 386 386 targetLanguage, sourceLanguage, &tor, fail); 387 updateTsFiles(tor, tsFiles, codecForTr, sourceLanguage, targetLanguage, options, fail);387 updateTsFiles(tor, tsFiles, setCodec, sourceLanguage, targetLanguage, options, fail); 388 388 continue; 389 389 } … … 658 658 fetchedTor.setCodecName(codecForTr); 659 659 processSources(fetchedTor, sourceFiles, cd); 660 updateTsFiles(fetchedTor, tsFileNames, codecForTr,660 updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(), 661 661 sourceLanguage, targetLanguage, options, &fail); 662 662 } else { … … 670 670 processProjects(true, true, proFiles, options, QByteArray(), 671 671 targetLanguage, sourceLanguage, &fetchedTor, &fail); 672 updateTsFiles(fetchedTor, tsFileNames, codecForTr,672 updateTsFiles(fetchedTor, tsFileNames, !codecForTr.isEmpty(), 673 673 sourceLanguage, targetLanguage, options, &fail); 674 674 } else { -
trunk/tools/linguist/phrasebooks/russian.qph
r561 r769 1176 1176 <target>ÐглавлеМОе</target> 1177 1177 </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> 1178 1218 </QPH> -
trunk/tools/linguist/shared/qm.cpp
r651 r769 595 595 } 596 596 m += 4; 597 QString str = QString ::fromUtf16((const ushort*)m, len/2);597 QString str = QString((const QChar *)m, len/2); 598 598 if (QSysInfo::ByteOrder == QSysInfo::LittleEndian) { 599 599 for (int i = 0; i < str.length(); ++i) -
trunk/tools/linguist/shared/translator.h
r651 r769 154 154 155 155 void setCodecName(const QByteArray &name); 156 void setCodec(QTextCodec *codec) { m_codec = codec; } 156 157 QByteArray codecName() const; 157 158 QTextCodec *codec() const { return m_codec; } -
trunk/tools/qdoc3/test/assistant.qdocconf
r651 r769 18 18 qhp.Assistant.indexTitle = Qt Assistant Manual 19 19 qhp.Assistant.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png 20 qhp.Assistant.filterAttributes = qt 4.6. 2tools assistant20 qhp.Assistant.filterAttributes = qt 4.6.3 tools assistant 21 21 qhp.Assistant.customFilters.Assistant.name = Qt Assistant Manual 22 22 qhp.Assistant.customFilters.Assistant.filterAttributes = qt tools assistant -
trunk/tools/qdoc3/test/designer.qdocconf
r651 r769 18 18 qhp.Designer.indexTitle = Qt Designer Manual 19 19 qhp.Designer.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png 20 qhp.Designer.filterAttributes = qt 4.6. 2tools designer20 qhp.Designer.filterAttributes = qt 4.6.3 tools designer 21 21 qhp.Designer.customFilters.Designer.name = Qt Designer Manual 22 22 qhp.Designer.customFilters.Designer.filterAttributes = qt tools designer -
trunk/tools/qdoc3/test/linguist.qdocconf
r651 r769 18 18 qhp.Linguist.indexTitle = Qt Linguist Manual 19 19 qhp.Linguist.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png 20 qhp.Linguist.filterAttributes = qt 4.6. 2tools linguist20 qhp.Linguist.filterAttributes = qt 4.6.3 tools linguist 21 21 qhp.Linguist.customFilters.Linguist.name = Qt Linguist Manual 22 22 qhp.Linguist.customFilters.Linguist.filterAttributes = qt tools linguist -
trunk/tools/qdoc3/test/qmake.qdocconf
r651 r769 18 18 qhp.qmake.indexTitle = QMake Manual 19 19 qhp.qmake.extraFiles = classic.css images/qt-logo.png images/trolltech-logo.png 20 qhp.qmake.filterAttributes = qt 4.6. 2tools qmake20 qhp.qmake.filterAttributes = qt 4.6.3 tools qmake 21 21 qhp.qmake.customFilters.qmake.name = qmake Manual 22 22 qhp.qmake.customFilters.qmake.filterAttributes = qt tools qmake -
trunk/tools/qdoc3/test/qt-build-docs.qdocconf
r651 r769 33 33 images/stylesheet-coffee-plastique.png 34 34 35 qhp.Qt.filterAttributes = qt 4.6. 2qtrefdoc36 qhp.Qt.customFilters.Qt.name = Qt 4.6. 237 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6. 235 qhp.Qt.filterAttributes = qt 4.6.3 qtrefdoc 36 qhp.Qt.customFilters.Qt.name = Qt 4.6.3 37 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.3 38 38 qhp.Qt.subprojects = classes overviews examples 39 39 qhp.Qt.subprojects.classes.title = Classes -
trunk/tools/qdoc3/test/qt.qdocconf
r651 r769 7 7 project = Qt 8 8 versionsym = 9 version = 4.6. 29 version = 4.6.3 10 10 description = Qt Reference Documentation 11 11 url = http://qt.nokia.com/doc/4.6 … … 35 35 images/stylesheet-coffee-plastique.png 36 36 37 qhp.Qt.filterAttributes = qt 4.6. 2qtrefdoc38 qhp.Qt.customFilters.Qt.name = Qt 4.6. 239 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6. 237 qhp.Qt.filterAttributes = qt 4.6.3 qtrefdoc 38 qhp.Qt.customFilters.Qt.name = Qt 4.6.3 39 qhp.Qt.customFilters.Qt.filterAttributes = qt 4.6.3 40 40 qhp.Qt.subprojects = classes overviews examples 41 41 qhp.Qt.subprojects.classes.title = Classes -
trunk/tools/qtestlib/wince/cetest/activesyncconnection.cpp
r651 r769 444 444 } 445 445 446 bool 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 505 bool 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 541 bool 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 446 585 bool ActiveSyncConnection::createDirectory(const QString &path, bool deleteBefore) 447 586 { -
trunk/tools/qtestlib/wince/cetest/activesyncconnection.h
r651 r769 80 80 81 81 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); 82 85 private: 83 86 bool connected; -
trunk/tools/qtestlib/wince/cetest/cetest.pro
r561 r769 20 20 $$QT_SOURCE_TREE/qmake \ 21 21 $$QT_SOURCE_TREE/qmake/generators/symbian \ 22 $$QT_SOURCE_TREE/tools/shared \ 22 23 $$QT_BUILD_TREE/include \ 23 24 $$QT_BUILD_TREE/include/QtCore \ 24 25 $$QT_BUILD_TREE/src/corelib/global 26 27 VPATH += $$QT_SOURCE_TREE/tools/shared 25 28 26 29 DEPENDPATH += $$QT_BUILD_TREE/src/corelib/tools $$QT_BUILD_TREE/src/corelib/io … … 34 37 remoteconnection.cpp \ 35 38 deployment.cpp \ 39 symbian/epocroot.cpp \ 40 windows/registry.cpp \ 36 41 main.cpp 37 42 -
trunk/tools/qtestlib/wince/cetest/main.cpp
r651 r769 45 45 # include "activesyncconnection.h" 46 46 #endif 47 48 const int SLEEP_AFTER_RESET = 60000; // sleep for 1 minute 49 const int SLEEP_RECONNECT = 2000; // sleep for 2 seconds before trying another reconnect 47 50 48 51 #include "deployment.h" … … 124 127 " -release : Test release version\n" 125 128 " -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" 126 131 " -qt-delete : Delete the Qt libraries after execution\n" 127 132 " -project-delete : Delete the project file(s) after execution\n" … … 153 158 bool cleanupQt = false; 154 159 bool cleanupProject = false; 160 bool deviceReset = false; 161 bool keepAwake = false; 155 162 156 163 for (int i=1; i<arguments.size(); ++i) { … … 197 204 cleanupQt = true; 198 205 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; 199 210 } else if (arguments.at(i).toLower() == QLatin1String("-conf")) { 200 211 if (++i == arguments.size()) { … … 353 364 cout << "Error: Could not copy file(s) to device" << endl; 354 365 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 } 355 403 } 356 404 -
trunk/tools/qtestlib/wince/cetest/qmake_include.pri
r561 r769 6 6 $$QT_SOURCE_TREE/qmake/project.cpp \ 7 7 $$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 9 11 -
trunk/tools/qtestlib/wince/remotelib/commands.cpp
r651 r769 40 40 ****************************************************************************/ 41 41 #include "commands.h" 42 #include <Pm.h> 43 #include <Pmpolicy.h> 44 42 45 43 46 #define CLEAN_FAIL(a) {delete appName; \ … … 125 128 return true; 126 129 } 130 /** 131 \brief Reset the device. 132 */ 133 int 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 */ 150 int 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 */ 183 int 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 46 46 extern "C" { 47 47 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); 48 51 bool __declspec(dllexport) qRemoteExecute(const wchar_t* program, const wchar_t* arguments = NULL, int *returnValue = NULL , DWORD* error = NULL, int timeout = -1); 49 52 } -
trunk/tools/runonphone/main.cpp
r651 r769 45 45 #include <QScopedPointer> 46 46 #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" 50 50 51 51 #include "trksignalhandler.h" … … 134 134 } 135 135 136 if (serialPortName.isEmpty()) {137 if (loglevel > 0)136 if (serialPortName.isEmpty()) { 137 if (loglevel > 0) 138 138 outstream << "Detecting serial ports" << endl; 139 139 QList <SerialPortId> ports = enumerateSerialPorts(); 140 140 foreach(SerialPortId id, ports) { 141 if (loglevel > 0)141 if (loglevel > 0) 142 142 outstream << "Port Name: " << id.portName << ", " 143 143 << "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))) 150 150 serialPortName = id.portName; 151 else if (!id.friendlyName.isEmpty() &&152 !serialPortFriendlyName.isEmpty() &&153 id.friendlyName.contains(serialPortFriendlyName))154 151 else if (!id.friendlyName.isEmpty() 152 && !serialPortFriendlyName.isEmpty() 153 && id.friendlyName.contains(serialPortFriendlyName)) 154 serialPortName = id.portName; 155 155 } 156 156 } 157 if (serialPortName.isEmpty()) {157 if (serialPortName.isEmpty()) { 158 158 errstream << "No phone found, ensure USB cable is connected or specify manually with -p" << endl; 159 159 return 1; … … 163 163 QScopedPointer<trk::Launcher> launcher; 164 164 165 if (sisFile.isEmpty()) {165 if (sisFile.isEmpty()) { 166 166 launcher.reset(new trk::Launcher(trk::Launcher::ActionCopyRun)); 167 167 launcher->setCopyFileName(exeFile, QString("c:\\sys\\bin\\") + exeFile); … … 173 173 launcher->setInstallFileName("c:\\data\\testtemp.sis"); 174 174 } 175 if (loglevel > 0)175 if (loglevel > 0) 176 176 outstream << "Connecting to target via " << serialPortName << endl; 177 #ifdef Q_OS_WIN178 launcher->setTrkServerName(QString("\\\\.\\") + serialPortName);179 #else180 177 launcher->setTrkServerName(serialPortName); 181 #endif182 178 183 179 launcher->setFileName(QString("c:\\sys\\bin\\") + exeFile); 184 180 launcher->setCommandLineArgs(cmdLine); 185 181 186 if (loglevel > 1)182 if (loglevel > 1) 187 183 launcher->setVerbose(1); 188 184 … … 217 213 218 214 QString errorMessage; 219 if (!launcher->startServer(&errorMessage)) {215 if (!launcher->startServer(&errorMessage)) { 220 216 errstream << errorMessage << endl; 221 217 return 1; -
trunk/tools/runonphone/runonphone.pro
r651 r769 5 5 CONFIG -= app_bundle 6 6 7 include( trk/trk.pri)7 include(symbianutils/symbianutils.pri) 8 8 9 9 SOURCES += main.cpp \ … … 12 12 HEADERS += trksignalhandler.h \ 13 13 serenum.h 14 15 DEFINES += SYMBIANUTILS_INCLUDE_PRI 14 16 15 17 windows { -
trunk/tools/runonphone/serenum_stub.cpp
r651 r769 48 48 { 49 49 QList<SerialPortId> list; 50 qWarning() << "enumerateSerialPorts not implemented" << endl;50 qWarning() << "enumerateSerialPorts not implemented"; 51 51 return list; 52 52 } -
trunk/tools/runonphone/serenum_unix.cpp
r651 r769 52 52 QDir dir("/dev/serial/by-id/"); 53 53 QFileInfoList ports(dir.entryInfoList()); 54 foreach (QFileInfoinfo, ports) {54 foreach (const QFileInfo &info, ports) { 55 55 if (!info.isDir()) { 56 56 SerialPortId id; -
trunk/tools/runonphone/trksignalhandler.cpp
r651 r769 59 59 void TrkSignalHandler::copyingStarted() 60 60 { 61 if (d->loglevel > 0)61 if (d->loglevel > 0) 62 62 d->out << "Copying..." << endl; 63 63 } … … 65 65 void TrkSignalHandler::canNotConnect(const QString &errorMessage) 66 66 { 67 d->err << "Cannot Connect - " << errorMessage << endl;67 d->err << "Cannot connect - " << errorMessage << endl; 68 68 } 69 69 … … 85 85 void TrkSignalHandler::installingStarted() 86 86 { 87 if (d->loglevel > 0)87 if (d->loglevel > 0) 88 88 d->out << "Installing..." << endl; 89 89 } … … 96 96 void TrkSignalHandler::installingFinished() 97 97 { 98 if (d->loglevel > 0)98 if (d->loglevel > 0) 99 99 d->out << "Installing finished" << endl; 100 100 } … … 102 102 void TrkSignalHandler::startingApplication() 103 103 { 104 if (d->loglevel > 0)104 if (d->loglevel > 0) 105 105 d->out << "Starting app..." << endl; 106 106 } … … 108 108 void TrkSignalHandler::applicationRunning(uint pid) 109 109 { 110 if (d->loglevel > 0)110 if (d->loglevel > 0) 111 111 d->out << "Running..." << endl; 112 112 } … … 119 119 void TrkSignalHandler::finished() 120 120 { 121 if (d->loglevel > 0)121 if (d->loglevel > 0) 122 122 d->out << "Done." << endl; 123 123 QCoreApplication::quit(); … … 126 126 void TrkSignalHandler::applicationOutputReceived(const QString &output) 127 127 { 128 d->out << output ;128 d->out << output << flush; 129 129 } 130 130 131 131 void TrkSignalHandler::copyProgress(int percent) 132 132 { 133 if (d->loglevel > 0) {133 if (d->loglevel > 0) { 134 134 d->out << percent << "% "; 135 135 d->out.flush(); 136 if (percent==100)136 if (percent==100) 137 137 d->out << endl; 138 138 } … … 141 141 void TrkSignalHandler::stateChanged(int state) 142 142 { 143 if (d->loglevel > 1)143 if (d->loglevel > 1) 144 144 d->out << "State" << state << endl; 145 145 } … … 165 165 } 166 166 167 TrkSignalHandlerPrivate::TrkSignalHandlerPrivate() :168 169 170 167 TrkSignalHandlerPrivate::TrkSignalHandlerPrivate() 168 : out(stdout), 169 err(stderr), 170 loglevel(0) 171 171 { 172 172 … … 180 180 181 181 TrkSignalHandler::TrkSignalHandler() 182 : d(new TrkSignalHandlerPrivate()) 182 183 { 183 d = new TrkSignalHandlerPrivate();184 184 } 185 185 -
trunk/tools/shared/findwidget/abstractfindwidget.h
r651 r769 71 71 Q_DECLARE_FLAGS(FindFlags, FindFlag) 72 72 73 AbstractFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);73 explicit AbstractFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0); 74 74 virtual ~AbstractFindWidget(); 75 75 -
trunk/tools/shared/findwidget/itemviewfindwidget.h
r651 r769 56 56 57 57 public: 58 ItemViewFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);58 explicit ItemViewFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0); 59 59 60 60 QAbstractItemView *itemView() const -
trunk/tools/shared/findwidget/texteditfindwidget.h
r651 r769 54 54 55 55 public: 56 TextEditFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0);56 explicit TextEditFindWidget(FindFlags flags = FindFlags(), QWidget *parent = 0); 57 57 58 58 QTextEdit *textEdit() const -
trunk/tools/shared/fontpanel/fontpanel.cpp
r651 r769 218 218 219 219 if (hasStyles) { 220 foreach ( QStringstyle, styles) {220 foreach (const QString &style, styles) { 221 221 // try to maintain selection or select 'normal' preferably 222 222 const int newIndex = m_styleComboBox->count(); -
trunk/tools/shared/qtgradienteditor/qtgradientutils.cpp
r651 r769 396 396 { 397 397 QStringList result; 398 foreach ( QGradientStopstop, gradient.stops()) {398 foreach (const QGradientStop &stop, gradient.stops()) { 399 399 const QColor color = stop.second; 400 400 -
trunk/tools/shared/qtpropertybrowser/qtpropertybrowserutils.cpp
r651 r769 94 94 } 95 95 96 void QtCursorDatabase::clear() 97 { 98 m_cursorNames.clear(); 99 m_cursorIcons.clear(); 100 m_valueToCursorShape.clear(); 101 m_cursorShapeToValue.clear(); 102 } 103 96 104 void QtCursorDatabase::appendCursor(Qt::CursorShape shape, const QString &name, const QIcon &icon) 97 105 { 98 106 if (m_cursorShapeToValue.contains(shape)) 99 107 return; 100 int value = m_cursorNames.count();108 const int value = m_cursorNames.count(); 101 109 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); 105 113 } 106 114 -
trunk/tools/shared/qtpropertybrowser/qtpropertybrowserutils_p.h
r651 r769 69 69 public: 70 70 QtCursorDatabase(); 71 void clear(); 71 72 72 73 QStringList cursorShapeNames() const; -
trunk/tools/shared/qtpropertybrowser/qtpropertymanager.cpp
r651 r769 1392 1392 1393 1393 // 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 1475 1395 static QIcon drawCheckBox(bool value) 1476 1396 { … … 1502 1422 } 1503 1423 1424 class QtBoolPropertyManagerPrivate 1425 { 1426 QtBoolPropertyManager *q_ptr; 1427 Q_DECLARE_PUBLIC(QtBoolPropertyManager) 1428 public: 1429 QtBoolPropertyManagerPrivate(); 1430 1431 QMap<const QtProperty *, bool> m_values; 1432 const QIcon m_checkedIcon; 1433 const QIcon m_uncheckedIcon; 1434 }; 1435 1436 QtBoolPropertyManagerPrivate::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 */ 1471 QtBoolPropertyManager::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 */ 1480 QtBoolPropertyManager::~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 */ 1493 bool QtBoolPropertyManager::value(const QtProperty *property) const 1494 { 1495 return d_ptr->m_values.value(property, false); 1496 } 1497 1498 /*! 1499 \reimp 1500 */ 1501 QString 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 1504 1512 /*! 1505 1513 \reimp … … 1511 1519 return QIcon(); 1512 1520 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; 1516 1522 } 1517 1523 … … 6288 6294 // QtCursorPropertyManager 6289 6295 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. 6298 static void clearCursorDatabase(); 6299 Q_GLOBAL_STATIC_WITH_INITIALIZER(QtCursorDatabase, cursorDatabase, qAddPostRoutine(clearCursorDatabase)) 6300 6301 static void clearCursorDatabase() 6302 { 6303 cursorDatabase()->clear(); 6304 } 6291 6305 6292 6306 class QtCursorPropertyManagerPrivate -
trunk/tools/shared/qttoolbardialog/qttoolbardialog.h
r651 r769 69 69 public: 70 70 71 QtToolBarManager(QObject *parent = 0);71 explicit QtToolBarManager(QObject *parent = 0); 72 72 ~QtToolBarManager(); 73 73 … … 101 101 public: 102 102 103 QtToolBarDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0);103 explicit QtToolBarDialog(QWidget *parent = 0, Qt::WindowFlags flags = 0); 104 104 ~QtToolBarDialog(); 105 105 -
trunk/tools/tools.pro
r634 r769 29 29 contains(QT_CONFIG, declarative):SUBDIRS += qmlviewer qmldebugger 30 30 contains(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 32 33 embedded: SUBDIRS += makeqpf 33 34
Note:
See TracChangeset
for help on using the changeset viewer.