tools/qdoc3/pagegenerator.cpp
changeset 3 41300fa6a67c
parent 0 1918ee327afb
child 4 3b1da2848fc7
equal deleted inserted replaced
2:56cd8111b7f7 3:41300fa6a67c
    79 
    79 
    80 QString PageGenerator::fileBase(const Node *node)
    80 QString PageGenerator::fileBase(const Node *node)
    81 {
    81 {
    82     if (node->relates())
    82     if (node->relates())
    83 	node = node->relates();
    83 	node = node->relates();
    84     else if (!node->isInnerNode()) {
    84     else if (!node->isInnerNode())
    85 	node = node->parent();
    85 	node = node->parent();
    86 #ifdef QDOC_QML
    86 #ifdef QDOC_QML
    87         if (node->subType() == Node::QmlPropertyGroup) {
    87     if (node->subType() == Node::QmlPropertyGroup) {
    88             node = node->parent();
    88         node = node->parent();
    89         }
    89     }
    90 #endif        
    90 #endif        
    91     }
       
    92 
    91 
    93     QString base = node->doc().baseName();
    92     QString base = node->doc().baseName();
    94     if (!base.isEmpty())
    93     if (!base.isEmpty())
    95         return base;
    94         return base;
    96 
    95 
    97     const Node *p = node;
    96     const Node *p = node;
    98 
    97 
    99     forever {
    98     forever {
       
    99         const Node *pp = p->parent();
   100         base.prepend(p->name());
   100         base.prepend(p->name());
   101 #ifdef QDOC_QML
   101 #ifdef QDOC_QML
   102         /*
   102         /*
   103           To avoid file name conflicts in the html directory,
   103           To avoid file name conflicts in the html directory,
   104           we prepend "qml-" to the file name of QML element doc
   104           we prepend "qml-" to the file name of QML element doc
   105           files.
   105           files.
   106          */
   106          */
   107         if ((p->subType() == Node::QmlClass) ||
   107         if (p->subType() == Node::QmlClass) {
   108             (p->subType() == Node::QmlPropertyGroup))
       
   109             base.prepend("qml-");
   108             base.prepend("qml-");
   110         else if ((p->type() == Node::QmlProperty) ||
   109         }
   111                  (p->type() == Node::QmlSignal) ||
       
   112                  (p->type() == Node::QmlMethod))
       
   113             base.prepend("qml-");
       
   114 #endif        
   110 #endif        
   115         const Node *pp = p->parent();
       
   116         if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake)
   111         if (!pp || pp->name().isEmpty() || pp->type() == Node::Fake)
   117             break;
   112             break;
   118         base.prepend(QLatin1Char('-'));
   113         base.prepend(QLatin1Char('-'));
   119         p = pp;
   114         p = pp;
   120     }
   115     }