};
QStringList Generator::styleDirs;
QStringList Generator::styleFiles;
+bool Generator::debugging_ = false;
+
+void Generator::setDebugSegfaultFlag(bool b)
+{
+ if (b)
+ qDebug() << "DEBUG: Setting debug flag.";
+ else
+ qDebug() << "DEBUG: Clearing debug flag.";
+ debugging_ = b;
+}
+
+/*!
+ Prints \a message as an aid to debugging the release version.
+ */
+void Generator::debugSegfault(const QString& message)
+{
+ qDebug() << "DEBUG:" << message;
+}
/*!
Constructs the generator base class. Prepends the newly
if (!node->outputSubdirectory().isEmpty())
path += node->outputSubdirectory() + QLatin1Char('/');
path += fileName;
+ Generator::debugSegfault("Writing: " + path);
outFileNames.insert(fileName,fileName);
QFile* outFile = new QFile(path);
if (!outFile->open(QFile::WriteOnly))
static void terminate();
static void writeOutFileNames();
static void augmentImageDirs(QSet<QString>& moreImageDirs);
+ static void debugSegfault(const QString& message);
+ static void setDebugSegfaultFlag(bool b);
+ static bool debugging() { return debugging_; }
protected:
virtual void beginSubPage(const InnerNode* node, const QString& fileName);
static QStringList scriptFiles;
static QStringList styleDirs;
static QStringList styleFiles;
+ static bool debugging_;
void appendFullName(Text& text,
const Node *apparentNode,
QStringList excludedDirsList;
QStringList excludedFilesList;
+ Generator::debugSegfault("Reading excludedirs");
excludedDirsList = config.getCanonicalRelativePathList(CONFIG_EXCLUDEDIRS);
foreach (const QString &excludeDir, excludedDirsList) {
QString p = QDir::fromNativeSeparators(excludeDir);
excludedDirs.insert(p);
}
+ Generator::debugSegfault("Reading excludefiles");
excludedFilesList = config.getCleanPathList(CONFIG_EXCLUDEFILES);
foreach (const QString& excludeFile, excludedFilesList) {
QString p = QDir::fromNativeSeparators(excludeFile);
excludedFiles.insert(p);
}
+ Generator::debugSegfault("Reading headerdirs");
headerList = config.getAllFiles(CONFIG_HEADERS,CONFIG_HEADERDIRS,excludedDirs,excludedFiles);
QMap<QString,QString> headers;
QMultiMap<QString,QString> headerFileNames;
headerFileNames.insert(t,t);
}
+ Generator::debugSegfault("Reading sourcedirs");
sourceList = config.getAllFiles(CONFIG_SOURCES,CONFIG_SOURCEDIRS,excludedDirs,excludedFiles);
QMap<QString,QString> sources;
QMultiMap<QString,QString> sourceFileNames;
Find all the qdoc files in the example dirs, and add
them to the source files to be parsed.
*/
+ Generator::debugSegfault("Reading exampledirs");
QStringList exampleQdocList = config.getExampleQdocFiles(excludedDirs, excludedFiles);
for (int i=0; i<exampleQdocList.size(); ++i) {
if (!sources.contains(exampleQdocList[i])) {
}
}
+ Generator::debugSegfault("Adding doc/image dirs found in exampledirs to imagedirs");
QSet<QString> exampleImageDirs;
QStringList exampleImageList = config.getExampleImageFiles(excludedDirs, excludedFiles);
for (int i=0; i<exampleImageList.size(); ++i) {
*/
QSet<CodeParser *> usedParsers;
+ Generator::debugSegfault("Parsing header files");
int parsed = 0;
QMap<QString,QString>::ConstIterator h = headers.constBegin();
while (h != headers.constEnd()) {
add it to the big tree.
*/
parsed = 0;
+ Generator::debugSegfault("Parsing source files");
QMap<QString,QString>::ConstIterator s = sources.constBegin();
while (s != sources.constEnd()) {
CodeParser *codeParser = CodeParser::parserForSourceFile(s.key());
source files. Resolve all the class names, function names,
targets, URLs, links, and other stuff that needs resolving.
*/
+ Generator::debugSegfault("Resolving stuff prior to generating docs");
qdb->resolveIssues();
/*
documentation output. More than one output format can be
requested. The tree is traversed for each one.
*/
+ Generator::debugSegfault("Generating docs");
QSet<QString>::ConstIterator of = outputFormats.constBegin();
while (of != outputFormats.constEnd()) {
Generator* generator = Generator::generatorForFormat(*of);
//Generator::writeOutFileNames();
+ Generator::debugSegfault("Shutting down qdoc");
QDocDatabase::qdocDB()->setVersion(QString());
Generator::terminate();
#ifdef DEBUG_SHUTDOWN_CRASH
qDebug() << "main(): qdoc database deleted";
#endif
+ Generator::debugSegfault("qdoc finished!");
}
QT_END_NAMESPACE
Config::overrideOutputFormats.insert(argv[i]);
i++;
}
+ else if (opt == "-debug") {
+ Generator::setDebugSegfaultFlag(true);
+ }
else {
qdocFiles.append(opt);
}