diff options
author | Michael Brasser <michael.brasser@nokia.com> | 2009-10-25 23:26:53 (GMT) |
---|---|---|
committer | Michael Brasser <michael.brasser@nokia.com> | 2009-10-25 23:26:53 (GMT) |
commit | cbb1b29d397c063fc3bcae04c5b062f20cbd12c5 (patch) | |
tree | d89cebe45c9f6dfdcab34a95da19ee0d670e30f5 /tools | |
parent | ed7d58f6668be4ffb5f915722dee81c864f74844 (diff) | |
parent | 9aa00de1d277763c0f7a380fde27face60e5f686 (diff) | |
download | Qt-cbb1b29d397c063fc3bcae04c5b062f20cbd12c5.zip Qt-cbb1b29d397c063fc3bcae04c5b062f20cbd12c5.tar.gz Qt-cbb1b29d397c063fc3bcae04c5b062f20cbd12c5.tar.bz2 |
Merge branch '4.6' of git@scm.dev.nokia.troll.no:qt/qt into kinetic-declarativeui
Conflicts:
tools/qdoc3/cppcodemarker.cpp
Diffstat (limited to 'tools')
-rw-r--r-- | tools/assistant/lib/qhelpcollectionhandler.cpp | 14 | ||||
-rw-r--r-- | tools/assistant/lib/qhelpsearchquerywidget.cpp | 2 | ||||
-rw-r--r-- | tools/linguist/lupdate/main.cpp | 2 | ||||
-rw-r--r-- | tools/linguist/shared/qm.cpp | 9 | ||||
-rw-r--r-- | tools/linguist/shared/translatormessage.cpp | 8 | ||||
-rw-r--r-- | tools/qdoc3/cppcodemarker.cpp | 38 | ||||
-rw-r--r-- | tools/qdoc3/cppcodeparser.cpp | 20 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 12 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 16 | ||||
-rw-r--r-- | tools/qdoc3/test/qt-build-docs.qdocconf | 2 |
10 files changed, 95 insertions, 28 deletions
diff --git a/tools/assistant/lib/qhelpcollectionhandler.cpp b/tools/assistant/lib/qhelpcollectionhandler.cpp index f59b227..4aa7ab6 100644 --- a/tools/assistant/lib/qhelpcollectionhandler.cpp +++ b/tools/assistant/lib/qhelpcollectionhandler.cpp @@ -76,7 +76,8 @@ bool QHelpCollectionHandler::isDBOpened() { if (m_dbOpened) return true; - emit error(tr("The collection file is not set up yet!")); + emit error(tr("The collection file '%1' is not set up yet!"). + arg(m_collectionFile)); return false; } @@ -134,7 +135,8 @@ bool QHelpCollectionHandler::copyCollectionFile(const QString &fileName) QFileInfo fi(fileName); if (fi.exists()) { - emit error(tr("The specified collection file already exists!")); + emit error(tr("The collection file '%1' already exists!"). + arg(fileName)); return false; } @@ -281,7 +283,7 @@ bool QHelpCollectionHandler::removeCustomFilter(const QString &filterName) filterNameId = m_query.value(0).toInt(); if (filterNameId < 0) { - emit error(tr("Unknown filter!")); + emit error(tr("Unknown filter '%1'!").arg(filterName)); return false; } @@ -386,7 +388,7 @@ bool QHelpCollectionHandler::registerDocumentation(const QString &fileName) QString ns = reader.namespaceName(); if (ns.isEmpty()) { - emit error(tr("Invalid documentation file!")); + emit error(tr("Invalid documentation file '%1'!").arg(fileName)); return false; } @@ -553,7 +555,7 @@ int QHelpCollectionHandler::registerNamespace(const QString &nspace, const QStri if (m_query.exec()) namespaceId = m_query.lastInsertId().toInt(); if (namespaceId < 1) { - emit error(tr("Cannot register namespace!")); + emit error(tr("Cannot register namespace '%1'!").arg(nspace)); return -1; } return namespaceId; @@ -577,7 +579,7 @@ void QHelpCollectionHandler::optimizeDatabase(const QString &fileName) db.setDatabaseName(fileName); if (!db.open()) { QSqlDatabase::removeDatabase(QLatin1String("optimize")); - emit error(tr("Cannot open database to optimize!")); + emit error(tr("Cannot open database '%1' to optimize!").arg(fileName)); return; } diff --git a/tools/assistant/lib/qhelpsearchquerywidget.cpp b/tools/assistant/lib/qhelpsearchquerywidget.cpp index 361e9ac..f2f40ec 100644 --- a/tools/assistant/lib/qhelpsearchquerywidget.cpp +++ b/tools/assistant/lib/qhelpsearchquerywidget.cpp @@ -289,7 +289,7 @@ private slots: { QList<QHelpSearchQuery> queryList; #if !defined(QT_CLUCENE_SUPPORT) - queryList.append(QHelSearchQuery(QHelpSearchQuery::DEFAULT, + queryList.append(QHelpSearchQuery(QHelpSearchQuery::DEFAULT, QStringList(defaultQuery->text()))); #else diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index d570e02..af40616 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -160,6 +160,8 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil tor.setCodecName(codecForTr); if (!targetLanguage.isEmpty()) tor.setLanguageCode(targetLanguage); + else + tor.setLanguageCode(Translator::guessLanguageCodeFromFileName(fileName)); if (!sourceLanguage.isEmpty()) tor.setSourceLanguageCode(sourceLanguage); } diff --git a/tools/linguist/shared/qm.cpp b/tools/linguist/shared/qm.cpp index fefe91c..317a07e 100644 --- a/tools/linguist/shared/qm.cpp +++ b/tools/linguist/shared/qm.cpp @@ -440,9 +440,10 @@ void Releaser::insert(const TranslatorMessage &message, bool forceComment) void Releaser::insertIdBased(const TranslatorMessage &message) { QStringList tlns = message.translations(); - for (int i = 0; i < tlns.size(); ++i) - if (tlns.at(i).isEmpty()) - tlns[i] = message.sourceText(); + if (message.type() == TranslatorMessage::Unfinished) + for (int i = 0; i < tlns.size(); ++i) + if (tlns.at(i).isEmpty()) + tlns[i] = message.sourceText(); ByteTranslatorMessage bmsg("", originalBytes(message.id(), false), "", tlns); m_messages.insert(bmsg, 0); } @@ -713,7 +714,7 @@ static bool saveQM(const Translator &translator, QIODevice &dev, ConversionData continue; } if (typ == TranslatorMessage::Unfinished) { - if (msg.translation().isEmpty()) { + if (!cd.m_idBased && msg.translation().isEmpty()) { ++untranslated; continue; } else { diff --git a/tools/linguist/shared/translatormessage.cpp b/tools/linguist/shared/translatormessage.cpp index 417f6b1..db6f333 100644 --- a/tools/linguist/shared/translatormessage.cpp +++ b/tools/linguist/shared/translatormessage.cpp @@ -151,6 +151,7 @@ bool TranslatorMessage::operator==(const TranslatorMessage& m) const return (m_context == m.m_context) && m_sourcetext == m.m_sourcetext && m_extra[msgIdPlural] == m.m_extra[msgIdPlural] + && m_id == m.m_id && (m_sourcetext.isEmpty() || m_comment == m.m_comment); } @@ -161,7 +162,9 @@ bool TranslatorMessage::operator<(const TranslatorMessage& m) const return m_context < m.m_context; if (m_sourcetext != m.m_sourcetext) return m_sourcetext < m.m_sourcetext; - return m_comment < m.m_comment; + if (m_comment != m.m_comment) + return m_comment < m.m_comment; + return m_id < m.m_id; } int qHash(const TranslatorMessage &msg) @@ -170,7 +173,8 @@ int qHash(const TranslatorMessage &msg) qHash(msg.context()) ^ qHash(msg.sourceText()) ^ qHash(msg.extra(QLatin1String("po-msgid_plural"))) ^ - qHash(msg.comment()); + qHash(msg.comment()) ^ + qHash(msg.id()); } bool TranslatorMessage::hasExtra(const QString &key) const diff --git a/tools/qdoc3/cppcodemarker.cpp b/tools/qdoc3/cppcodemarker.cpp index 30ea251..c07be8b 100644 --- a/tools/qdoc3/cppcodemarker.cpp +++ b/tools/qdoc3/cppcodemarker.cpp @@ -1124,10 +1124,18 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, "Signals", "signal", "signals"); + FastSection qmlattachedsignals(qmlClassNode, + "QML Attached Signals", + "signal", + "signals"); FastSection qmlmethods(qmlClassNode, "Methods", "method", "methods"); + FastSection qmlattachedmethods(qmlClassNode, + "QML Attached Methods", + "method", + "methods"); NodeList::ConstIterator c = qmlClassNode->childNodes().begin(); while (c != qmlClassNode->childNodes().end()) { @@ -1146,23 +1154,35 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, } } else if ((*c)->type() == Node::QmlSignal) { - insert(qmlsignals,*c,style,Okay); + const QmlSignalNode* sn = static_cast<const QmlSignalNode*>(*c); + if (sn->isAttached()) + insert(qmlattachedsignals,*c,style,Okay); + else + insert(qmlsignals,*c,style,Okay); } else if ((*c)->type() == Node::QmlMethod) { - insert(qmlmethods,*c,style,Okay); + const QmlMethodNode* mn = static_cast<const QmlMethodNode*>(*c); + if (mn->isAttached()) + insert(qmlattachedmethods,*c,style,Okay); + else + insert(qmlmethods,*c,style,Okay); } ++c; } append(sections,qmlproperties); append(sections,qmlattachedproperties); append(sections,qmlsignals); + append(sections,qmlattachedsignals); append(sections,qmlmethods); + append(sections,qmlattachedmethods); } else if (style == Detailed) { FastSection qmlproperties(qmlClassNode, "Property Documentation"); FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation"); FastSection qmlsignals(qmlClassNode,"Signal Documentation"); + FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation"); FastSection qmlmethods(qmlClassNode,"Method Documentation"); + FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation"); NodeList::ConstIterator c = qmlClassNode->childNodes().begin(); while (c != qmlClassNode->childNodes().end()) { if ((*c)->subType() == Node::QmlPropertyGroup) { @@ -1173,17 +1193,27 @@ QList<Section> CppCodeMarker::qmlSections(const QmlClassNode* qmlClassNode, insert(qmlproperties,*c,style,Okay); } else if ((*c)->type() == Node::QmlSignal) { - insert(qmlsignals,*c,style,Okay); + const QmlSignalNode* sn = static_cast<const QmlSignalNode*>(*c); + if (sn->isAttached()) + insert(qmlattachedsignals,*c,style,Okay); + else + insert(qmlsignals,*c,style,Okay); } else if ((*c)->type() == Node::QmlMethod) { - insert(qmlmethods,*c,style,Okay); + const QmlMethodNode* mn = static_cast<const QmlMethodNode*>(*c); + if (mn->isAttached()) + insert(qmlattachedmethods,*c,style,Okay); + else + insert(qmlmethods,*c,style,Okay); } ++c; } append(sections,qmlproperties); append(sections,qmlattachedproperties); append(sections,qmlsignals); + append(sections,qmlattachedsignals); append(sections,qmlmethods); + append(sections,qmlattachedmethods); } } diff --git a/tools/qdoc3/cppcodeparser.cpp b/tools/qdoc3/cppcodeparser.cpp index ad43b2b..84ec3f4 100644 --- a/tools/qdoc3/cppcodeparser.cpp +++ b/tools/qdoc3/cppcodeparser.cpp @@ -91,7 +91,9 @@ QT_BEGIN_NAMESPACE #define COMMAND_QMLATTACHEDPROPERTY Doc::alias("qmlattachedproperty") #define COMMAND_QMLINHERITS Doc::alias("inherits") #define COMMAND_QMLSIGNAL Doc::alias("qmlsignal") +#define COMMAND_QMLATTACHEDSIGNAL Doc::alias("qmlattachedsignal") #define COMMAND_QMLMETHOD Doc::alias("qmlmethod") +#define COMMAND_QMLATTACHEDMETHOD Doc::alias("qmlattachedmethod") #define COMMAND_QMLDEFAULT Doc::alias("default") #endif @@ -485,7 +487,9 @@ QSet<QString> CppCodeParser::topicCommands() << COMMAND_QMLPROPERTY << COMMAND_QMLATTACHEDPROPERTY << COMMAND_QMLSIGNAL - << COMMAND_QMLMETHOD; + << COMMAND_QMLATTACHEDSIGNAL + << COMMAND_QMLMETHOD + << COMMAND_QMLATTACHEDMETHOD; #else << COMMAND_VARIABLE; #endif @@ -678,7 +682,9 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, return new QmlClassNode(tre->root(), names[0], classNode); } else if ((command == COMMAND_QMLSIGNAL) || - (command == COMMAND_QMLMETHOD)) { + (command == COMMAND_QMLMETHOD) || + (command == COMMAND_QMLATTACHEDSIGNAL) || + (command == COMMAND_QMLATTACHEDMETHOD)) { QString element; QString name; QmlClassNode* qmlClass = 0; @@ -687,9 +693,15 @@ Node *CppCodeParser::processTopicCommand(const Doc& doc, if (n && n->subType() == Node::QmlClass) { qmlClass = static_cast<QmlClassNode*>(n); if (command == COMMAND_QMLSIGNAL) - return new QmlSignalNode(qmlClass,name); + return new QmlSignalNode(qmlClass,name,false); + else if (command == COMMAND_QMLATTACHEDSIGNAL) + return new QmlSignalNode(qmlClass,name,true); + else if (command == COMMAND_QMLMETHOD) + return new QmlMethodNode(qmlClass,name,false); + else if (command == COMMAND_QMLATTACHEDMETHOD) + return new QmlMethodNode(qmlClass,name,true); else - return new QmlMethodNode(qmlClass,name); + return 0; // never get here. } } } diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index d47c478..ecb4a44 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -1212,8 +1212,10 @@ bool QmlPropertyNode::fromTrool(Trool troolean, bool defaultValue) /*! Constructor for the QML signal node. */ -QmlSignalNode::QmlSignalNode(QmlClassNode *parent, const QString& name) - : LeafNode(QmlSignal, parent, name) +QmlSignalNode::QmlSignalNode(QmlClassNode *parent, + const QString& name, + bool attached) + : LeafNode(QmlSignal, parent, name), att(attached) { // nothing. } @@ -1221,8 +1223,10 @@ QmlSignalNode::QmlSignalNode(QmlClassNode *parent, const QString& name) /*! Constructor for the QML method node. */ -QmlMethodNode::QmlMethodNode(QmlClassNode *parent, const QString& name) - : LeafNode(QmlMethod, parent, name) +QmlMethodNode::QmlMethodNode(QmlClassNode *parent, + const QString& name, + bool attached) + : LeafNode(QmlMethod, parent, name), att(attached) { // nothing. } diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 6b19f60..3252964 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -422,19 +422,31 @@ class QmlPropertyNode : public LeafNode class QmlSignalNode : public LeafNode { public: - QmlSignalNode(QmlClassNode* parent, const QString& name); + QmlSignalNode(QmlClassNode* parent, + const QString& name, + bool attached); virtual ~QmlSignalNode() { } const QString& element() const { return parent()->name(); } + bool isAttached() const { return att; } + + private: + bool att; }; class QmlMethodNode : public LeafNode { public: - QmlMethodNode(QmlClassNode* parent, const QString& name); + QmlMethodNode(QmlClassNode* parent, + const QString& name, + bool attached); virtual ~QmlMethodNode() { } const QString& element() const { return parent()->name(); } + bool isAttached() const { return att; } + + private: + bool att; }; #endif diff --git a/tools/qdoc3/test/qt-build-docs.qdocconf b/tools/qdoc3/test/qt-build-docs.qdocconf index 0f1a776..0848beb 100644 --- a/tools/qdoc3/test/qt-build-docs.qdocconf +++ b/tools/qdoc3/test/qt-build-docs.qdocconf @@ -8,7 +8,7 @@ project = Qt description = Qt Reference Documentation url = http://qt.nokia.com/doc/4.6 -edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtSql QtSvg \ +edition.Desktop.modules = QtCore QtDBus QtGui QtNetwork QtOpenGL QtScript QtScriptTools QtSql QtSvg \ QtWebKit QtXml QtXmlPatterns Qt3Support QtHelp \ QtDesigner QtAssistant QAxContainer Phonon \ QAxServer QtUiTools QtTest QtDBus |