qdoc: Include QML type name in method quid
authorMartin Smith <martin.smith@nokia.com>
Wed, 16 May 2012 08:47:28 +0000 (10:47 +0200)
committerQt by Nokia <qt-info@nokia.com>
Wed, 16 May 2012 17:37:44 +0000 (19:37 +0200)
A case was found where a method inherited from a
QML type marked abstract had the same name as a
method in the inheriting class, and these two
methods received the same quid. This was fixed
by including the QML type name in the guid for
QML methods.

Change-Id: I110eb254b3c6be014cb67fdc5b57b5aa2f575220
Reviewed-by: Casper van Donderen <casper.vandonderen@nokia.com>
src/tools/qdoc/node.cpp
src/tools/qdoc/node.h

index 7c1be44..bb70200 100644 (file)
@@ -527,9 +527,9 @@ QString Node::fileBase() const
  */
 QString Node::guid() const
 {
-    if (uuid.isEmpty())
-        uuid = idForNode();
-    return uuid;
+    if (uuid_.isEmpty())
+        uuid_ = idForNode();
+    return uuid_;
 }
 
 #if 0
@@ -2724,7 +2724,7 @@ QString Node::idForNode() const
                     str = "namespace-member-" + func->name();
                 else if (parent_->type() == Fake) {
                     if (parent_->subType() == QmlClass)
-                        str = "qml-method-" + func->name();
+                        str = "qml-method-" + parent_->name().toLower() + "-" + func->name();
                     else
                         qDebug() << "qdoc internal error: Node subtype not handled:"
                                  << parent_->subType() << func->name();
@@ -2801,7 +2801,7 @@ QString Node::idForNode() const
         break;
     case Node::QmlMethod:
         func = static_cast<const FunctionNode*>(this);
-        str = "qml-method-" + func->name();
+        str = "qml-method-" + parent_->name().toLower() + "-" + func->name();
         if (func->overloadNumber() != 1)
             str += QLatin1Char('-') + QString::number(func->overloadNumber());
         break;
index 0b8758d..a7d5f4a 100644 (file)
@@ -288,7 +288,7 @@ private:
     QString url_;
     QString sinc;
     QString templateStuff_;
-    mutable QString uuid;
+    mutable QString uuid_;
     QString outSubDir_;
     QString qmlModuleName_;
     QString qmlModuleVersionMajor_;