summaryrefslogtreecommitdiffstats
path: root/src/tools
diff options
context:
space:
mode:
authorPierre Rossi <pierre.rossi@digia.com>2012-09-25 14:35:12 +0200
committerThe Qt Project <gerrit-noreply@qt-project.org>2012-09-28 07:32:55 +0200
commita1521579983860f4f7b02d6eddc478448715ac0b (patch)
tree7e32adda9392b5511f8f3dca9ddd662944b72d1a /src/tools
parente47faabe238d856ff6c1454a7fc9483461206b37 (diff)
QDoc: remove the experimental basedir variable
It was introduced in the early days of the docs' modularization and appears not to be used anywhere anymore. Change-Id: I5b0c60d92828624af2129153fce96ad01aec861c Reviewed-by: Martin Smith <martin.smith@digia.com>
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qdoc/codeparser.cpp49
-rw-r--r--src/tools/qdoc/codeparser.h2
-rw-r--r--src/tools/qdoc/cppcodeparser.cpp2
-rw-r--r--src/tools/qdoc/ditaxmlgenerator.cpp18
-rw-r--r--src/tools/qdoc/doc/qdoc-manual.qdoc35
-rw-r--r--src/tools/qdoc/generator.cpp7
-rw-r--r--src/tools/qdoc/generator.h2
-rw-r--r--src/tools/qdoc/htmlgenerator.cpp31
-rw-r--r--src/tools/qdoc/puredocparser.cpp1
-rw-r--r--src/tools/qdoc/qmlcodeparser.cpp1
10 files changed, 1 insertions, 147 deletions
diff --git a/src/tools/qdoc/codeparser.cpp b/src/tools/qdoc/codeparser.cpp
index 6bd13f3d7b..6ecca78a70 100644
--- a/src/tools/qdoc/codeparser.cpp
+++ b/src/tools/qdoc/codeparser.cpp
@@ -364,55 +364,6 @@ void CodeParser::setLink(Node* node, Node::LinkType linkType, const QString& arg
}
/*!
- If the \e {basedir} variable is not set in the qdocconf
- file, do nothing.
-
- Otherwise, search for the basedir string string in the
- \a filePath. It must be found, or else a warning message
- is output. Extract the subdirectory name that follows the
- basedir name and create a subdirectory using that name
- in the output director.
- */
-void CodeParser::createOutputSubdirectory(const Location& location,
- const QString& filePath)
-{
- QString bd = Generator::baseDir();
- if (!bd.isEmpty()) {
- int baseIdx = filePath.indexOf(bd);
- if (baseIdx == -1)
- location.warning(tr("File path: '%1' does not contain bundle base dir: '%2'")
- .arg(filePath).arg(bd));
- else {
- int subDirIdx = filePath.indexOf(QLatin1Char('/'),baseIdx);
- if (subDirIdx == -1)
- location.warning(tr("File path: '%1' has no sub dir after bundle base dir: '%2'")
- .arg(filePath).arg(bd));
- else {
- ++subDirIdx;
- int fileNameIdx = filePath.indexOf(QLatin1Char('/'),subDirIdx);
- if (fileNameIdx == -1)
- location.warning(tr("File path: '%1' has no file name after sub dir: '%2/'")
- .arg(filePath).arg(filePath.mid(subDirIdx)));
- else {
- currentSubDir_ = filePath.mid(subDirIdx,fileNameIdx-subDirIdx);
- if (currentSubDir_.isEmpty())
- location.warning(tr("File path: '%1' has no sub dir after bundle base dir: '%2'")
- .arg(filePath).arg(bd));
- else {
- QString subDirPath = Generator::outputDir() + QLatin1Char('/') + currentSubDir_;
- QDir dirInfo;
- if (!dirInfo.exists(subDirPath)) {
- if (!dirInfo.mkpath(subDirPath))
- location.fatal(tr("Cannot create output sub-directory '%1'").arg(currentSubDir_));
- }
- }
- }
- }
- }
- }
-}
-
-/*!
Returns true if the file being parsed is a .h file.
*/
bool CodeParser::isParsingH() const
diff --git a/src/tools/qdoc/codeparser.h b/src/tools/qdoc/codeparser.h
index fa309666a5..3d6bf89070 100644
--- a/src/tools/qdoc/codeparser.h
+++ b/src/tools/qdoc/codeparser.h
@@ -73,8 +73,6 @@ public:
bool isParsingQdoc() const;
const QString& currentFile() const { return currentFile_; }
- void createOutputSubdirectory(const Location& location, const QString& filePath);
-
static void initialize(const Config& config);
static void terminate();
static CodeParser *parserForLanguage(const QString& language);
diff --git a/src/tools/qdoc/cppcodeparser.cpp b/src/tools/qdoc/cppcodeparser.cpp
index de7b833ff7..d4fe0ff5f7 100644
--- a/src/tools/qdoc/cppcodeparser.cpp
+++ b/src/tools/qdoc/cppcodeparser.cpp
@@ -166,7 +166,6 @@ void CppCodeParser::parseHeaderFile(const Location& location, const QString& fil
currentFile_.clear();
return;
}
- createOutputSubdirectory(location, filePath);
reset();
Location fileLocation(filePath);
@@ -199,7 +198,6 @@ void CppCodeParser::parseSourceFile(const Location& location, const QString& fil
currentFile_.clear();
return;
}
- createOutputSubdirectory(location, filePath);
reset();
Location fileLocation(filePath);
diff --git a/src/tools/qdoc/ditaxmlgenerator.cpp b/src/tools/qdoc/ditaxmlgenerator.cpp
index bfd834845a..5211b276eb 100644
--- a/src/tools/qdoc/ditaxmlgenerator.cpp
+++ b/src/tools/qdoc/ditaxmlgenerator.cpp
@@ -1274,8 +1274,6 @@ int DitaXmlGenerator::generateAtom(const Atom *atom,
if (fileName.isEmpty()) {
relative->location().warning(tr("Missing image: %1").arg(protectEnc(atom->string())));
QString images = "images";
- if (!baseDir().isEmpty())
- images.prepend("../");
if (!atom->string().isEmpty() && atom->string()[0] != '/')
images.append(QLatin1Char('/'));
fileName = images + atom->string();
@@ -3925,22 +3923,6 @@ QString DitaXmlGenerator::getLink(const Atom* atom, const Node* relative, const
link += QLatin1Char('#') + (*node)->guid();
}
}
- /*
- If the output is going to subdirectories, then if the
- two nodes will be output to different directories, then
- the link must go up to the parent directory and then
- back down into the other subdirectory.
- */
- if (!baseDir().isEmpty()) {
- if (link.startsWith("images/")) {
- link.prepend(QString("../"));
- }
- else if (*node && relative && (*node != relative)) {
- if ((*node)->outputSubdirectory() != relative->outputSubdirectory()) {
- link.prepend(QString("../" + (*node)->outputSubdirectory() + QLatin1Char('/')));
- }
- }
- }
}
if (!link.isEmpty() && link[0] == '#') {
link.prepend(outFileName());
diff --git a/src/tools/qdoc/doc/qdoc-manual.qdoc b/src/tools/qdoc/doc/qdoc-manual.qdoc
index 5aadc4727f..349aae61de 100644
--- a/src/tools/qdoc/doc/qdoc-manual.qdoc
+++ b/src/tools/qdoc/doc/qdoc-manual.qdoc
@@ -7198,7 +7198,6 @@
\li \l {22-qdoc-configuration-generalvariables.html#alias-variable} {alias}
\li \l {23-qdoc-configuration-cppvariables.html#Cpp.ignoredirectives-variable} {Cpp.ignoredirectives}
\li \l {23-qdoc-configuration-cppvariables.html#Cpp.ignoretokens-variable} {Cpp.ignoretokens}
- \li \l {22-qdoc-configuration-generalvariables.html#basedir-variable} {basedir} \span {class="newStuff"} {(experimental)}
\li \l {22-qdoc-configuration-generalvariables.html#defines-variable} {defines}
\li \l {22-qdoc-configuration-generalvariables.html#edition-variable} {edition}
\li \l {22-qdoc-configuration-generalvariables.html#exampledirs-variable} {exampledirs}
@@ -7371,40 +7370,6 @@
to adjust the appearance of certain types of HTML elements, this
level of indentation is not always required.
- \target basedir-variable
- \section1 basedir
-
- The \c basedir variable tells QDoc two things. First, the fact that
- it is set it tells QDoc to the put the output files in subdirectories
- of the output directory. Second, the value of basedir is the name of
- the bundle directory for your project. .e.g. if you are working with
- the Qt5 bundle, you will have checked out the bundle into some root
- subdirectory (the base directory), and that root directory might
- very well be \e {qt5}
-
- Then in your qdocconf file, you would assign to the basedir variable:
-
- \code
- basedir = qt5
- \endcode
-
- Now, QDoc knows to scan the file path of each source file it parses,
- looking for \e qt5. For example, this file would be:
-
- \code
- ~/depot/qt5/qtdoc/tools/qdoc/doc/qdoc-manual.qdoc
- \endcode
-
- QDoc scans the path for the basedir \e{qt5} and the next subdirectory
- \e{qtdoc} becomes one of the subdirectories in the output directory.
- The HTML output file created from this file will be stored in the
- \e{qtdoc} subdirectory.
-
- \note This is an experimental command. It is currently used only by
- the Qt documentation group. If you use it, be advised that you might
- find some broken links in your HTML output due to remaining problems
- with cross-subdirectory linking.
-
\target defines-variable
\section1 defines
diff --git a/src/tools/qdoc/generator.cpp b/src/tools/qdoc/generator.cpp
index 75d6629990..d40fec81f4 100644
--- a/src/tools/qdoc/generator.cpp
+++ b/src/tools/qdoc/generator.cpp
@@ -58,7 +58,6 @@
QT_BEGIN_NAMESPACE
-QString Generator::baseDir_;
Generator* Generator::currentGenerator_;
QStringList Generator::exampleDirs;
QStringList Generator::exampleImgExts;
@@ -1453,11 +1452,7 @@ void Generator::initialize(const Config &config)
outputFormats = config.getOutputFormats();
if (!outputFormats.isEmpty()) {
outDir_ = config.getOutputDir();
- baseDir_ = config.getString(CONFIG_BASEDIR);
- if (!baseDir_.isEmpty())
- config.location().warning(tr("\"basedir\" specified in config file. "
- "All output will be in module directories "
- "of the output directory"));
+
if (outDir_.isEmpty())
config.lastLocation().fatal(tr("No output directory specified in "
"configuration file or on the command line"));
diff --git a/src/tools/qdoc/generator.h b/src/tools/qdoc/generator.h
index 474fb4367c..1b25dc48cd 100644
--- a/src/tools/qdoc/generator.h
+++ b/src/tools/qdoc/generator.h
@@ -79,7 +79,6 @@ public:
QString fullDocumentLocation(const Node *node, bool subdir = false);
- static const QString& baseDir() { return baseDir_; }
static Generator *currentGenerator() { return currentGenerator_; }
static Generator *generatorForFormat(const QString& format);
static void initialize(const Config& config);
@@ -170,7 +169,6 @@ protected:
QStack<QTextStream*> outStreamStack;
private:
- static QString baseDir_;
static Generator* currentGenerator_;
static QStringList exampleDirs;
static QStringList exampleImgExts;
diff --git a/src/tools/qdoc/htmlgenerator.cpp b/src/tools/qdoc/htmlgenerator.cpp
index 8fe941bda7..cb4bebb67a 100644
--- a/src/tools/qdoc/htmlgenerator.cpp
+++ b/src/tools/qdoc/htmlgenerator.cpp
@@ -222,19 +222,6 @@ void HtmlGenerator::initializeGenerator(const Config &config)
manifestDir = "qthelp://" + config.getString(prefix + "namespace");
manifestDir += QLatin1Char('/') + config.getString(prefix + "virtualFolder") + QLatin1Char('/');
- /*
- If the output files will be in subdirectores in the output
- directory, change the references to files in the style and
- scripts subdirectories that appear in the headerscipts and
- headerstyles string so that they link to the correct files,
- whic means prepending "../" to each
- */
- if (!baseDir().isEmpty()) {
- headerScripts = headerScripts.replace("style/","../style/");
- headerScripts = headerScripts.replace("scripts/","../scripts/");
- headerStyles = headerStyles.replace("style/","../style/");
- headerStyles = headerStyles.replace("scripts/","../scripts/");
- }
}
/*!
@@ -746,8 +733,6 @@ int HtmlGenerator::generateAtom(const Atom *atom, const Node *relative, CodeMark
}
else {
QString prefix;
- if (!baseDir().isEmpty())
- prefix = "../";
out() << "<img src=\"" << protectEnc(prefix + fileName) << '"';
if (!text.isEmpty())
out() << " alt=\"" << protectEnc(text) << '"';
@@ -3624,22 +3609,6 @@ QString HtmlGenerator::getLink(const Atom *atom, const Node *relative, const Nod
if (targetAtom)
link += QLatin1Char('#') + refForAtom(targetAtom, *node);
}
- /*
- If the output is going to subdirectories, then if the
- two nodes will be output to different directories, then
- the link must go up to the parent directory and then
- back down into the other subdirectory.
- */
- if (!baseDir().isEmpty()) {
- if (link.startsWith("images/")) {
- link.prepend(QString("../"));
- }
- else if (*node && relative && (*node != relative)) {
- if ((*node)->outputSubdirectory() != relative->outputSubdirectory()) {
- link.prepend(QString("../" + (*node)->outputSubdirectory() + QLatin1Char('/')));
- }
- }
- }
}
return link;
}
diff --git a/src/tools/qdoc/puredocparser.cpp b/src/tools/qdoc/puredocparser.cpp
index 53001cebe2..cd726c3497 100644
--- a/src/tools/qdoc/puredocparser.cpp
+++ b/src/tools/qdoc/puredocparser.cpp
@@ -93,7 +93,6 @@ void PureDocParser::parseSourceFile(const Location& location, const QString& fil
currentFile_.clear();
return;
}
- createOutputSubdirectory(location, filePath);
reset();
Location fileLocation(filePath);
diff --git a/src/tools/qdoc/qmlcodeparser.cpp b/src/tools/qdoc/qmlcodeparser.cpp
index e1428f9052..64af6d6c36 100644
--- a/src/tools/qdoc/qmlcodeparser.cpp
+++ b/src/tools/qdoc/qmlcodeparser.cpp
@@ -153,7 +153,6 @@ void QmlCodeParser::parseSourceFile(const Location& location, const QString& fil
currentFile_.clear();
return;
}
- createOutputSubdirectory(location, filePath);
QString document = in.readAll();
in.close();