diff options
author | Geir Vattekar <geir.vattekar@nokia.com> | 2011-03-29 10:05:19 (GMT) |
---|---|---|
committer | Geir Vattekar <geir.vattekar@nokia.com> | 2011-03-29 10:05:19 (GMT) |
commit | 5466b2eae16f55602b01021acb3e9e93184d44fa (patch) | |
tree | 114df02bdb14be512c6456bff8ed5c7c41bc81f1 /tools | |
parent | 121e0a53302ac4e650b5ba414123d0706812ec5c (diff) | |
parent | eaab529d00ce6bd65ca44a4ae4edbf4128b844a6 (diff) | |
download | Qt-5466b2eae16f55602b01021acb3e9e93184d44fa.zip Qt-5466b2eae16f55602b01021acb3e9e93184d44fa.tar.gz Qt-5466b2eae16f55602b01021acb3e9e93184d44fa.tar.bz2 |
Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-doc-team into 4.7
Diffstat (limited to 'tools')
-rw-r--r-- | tools/linguist/lconvert/main.cpp | 2 | ||||
-rw-r--r-- | tools/linguist/lupdate/main.cpp | 71 | ||||
-rw-r--r-- | tools/qdoc3/doc/qdoc-manual.qdoc | 91 | ||||
-rw-r--r-- | tools/qdoc3/main.cpp | 20 |
4 files changed, 97 insertions, 87 deletions
diff --git a/tools/linguist/lconvert/main.cpp b/tools/linguist/lconvert/main.cpp index a10a42b..a9960fc 100644 --- a/tools/linguist/lconvert/main.cpp +++ b/tools/linguist/lconvert/main.cpp @@ -65,7 +65,7 @@ static int usage(const QStringList &args) foreach (Translator::FileFormat format, Translator::registeredFileFormats()) loaders += line.arg(format.extension, -5).arg(format.description); - std::cerr << qPrintable(LC::tr("\nUsage:\n" + std::cout << qPrintable(LC::tr("\nUsage:\n" " lconvert [options] <infile> [<infile>...]\n\n" "lconvert is part of Qt's Linguist tool chain. It can be used as a\n" "stand-alone tool to convert and filter translation data files.\n" diff --git a/tools/linguist/lupdate/main.cpp b/tools/linguist/lupdate/main.cpp index 15583e1..f8e6a90 100644 --- a/tools/linguist/lupdate/main.cpp +++ b/tools/linguist/lupdate/main.cpp @@ -61,6 +61,11 @@ static QString m_defaultExtensions; static void printOut(const QString & out) { + std::cout << qPrintable(out); +} + +static void printErr(const QString & out) +{ std::cerr << qPrintable(out); } @@ -151,23 +156,23 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil cd.m_sortContexts = !(options & NoSort); if (QFile(fileName).exists()) { if (!tor.load(fileName, cd, QLatin1String("auto"))) { - printOut(cd.error()); + printErr(cd.error()); *fail = true; continue; } tor.resolveDuplicates(); cd.clearErrors(); if (setCodec && fetchedTor.codec() != tor.codec()) - printOut(LU::tr("lupdate warning: Codec for tr() '%1' disagrees with" + printErr(LU::tr("lupdate warning: Codec for tr() '%1' disagrees with" " existing file's codec '%2'. Expect trouble.\n") .arg(QString::fromLatin1(fetchedTor.codecName()), QString::fromLatin1(tor.codecName()))); if (!targetLanguage.isEmpty() && targetLanguage != tor.languageCode()) - printOut(LU::tr("lupdate warning: Specified target language '%1' disagrees with" + printErr(LU::tr("lupdate warning: Specified target language '%1' disagrees with" " existing file's language '%2'. Ignoring.\n") .arg(targetLanguage, tor.languageCode())); if (!sourceLanguage.isEmpty() && sourceLanguage != tor.sourceLanguageCode()) - printOut(LU::tr("lupdate warning: Specified source language '%1' disagrees with" + printErr(LU::tr("lupdate warning: Specified source language '%1' disagrees with" " existing file's language '%2'. Ignoring.\n") .arg(sourceLanguage, tor.sourceLanguageCode())); } else { @@ -212,11 +217,11 @@ static void updateTsFiles(const Translator &fetchedTor, const QStringList &tsFil out.normalizeTranslations(cd); if (!cd.errors().isEmpty()) { - printOut(cd.error()); + printErr(cd.error()); cd.clearErrors(); } if (!out.save(fileName, cd, QLatin1String("auto"))) { - printOut(cd.error()); + printErr(cd.error()); *fail = true; } } @@ -278,7 +283,7 @@ static void processSources(Translator &fetchedTor, } loadCPP(fetchedTor, sourceFilesCpp, cd); if (!cd.error().isEmpty()) - printOut(cd.error()); + printErr(cd.error()); } static void processProjects( @@ -298,7 +303,7 @@ static void processProject( if (!tmp.isEmpty()) { codecForSource = tmp.last().toLatin1(); if (!QTextCodec::codecForName(codecForSource)) { - printOut(LU::tr("lupdate warning: Codec for source '%1' is invalid." + printErr(LU::tr("lupdate warning: Codec for source '%1' is invalid." " Falling back to codec for tr().\n") .arg(QString::fromLatin1(codecForSource))); codecForSource.clear(); @@ -365,12 +370,12 @@ static void processProjects( if (visitor.contains(QLatin1String("TRANSLATIONS"))) { if (parentTor) { if (topLevel) { - std::cerr << qPrintable(LU::tr("lupdate warning: TS files from command line " - "will override TRANSLATIONS in %1.\n").arg(proFile)); + printErr(LU::tr("lupdate warning: TS files from command line " + "will override TRANSLATIONS in %1.\n").arg(proFile)); goto noTrans; } else if (nestComplain) { - std::cerr << qPrintable(LU::tr("lupdate warning: TS files from command line " - "prevent recursing into %1.\n").arg(proFile)); + printErr(LU::tr("lupdate warning: TS files from command line " + "prevent recursing into %1.\n").arg(proFile)); continue; } } @@ -401,8 +406,8 @@ static void processProjects( noTrans: if (!parentTor) { if (topLevel) - std::cerr << qPrintable(LU::tr("lupdate warning: no TS files specified. Only diagnostics " - "will be produced for '%1'.\n").arg(proFile)); + printErr(LU::tr("lupdate warning: no TS files specified. Only diagnostics " + "will be produced for '%1'.\n").arg(proFile)); Translator tor; processProject(nestComplain, pfi, visitor, options, codecForSource, targetLanguage, sourceLanguage, &tor, fail); @@ -471,7 +476,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-target-language")) { ++i; if (i == argc) { - printOut(LU::tr("The option -target-language requires a parameter.\n")); + printErr(LU::tr("The option -target-language requires a parameter.\n")); return 1; } targetLanguage = args[i]; @@ -479,7 +484,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-source-language")) { ++i; if (i == argc) { - printOut(LU::tr("The option -source-language requires a parameter.\n")); + printErr(LU::tr("The option -source-language requires a parameter.\n")); return 1; } sourceLanguage = args[i]; @@ -487,7 +492,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-disable-heuristic")) { ++i; if (i == argc) { - printOut(LU::tr("The option -disable-heuristic requires a parameter.\n")); + printErr(LU::tr("The option -disable-heuristic requires a parameter.\n")); return 1; } arg = args[i]; @@ -498,14 +503,14 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("number")) { options &= ~HeuristicNumber; } else { - printOut(LU::tr("Invalid heuristic name passed to -disable-heuristic.\n")); + printErr(LU::tr("Invalid heuristic name passed to -disable-heuristic.\n")); return 1; } continue; } else if (arg == QLatin1String("-locations")) { ++i; if (i == argc) { - printOut(LU::tr("The option -locations requires a parameter.\n")); + printErr(LU::tr("The option -locations requires a parameter.\n")); return 1; } if (args[i] == QLatin1String("none")) { @@ -515,7 +520,7 @@ int main(int argc, char **argv) } else if (args[i] == QLatin1String("absolute")) { options |= AbsoluteLocations; } else { - printOut(LU::tr("Invalid parameter passed to -locations.\n")); + printErr(LU::tr("Invalid parameter passed to -locations.\n")); return 1; } continue; @@ -541,7 +546,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-codecfortr")) { ++i; if (i == argc) { - printOut(LU::tr("The -codecfortr option should be followed by a codec name.\n")); + printErr(LU::tr("The -codecfortr option should be followed by a codec name.\n")); return 1; } codecForTr = args[i].toLatin1(); @@ -552,7 +557,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-extensions")) { ++i; if (i == argc) { - printOut(LU::tr("The -extensions option should be followed by an extension list.\n")); + printErr(LU::tr("The -extensions option should be followed by an extension list.\n")); return 1; } extensions = args[i]; @@ -560,7 +565,7 @@ int main(int argc, char **argv) } else if (arg == QLatin1String("-pro")) { ++i; if (i == argc) { - printOut(LU::tr("The -pro option should be followed by a filename of .pro file.\n")); + printErr(LU::tr("The -pro option should be followed by a filename of .pro file.\n")); return 1; } proFiles += args[i]; @@ -570,7 +575,7 @@ int main(int argc, char **argv) if (arg.length() == 2) { ++i; if (i == argc) { - printOut(LU::tr("The -I option should be followed by a path.\n")); + printErr(LU::tr("The -I option should be followed by a path.\n")); return 1; } includePath += args[i]; @@ -579,7 +584,7 @@ int main(int argc, char **argv) } continue; } else if (arg.startsWith(QLatin1String("-")) && arg != QLatin1String("-")) { - printOut(LU::tr("Unrecognized option '%1'.\n").arg(arg)); + printErr(LU::tr("Unrecognized option '%1'.\n").arg(arg)); return 1; } @@ -587,7 +592,7 @@ int main(int argc, char **argv) if (arg.startsWith(QLatin1String("@"))) { QFile lstFile(arg.mid(1)); if (!lstFile.open(QIODevice::ReadOnly)) { - printOut(LU::tr("lupdate error: List file '%1' is not readable.\n") + printErr(LU::tr("lupdate error: List file '%1' is not readable.\n") .arg(lstFile.fileName())); return 1; } @@ -605,7 +610,7 @@ int main(int argc, char **argv) if (!fi.exists() || fi.isWritable()) { tsFileNames.append(QFileInfo(file).absoluteFilePath()); } else { - printOut(LU::tr("lupdate warning: For some reason, '%1' is not writable.\n") + printErr(LU::tr("lupdate warning: For some reason, '%1' is not writable.\n") .arg(file)); } found = true; @@ -613,7 +618,7 @@ int main(int argc, char **argv) } } if (!found) { - printOut(LU::tr("lupdate error: File '%1' has no recognized extension.\n") + printErr(LU::tr("lupdate error: File '%1' has no recognized extension.\n") .arg(file)); return 1; } @@ -623,7 +628,7 @@ int main(int argc, char **argv) foreach (const QString &file, files) { QFileInfo fi(file); if (!fi.exists()) { - printOut(LU::tr("lupdate error: File '%1' does not exist.\n").arg(file)); + printErr(LU::tr("lupdate error: File '%1' does not exist.\n").arg(file)); return 1; } if (file.endsWith(QLatin1String(".pro"), Qt::CaseInsensitive) @@ -682,15 +687,15 @@ int main(int argc, char **argv) } if (!targetLanguage.isEmpty() && tsFileNames.count() != 1) - printOut(LU::tr("lupdate warning: -target-language usually only" + printErr(LU::tr("lupdate warning: -target-language usually only" " makes sense with exactly one TS file.\n")); if (!codecForTr.isEmpty() && tsFileNames.isEmpty()) - printOut(LU::tr("lupdate warning: -codecfortr has no effect without -ts.\n")); + printErr(LU::tr("lupdate warning: -codecfortr has no effect without -ts.\n")); bool fail = false; if (proFiles.isEmpty()) { if (tsFileNames.isEmpty()) - printOut(LU::tr("lupdate warning:" + printErr(LU::tr("lupdate warning:" " no TS files specified. Only diagnostics will be produced.\n")); Translator fetchedTor; @@ -705,7 +710,7 @@ int main(int argc, char **argv) sourceLanguage, targetLanguage, options, &fail); } else { if (!sourceFiles.isEmpty() || !includePath.isEmpty()) { - printOut(LU::tr("lupdate error:" + printErr(LU::tr("lupdate error:" " Both project and source files / include paths specified.\n")); return 1; } diff --git a/tools/qdoc3/doc/qdoc-manual.qdoc b/tools/qdoc3/doc/qdoc-manual.qdoc index 712dcea..0fbd4b7 100644 --- a/tools/qdoc3/doc/qdoc-manual.qdoc +++ b/tools/qdoc3/doc/qdoc-manual.qdoc @@ -141,13 +141,16 @@ \c {/current/dir$ ../../bin/qdoc3 ./config.qdocconf} \endquotation - \c{config.qdocconf} is your \l{The QDoc Configuration File} {QDoc - configuration file}. The configuration file is where tell QDoc - where to find the source files from which it will extract the QDoc - comments it will use to generate the documentation. It is also - where you tell QDoc what kind of output to generate (HTML, DITA - XML,...), and where to put the generated output. The configuration - file also contains other information for QDoc. + In the command line above, \c{config.qdocconf} is a \l{The QDoc + Configuration File} {QDoc configuration file}. The configuration + file is where you tell QDoc where to find the source files that + contain the QDoc comments that will become the documentation. It + is also where you tell QDoc what kind of output to generate (HTML, + DITA XML,...), and where to put the generated output. The + configuration file also contains other information for QDoc. + + See \l{The QDoc Configuration File} for a instructions on how ro + build a Qdoc configuration file. \section1 Command Types @@ -6740,59 +6743,41 @@ \title The QDoc Configuration File - Before running QDoc to to extract and format your QDOC comments, - you must create a QDoc configuration file to tell QDoc where to find - them. + Before running QDoc, you must create a QDoc configuration file to + tell QDoc where to find the source files that contain the QDoc + comments. The pathname to your configuration file is passed to + QDoc on the command line: - \list - \o \l {Supporting Derived Projects} - \o \l {Compatibility Issues} - \endlist - - When running QDoc to generate the documentation, you must specify - a configuration file on the command line: + \quotation + \c {/current/dir$ ../../bin/qdoc3 ./config.qdocconf} + \endquotation \section1 General Description - The configuration file is a list of entries of entries of the form - \e {"variable = value"}. Using the configuration variables, you - can define where QDoc should find the various source files, images - and examples, where to put generated documentation etc. The + The configuration file is a list of entries of the form \e + {"variable = value"}. Using the configuration variables, you can + define where QDoc should find the various source files, images and + examples, where to put generated documentation etc. The configuration file can also contain directives like \c include. For an example, see the \l minimum.qdocconf file. - In addition, you can use some particular configuration variables - to make QDoc support derived projects, i.e make the projects, for - example Qt Solutions, contain links to the online Qt - documentation. These variables are documented in the \l - {Supporting Derived projects} section. In this section you can - also find out how to use these variables to support your derived - projects. - - If some of the variable keys have the same values, they can be set - at the same time. - - \code - {header, source}dirs = kernel - \endcode - - is equivalent to - - \code - headerdirs = kernel - sourcedirs = kernel - \endcode - - A variable's value can be set using either '=' or '+='. The - difference is that '=' overrides any previously set value, while - '+=' only adds the value to the previously set ones. - - In general, some of the variables accepts a list of strings as - their value, while others only accept a single string. If you - provide a variable of the latter type with several strings they - will simply be concatenated. The quotes around the value string - are optional. But applying them allows you to use special - characters like '=' and ' \" ' within the string. + You can also use configuration variables to get QDoc to support + \l{Supporting Derived Projects} {derived projects}, i.e QDoc can + generate links in your project's documentation to elements in the + Qt online documentation. See the \l {Supporting Derived projects} + section. + + The value of a configuration variable can be set using either '=' + or '+='. The difference is that '=' overrides the previous value, + while '+=' adds a new value to the current one. + + Some configuration variables accept a list of strings as their + value, e.g. + \l {22-qdoc-configuration-generalvariables.html#sourcedirs-variable} + {\c{sourcedirs}}, while others accept only a single string. Double + quotes around a value string are optional, but including them allows + you to use special characters like '=' and ' \" ' within the valuem + string, e.g.: \code HTML.postheader = "<a href=\"index.html\">Home</a>" diff --git a/tools/qdoc3/main.cpp b/tools/qdoc3/main.cpp index 7eb8067..52715a3 100644 --- a/tools/qdoc3/main.cpp +++ b/tools/qdoc3/main.cpp @@ -235,6 +235,26 @@ static void processQdocconfFile(const QString &fileName) QStringList indexFiles = config.getStringList(CONFIG_INDEXES); tree->readIndexes(indexFiles); +#if 0 + /* + I think we won't beusing this... + + Read the list of DITA excluded directories. + */ + QSet<QString> ditaExcludedDirs; + QStringList ditaExcludedDirsList = config.getStringList("dita.metadata.excludedirs"); + foreach (const QString &t, ditaExcludedDirsList) + ditaExcludedDirs.insert(QDir::fromNativeSeparators(t)); + + if (!ditaExcludedDirs.isEmpty()) { + QSet<QString>::iterator i = ditaExcludedDirs.begin(); + while (i != ditaExcludedDirs.end()) { + qDebug() << "DITA EXCLUDED DIR:" << (*i); + ++i; + } + } +#endif + /* Read the list of excluded directories. */ |