tools/qdoc3/cppcodemarker.cpp
changeset 30 5dc02b23752f
parent 18 2f34d5167611
child 33 3e2da88830cd
--- a/tools/qdoc3/cppcodemarker.cpp	Wed Jun 23 19:07:03 2010 +0300
+++ b/tools/qdoc3/cppcodemarker.cpp	Tue Jul 06 15:10:48 2010 +0300
@@ -145,7 +145,7 @@
     }
     else {
 	QString fullName;
-	for (;;) {
+	while (node) {
 	    fullName.prepend(plainName(node));
 	    if (node->parent() == relative || node->parent()->name().isEmpty())
 		break;
@@ -482,55 +482,66 @@
         if (style == Summary) {
 	    FastSection privateFunctions(classe,
                                          "Private Functions",
+                                         "",
                                          "private function",
 				         "private functions");
-	    FastSection privateSlots(classe, "Private Slots", "private slot", "private slots");
-	    FastSection privateTypes(classe, "Private Types", "private type", "private types");
+	    FastSection privateSlots(classe, "Private Slots", "", "private slot", "private slots");
+	    FastSection privateTypes(classe, "Private Types", "", "private type", "private types");
 	    FastSection protectedFunctions(classe,
                                            "Protected Functions",
+                                           "",
                                            "protected function",
 				           "protected functions");
 	    FastSection protectedSlots(classe,
                                        "Protected Slots",
+                                       "",
                                        "protected slot",
                                        "protected slots");
 	    FastSection protectedTypes(classe,
                                        "Protected Types",
+                                       "",
                                        "protected type",
                                        "protected types");
 	    FastSection protectedVariables(classe,
                                            "Protected Variables",
+                                           "",
                                            "protected type",
                                            "protected variables");
 	    FastSection publicFunctions(classe,
                                         "Public Functions",
+                                        "",
                                         "public function",
                                         "public functions");
-	    FastSection publicSignals(classe, "Signals", "signal", "signals");
-	    FastSection publicSlots(classe, "Public Slots", "public slot", "public slots");
-	    FastSection publicTypes(classe, "Public Types", "public type", "public types");
+	    FastSection publicSignals(classe, "Signals", "", "signal", "signals");
+	    FastSection publicSlots(classe, "Public Slots", "", "public slot", "public slots");
+	    FastSection publicTypes(classe, "Public Types", "", "public type", "public types");
 	    FastSection publicVariables(classe,
                                         "Public Variables",
-                                        "public type",
+                                        "",
+                                        "public variable",
                                         "public variables");
-	    FastSection properties(classe, "Properties", "property", "properties");
+	    FastSection properties(classe, "Properties", "", "property", "properties");
 	    FastSection relatedNonMembers(classe,
                                           "Related Non-Members",
+                                          "",
                                           "related non-member",
                                           "related non-members");
 	    FastSection staticPrivateMembers(classe,
                                              "Static Private Members",
+                                             "",
                                              "static private member",
 					     "static private members");
 	    FastSection staticProtectedMembers(classe,
                                                "Static Protected Members",
+                                               "",
 					       "static protected member",
                                                "static protected members");
 	    FastSection staticPublicMembers(classe,
                                             "Static Public Members",
+                                            "",
                                             "static public member",
 					    "static public members");
-            FastSection macros(inner, "Macros", "macro", "macros");
+            FastSection macros(inner, "Macros", "", "macro", "macros");
 
 	    NodeList::ConstIterator r = classe->relatedNodes().begin();
             while (r != classe->relatedNodes().end()) {
@@ -666,12 +677,12 @@
             append(sections, macros);
         }
         else if (style == Detailed) {
-	    FastSection memberFunctions(classe,"Member Function Documentation");
-	    FastSection memberTypes(classe,"Member Type Documentation");
-	    FastSection memberVariables(classe,"Member Variable Documentation");
-	    FastSection properties(classe,"Property Documentation");
-	    FastSection relatedNonMembers(classe,"Related Non-Members");
-	    FastSection macros(classe,"Macro Documentation");
+	    FastSection memberFunctions(classe,"Member Function Documentation","func","member","members");
+	    FastSection memberTypes(classe,"Member Type Documentation","types","member","members");
+	    FastSection memberVariables(classe,"Member Variable Documentation","vars","member","members");
+	    FastSection properties(classe,"Property Documentation","prop","member","members");
+	    FastSection relatedNonMembers(classe,"Related Non-Members","relnonmem","member","members");
+	    FastSection macros(classe,"Macro Documentation","macros","member","members");
 
 	    NodeList::ConstIterator r = classe->relatedNodes().begin();
             while (r != classe->relatedNodes().end()) {
@@ -717,7 +728,7 @@
 	    append(sections, macros);
         }
         else {
-	    FastSection all(classe);
+	    FastSection all(classe,"","","member","members");
 
 	    QStack<const ClassNode *> stack;
 	    stack.push(classe);
@@ -747,25 +758,29 @@
         if (style == Summary || style == Detailed) {
 	    FastSection namespaces(inner,
                                    "Namespaces",
+                                   style == Detailed ? "nmspace" : "",
                                    "namespace",
                                    "namespaces");
             FastSection classes(inner,
                                 "Classes",
+                                style == Detailed ? "classes" : "",
                                 "class",
                                 "classes");
             FastSection types(inner,
-                              style == Summary ?
-                              "Types" : "Type Documentation",
+                              style == Summary ? "Types" : "Type Documentation",
+                              style == Detailed ? "types" : "",
                               "type",
 			      "types");
             FastSection functions(inner,
                                   style == Summary ?
                                   "Functions" : "Function Documentation",
+                                  style == Detailed ? "func" : "",
 			          "function",
                                   "functions");
             FastSection macros(inner,
                                style == Summary ?
                                "Macros" : "Macro Documentation",
+                               style == Detailed ? "macros" : "",
                                "macro",
                                "macros");
 
@@ -881,7 +896,7 @@
     static QRegExp globalX("[\n{()=] *([a-zA-Z_][a-zA-Z_0-9]*)[ \n]*\\(");
     static QRegExp multiLineComment("/(?:( )?\\*(?:[^*]+|\\*(?! /))*\\*\\1/)");
     multiLineComment.setMinimal(true);
-    static QRegExp singleLineComment("//(?!!)[^!\n]*");
+    static QRegExp singleLineComment("[^:]//(?!!)[^!\\n]*");
     static QRegExp preprocessor("(?:^|\n)(#[ \t]*(?:include|if|elif|endif|error|pragma|define"
                                 "|warning)(?:(?:\\\\\n|\\n#)[^\n]*)*)");
     static QRegExp literals("&quot;(?:[^\\\\&]|\\\\[^\n]|&(?!quot;))*&quot;"
@@ -1067,13 +1082,13 @@
             len = multiLineComment.matchedLength();
         }
         else if (mlpos == -1) {
-            pos = slpos;
-            len = singleLineComment.matchedLength();
+            pos = slpos + 1;
+            len = singleLineComment.matchedLength() - 1;
         }
         else {
             if (slpos < mlpos) {
-                pos = slpos;
-                len = singleLineComment.matchedLength();
+                pos = slpos + 1;
+                len = singleLineComment.matchedLength() - 1;
             }
             else {
                 pos = mlpos;
@@ -1116,26 +1131,32 @@
         if (style == Summary) {
 	    FastSection qmlproperties(qmlClassNode,
                                       "Properties",
+                                      "",
                                       "property",
                                       "properties");
 	    FastSection qmlattachedproperties(qmlClassNode,
                                               "Attached Properties",
+                                              "",
                                               "property",
                                               "properties");
 	    FastSection qmlsignals(qmlClassNode,
-                                "Signals",
-                                "signal",
-                                "signals");
+                                   "Signals",
+                                   "",
+                                   "signal",
+                                   "signals");
 	    FastSection qmlattachedsignals(qmlClassNode,
-                                           "QML Attached Signals",
+                                           "Attached Signals",
+                                           "",
                                            "signal",
                                            "signals");
 	    FastSection qmlmethods(qmlClassNode,
                                    "Methods",
+                                   "",
                                    "method",
                                    "methods");
 	    FastSection qmlattachedmethods(qmlClassNode,
-                                           "QML Attached Methods",
+                                           "Attached Methods",
+                                           "",
                                            "method",
                                            "methods");
 
@@ -1179,12 +1200,15 @@
 	    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");
+            FastSection qmlproperties(qmlClassNode, "Property Documentation","qmlprop","member","members");
+	    FastSection qmlattachedproperties(qmlClassNode,"Attached Property Documentation","qmlattprop",
+                                              "member","members");
+            FastSection qmlsignals(qmlClassNode,"Signal Documentation","qmlsig","member","members");
+	    FastSection qmlattachedsignals(qmlClassNode,"Attached Signal Documentation","qmlattsig",
+                                           "member","members");
+            FastSection qmlmethods(qmlClassNode,"Method Documentation","qmlmeth","member","members");
+	    FastSection qmlattachedmethods(qmlClassNode,"Attached Method Documentation","qmlattmeth",
+                                           "member","members");
 	    NodeList::ConstIterator c = qmlClassNode->childNodes().begin();
 	    while (c != qmlClassNode->childNodes().end()) {
                 if ((*c)->subType() == Node::QmlPropertyGroup) {