Changeset 846 for trunk/tools/qdoc3/generator.cpp
- Timestamp:
- May 5, 2011, 5:36:53 AM (14 years ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo changed
/branches/vendor/nokia/qt/4.7.2 (added) merged: 845 /branches/vendor/nokia/qt/current merged: 844 /branches/vendor/nokia/qt/4.6.3 removed
- Property svn:mergeinfo changed
-
trunk/tools/qdoc3/generator.cpp
r651 r846 1 1 /**************************************************************************** 2 2 ** 3 ** Copyright (C) 201 0Nokia Corporation and/or its subsidiary(-ies).3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). 4 4 ** All rights reserved. 5 5 ** Contact: Nokia Corporation (qt-info@nokia.com) … … 43 43 generator.cpp 44 44 */ 45 #include <QtCore>46 45 #include <qdir.h> 47 46 #include <qdebug.h> … … 68 67 QStringList Generator::exampleDirs; 69 68 QStringList Generator::exampleImgExts; 69 QStringList Generator::scriptFiles; 70 QStringList Generator::scriptDirs; 71 QStringList Generator::styleFiles; 72 QStringList Generator::styleDirs; 70 73 QString Generator::outDir; 71 74 QString Generator::project; … … 126 129 config.lastLocation().fatal(tr("Cannot create output directory '%1'") 127 130 .arg(outDir + "/images/used-in-examples")); 131 if (!dirInfo.mkdir(outDir + "/scripts")) 132 config.lastLocation().fatal(tr("Cannot create output directory '%1'") 133 .arg(outDir + "/scripts")); 134 if (!dirInfo.mkdir(outDir + "/style")) 135 config.lastLocation().fatal(tr("Cannot create output directory '%1'") 136 .arg(outDir + "/style")); 128 137 } 129 138 130 139 imageFiles = config.getStringList(CONFIG_IMAGES); 131 140 imageDirs = config.getStringList(CONFIG_IMAGEDIRS); 141 scriptFiles = config.getStringList(CONFIG_SCRIPTS); 142 scriptDirs = config.getStringList(CONFIG_SCRIPTDIRS); 143 styleFiles = config.getStringList(CONFIG_STYLES); 144 styleDirs = config.getStringList(CONFIG_STYLEDIRS); 132 145 exampleDirs = config.getStringList(CONFIG_EXAMPLEDIRS); 133 146 exampleImgExts = config.getStringList(CONFIG_EXAMPLES + Config::dot + … … 167 180 ++e; 168 181 } 182 183 QStringList noExts; 184 QStringList scripts = 185 config.getStringList(CONFIG_SCRIPTS+Config::dot+(*g)->format()); 186 e = scripts.begin(); 187 while (e != scripts.end()) { 188 QString userFriendlyFilePath; 189 QString filePath = Config::findFile(config.lastLocation(), 190 scriptFiles, 191 scriptDirs, 192 *e, 193 noExts, 194 userFriendlyFilePath); 195 if (!filePath.isEmpty()) 196 Config::copyFile(config.lastLocation(), 197 filePath, 198 userFriendlyFilePath, 199 (*g)->outputDir() + 200 "/scripts"); 201 ++e; 202 } 203 204 QStringList styles = 205 config.getStringList(CONFIG_STYLES+Config::dot+(*g)->format()); 206 e = styles.begin(); 207 while (e != styles.end()) { 208 QString userFriendlyFilePath; 209 QString filePath = Config::findFile(config.lastLocation(), 210 styleFiles, 211 styleDirs, 212 *e, 213 noExts, 214 userFriendlyFilePath); 215 if (!filePath.isEmpty()) 216 Config::copyFile(config.lastLocation(), 217 filePath, 218 userFriendlyFilePath, 219 (*g)->outputDir() + 220 "/style"); 221 ++e; 222 } 169 223 } 170 224 ++g; … … 228 282 imageDirs.clear(); 229 283 outDir = ""; 284 QmlClassNode::clear(); 230 285 } 231 286 … … 323 378 324 379 if (node->type() == Node::Function) { 325 #if 0 380 #if 0 326 381 const FunctionNode *func = (const FunctionNode *) node; 327 382 if (func->isOverload() && func->metaness() != FunctionNode::Ctor) 328 383 generateOverload(node, marker); 329 #endif 384 #endif 330 385 } 331 386 else if (node->type() == Node::Fake) { … … 348 403 generateReimplementedFrom(func, marker); 349 404 } 350 405 351 406 if (!generateText(node->doc().body(), node, marker)) 352 407 if (node->isReimp()) … … 453 508 if (func->reimplementedFrom() != 0) 454 509 generateReimplementedFrom(func, marker); 455 #endif 510 #endif 456 511 } 457 512 } … … 545 600 files comprising the example, and the list of images used 546 601 by the example. The images are copied into a subtree of 547 \c{...doc/html/images/used-in-examples/...} 602 \c{...doc/html/images/used-in-examples/...} 548 603 */ 549 604 void Generator::generateFileList(const FakeNode* fake, … … 641 696 } 642 697 #endif 643 644 void Generator::generateModuleWarning(const ClassNode *classe,645 CodeMarker *marker)646 {647 QString module = classe->moduleName();648 if (!module.isEmpty()) {649 Text text;650 if (!editionModuleMap["DesktopLight"].contains(module)) {651 text << Atom::ParaLeft652 << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)653 << "This class is not part of the Qt GUI Framework Edition."654 << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)655 << Atom::ParaRight;656 }657 else if (module == "Qt3Support") {658 text << Atom::ParaLeft659 << Atom(Atom::FormattingLeft, ATOM_FORMATTING_BOLD)660 << "Note to Qt GUI Framework Edition users:"661 << Atom(Atom::FormattingRight, ATOM_FORMATTING_BOLD)662 << " This class is only available in the "663 << Atom(Atom::AutoLink, "Qt Full Framework Edition")664 << "." << Atom::ParaRight;665 }666 667 generateText(text, classe, marker);668 }669 }670 698 671 699 QString Generator::indent(int level, const QString& markedCode) … … 954 982 NodeList::ConstIterator c = innerNode->childNodes().begin(); 955 983 while (c != innerNode->childNodes().end()) { 956 switch ((*c)->threadSafeness()) { 957 case Node::Reentrant: 958 reentrant.append(*c); 959 if (threadSafeness == Node::ThreadSafe) 984 985 if ((*c)->status() != Node::Obsolete){ 986 switch ((*c)->threadSafeness()) { 987 case Node::Reentrant: 988 reentrant.append(*c); 989 if (threadSafeness == Node::ThreadSafe) 990 exceptions = true; 991 break; 992 case Node::ThreadSafe: 993 threadsafe.append(*c); 994 if (threadSafeness == Node::Reentrant) 995 exceptions = true; 996 break; 997 case Node::NonReentrant: 998 nonreentrant.append(*c); 960 999 exceptions = true; 961 break; 962 case Node::ThreadSafe: 963 threadsafe.append(*c); 964 if (threadSafeness == Node::Reentrant) 965 exceptions = true; 966 break; 967 case Node::NonReentrant: 968 nonreentrant.append(*c); 969 exceptions = true; 970 break; 971 default: 972 break; 1000 break; 1001 default: 1002 break; 1003 } 973 1004 } 974 1005 ++c; 975 1006 } 976 if (!exceptions) 1007 if (!exceptions) 977 1008 text << "."; 978 1009 else if (threadSafeness == Node::Reentrant) { … … 1041 1072 text << Atom::ParaLeft 1042 1073 << "This " 1043 << typeString(node) 1044 << " was introduced in "; 1074 << typeString(node); 1075 if (node->type() == Node::Enum) 1076 text << " was introduced or modified in "; 1077 else 1078 text << " was introduced in "; 1045 1079 if (project.isEmpty()) 1046 1080 text << "version"; … … 1061 1095 << "This function overloads "; 1062 1096 QString t = node->name() + "()"; 1063 text << Atom::AutoLink << t 1097 text << Atom::AutoLink << t 1064 1098 << Atom::ParaRight; 1065 1099 generateText(text, node, marker); … … 1214 1248 } 1215 1249 1250 void Generator::appendSortedQmlNames(Text& text, 1251 const Node* base, 1252 const NodeList& subs, 1253 CodeMarker *marker) 1254 { 1255 QMap<QString,Text> classMap; 1256 int index = 0; 1257 1258 #ifdef DEBUG_MULTIPLE_QDOCCONF_FILES 1259 qDebug() << "Generator::appendSortedQmlNames():" << base->name() << "is inherited by..."; 1260 #endif 1261 for (int i = 0; i < subs.size(); ++i) { 1262 Text t; 1263 #ifdef DEBUG_MULTIPLE_QDOCCONF_FILES 1264 qDebug() << " " << subs[i]->name(); 1265 #endif 1266 appendFullName(t, subs[i], base, marker); 1267 classMap[t.toString().toLower()] = t; 1268 } 1269 1270 QStringList names = classMap.keys(); 1271 names.sort(); 1272 1273 foreach (const QString &name, names) { 1274 text << classMap[name]; 1275 text << separator(index++, names.count()); 1276 } 1277 } 1278 1216 1279 int Generator::skipAtoms(const Atom *atom, Atom::Type type) const 1217 1280 {
Note:
See TracChangeset
for help on using the changeset viewer.