diff options
author | Martin Smith <martin.smith@nokia.com> | 2010-10-18 11:22:40 (GMT) |
---|---|---|
committer | Martin Smith <martin.smith@nokia.com> | 2010-10-18 11:22:40 (GMT) |
commit | 410f203fd3542af182a6fe4406cc5094b65a90f8 (patch) | |
tree | ed9911a06347fcad14f7aedab6b98c3f366078dc | |
parent | 65daf75c29f1865bf0eb51570c09a304fefb25ad (diff) | |
download | Qt-410f203fd3542af182a6fe4406cc5094b65a90f8.zip Qt-410f203fd3542af182a6fe4406cc5094b65a90f8.tar.gz Qt-410f203fd3542af182a6fe4406cc5094b65a90f8.tar.bz2 |
qdoc: Changed GUIDs from "{xxxxxx}" to "id-xxxxxxx".
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.cpp | 25 | ||||
-rw-r--r-- | tools/qdoc3/ditaxmlgenerator.h | 3 | ||||
-rw-r--r-- | tools/qdoc3/htmlgenerator.cpp | 1 | ||||
-rw-r--r-- | tools/qdoc3/node.cpp | 16 | ||||
-rw-r--r-- | tools/qdoc3/node.h | 5 |
5 files changed, 16 insertions, 34 deletions
diff --git a/tools/qdoc3/ditaxmlgenerator.cpp b/tools/qdoc3/ditaxmlgenerator.cpp index 42f6d1d..9108d7b 100644 --- a/tools/qdoc3/ditaxmlgenerator.cpp +++ b/tools/qdoc3/ditaxmlgenerator.cpp @@ -559,7 +559,8 @@ QString DitaXmlGenerator::lookupGuid(QString text) QMap<QString, QString>::const_iterator i = name2guidMap.find(text); if (i != name2guidMap.end()) return i.value(); - QString guid = QUuid::createUuid().toString(); + QString t = QUuid::createUuid().toString(); + QString guid = "id-" + t.mid(1,t.length()-2); name2guidMap.insert(text,guid); return guid; } @@ -578,7 +579,8 @@ QString DitaXmlGenerator::lookupGuid(const QString& fileName, const QString& tex GuidMap::const_iterator i = gm->find(text); if (i != gm->end()) return i.value(); - QString guid = QUuid::createUuid().toString(); + QString t = QUuid::createUuid().toString(); + QString guid = "id-" + t.mid(1,t.length()-2); gm->insert(text,guid); return guid; } @@ -1840,25 +1842,6 @@ DitaXmlGenerator::generateClassLikeNode(const InnerNode* inner, CodeMarker* mark } /*! - Write a paragraph for the \a target and a poaragraph for - the \a header. Use the \a attribute for the \a header. - */ -void DitaXmlGenerator::writeTargetAndHeader(const QString& target, - const QString& header, - const QString& attribute) -{ - xmlWriter().writeStartElement("p"); - writeGuidAttribute(registerRef(target)); - xmlWriter().writeAttribute("outputclass","target"); - xmlWriter().writeCharacters(header); - xmlWriter().writeEndElement(); // </p> - xmlWriter().writeStartElement("p"); - xmlWriter().writeAttribute("outputclass",attribute); - xmlWriter().writeCharacters(header); - xmlWriter().writeEndElement(); // </p> -} - -/*! Write a list item for a \a link with the given \a text. */ void DitaXmlGenerator::writeXrefListItem(const QString& link, const QString& text) diff --git a/tools/qdoc3/ditaxmlgenerator.h b/tools/qdoc3/ditaxmlgenerator.h index c0cb0db..e564f58 100644 --- a/tools/qdoc3/ditaxmlgenerator.h +++ b/tools/qdoc3/ditaxmlgenerator.h @@ -108,9 +108,6 @@ class DitaXmlGenerator : public PageGenerator virtual QString linkForNode(const Node* node, const Node* relative); virtual QString refForAtom(Atom* atom, const Node* node); - void writeTargetAndHeader(const QString& target, - const QString& header, - const QString& attribute); void writeXrefListItem(const QString& link, const QString& text); QString fullQualification(const Node* n); diff --git a/tools/qdoc3/htmlgenerator.cpp b/tools/qdoc3/htmlgenerator.cpp index 726196f..19b86e0 100644 --- a/tools/qdoc3/htmlgenerator.cpp +++ b/tools/qdoc3/htmlgenerator.cpp @@ -56,6 +56,7 @@ #include <qlist.h> #include <qiterator.h> #include <qtextcodec.h> +#include <QUuid> QT_BEGIN_NAMESPACE diff --git a/tools/qdoc3/node.cpp b/tools/qdoc3/node.cpp index ce53b86..f4736f3 100644 --- a/tools/qdoc3/node.cpp +++ b/tools/qdoc3/node.cpp @@ -46,6 +46,7 @@ #include "node.h" #include "tree.h" #include "codemarker.h" +#include <QUuid> #include <qdebug.h> QT_BEGIN_NAMESPACE @@ -103,7 +104,6 @@ Node::Node(Type type, InnerNode *parent, const QString& name) { if (par) par->addChild(this); - //uuid = QUuid::createUuid(); } /*! @@ -270,14 +270,16 @@ QString Node::fileBase() const } /*! - Returns this node's Universally Unique IDentifier. - If its UUID has not yet been created, it is created - first. + Returns this node's Universally Unique IDentifier as a + QString. Creates the UUID first, if it has not been created. */ -QUuid Node::guid() const +QString Node::guid() const { - if (uuid.isNull()) - uuid = QUuid::createUuid(); + if (uuid.isEmpty()) { + QUuid quuid = QUuid::createUuid(); + QString t = quuid.toString(); + uuid = "id-" + t.mid(1,t.length()-2); + } return uuid; } diff --git a/tools/qdoc3/node.h b/tools/qdoc3/node.h index 40b78ef..0b493ee 100644 --- a/tools/qdoc3/node.h +++ b/tools/qdoc3/node.h @@ -55,7 +55,6 @@ #include "doc.h" #include "location.h" #include "text.h" -#include <QUuid> QT_BEGIN_NAMESPACE @@ -191,7 +190,7 @@ class Node void clearRelated() { rel = 0; } virtual QString fileBase() const; - QUuid guid() const; + QString guid() const; QString ditaXmlHref(); QString extractClassName(const QString &string) const; @@ -223,7 +222,7 @@ class Node QString u; QString sinc; QString tpl; - mutable QUuid uuid; + mutable QString uuid; }; class FunctionNode; |