summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPaul Wicking <paul.wicking@qt.io>2020-09-10 16:05:53 +0200
committerPaul Wicking <paul.wicking@qt.io>2020-09-11 13:04:10 +0200
commit14024df36e7a26b79aa2b0edf82c9b29d9eb0185 (patch)
tree8fe4061e0098b043371a8f54a5c21f3e5486351b
parent93e805a02417290f225810ce7c9263b2fe56b4e5 (diff)
QDoc: Drop ditaref remains
Most of the dita code is removed, get rid of the last few bits and the header that is no longer used. [ChangeLog][qdoc] The obsolete \ditamap has been removed. Task-number: QTBUG-71176 Fixes: QTBUG-86560 Change-Id: I7c65cc8a74d4caeabdc98d6852026f54a3c32dda Reviewed-by: Topi Reiniƶ <topi.reinio@qt.io>
-rw-r--r--src/qdoc/.prev_CMakeLists.txt1
-rw-r--r--src/qdoc/CMakeLists.txt1
-rw-r--r--src/qdoc/codeparser.h1
-rw-r--r--src/qdoc/cppcodeparser.cpp10
-rw-r--r--src/qdoc/ditaref.h83
-rw-r--r--src/qdoc/doc.h1
-rw-r--r--src/qdoc/doc/qdoc-manual-markupcmds.qdoc2
-rw-r--r--src/qdoc/docparser.cpp40
-rw-r--r--src/qdoc/docparser.h1
-rw-r--r--src/qdoc/docprivate.cpp4
-rw-r--r--src/qdoc/docprivate.h1
-rw-r--r--src/qdoc/qdoc.pro1
-rw-r--r--src/qdoc/quoter.cpp3
13 files changed, 9 insertions, 140 deletions
diff --git a/src/qdoc/.prev_CMakeLists.txt b/src/qdoc/.prev_CMakeLists.txt
index e65c0e9a4..5baa6beb9 100644
--- a/src/qdoc/.prev_CMakeLists.txt
+++ b/src/qdoc/.prev_CMakeLists.txt
@@ -20,7 +20,6 @@ qt_add_tool(${target_name}
config.cpp config.h
cppcodemarker.cpp cppcodemarker.h
cppcodeparser.cpp cppcodeparser.h
- ditaref.h
doc.cpp doc.h
docbookgenerator.cpp docbookgenerator.h
docparser.cpp docparser.h
diff --git a/src/qdoc/CMakeLists.txt b/src/qdoc/CMakeLists.txt
index f5904e29b..ffd4e4eb1 100644
--- a/src/qdoc/CMakeLists.txt
+++ b/src/qdoc/CMakeLists.txt
@@ -28,7 +28,6 @@ qt_add_tool(${target_name}
config.cpp config.h
cppcodemarker.cpp cppcodemarker.h
cppcodeparser.cpp cppcodeparser.h
- ditaref.h
doc.cpp doc.h
docbookgenerator.cpp docbookgenerator.h
docparser.cpp docparser.h
diff --git a/src/qdoc/codeparser.h b/src/qdoc/codeparser.h
index b0a566efc..54fd18035 100644
--- a/src/qdoc/codeparser.h
+++ b/src/qdoc/codeparser.h
@@ -95,7 +95,6 @@ private:
#define COMMAND_COPYRYEAR Doc::alias(QLatin1String("copyryear"))
#define COMMAND_DEPRECATED Doc::alias(QLatin1String("deprecated")) // ### don't document
#define COMMAND_DONTDOCUMENT Doc::alias(QLatin1String("dontdocument"))
-#define COMMAND_DITAMAP Doc::alias(QLatin1String("ditamap"))
#define COMMAND_ENUM Doc::alias(QLatin1String("enum"))
#define COMMAND_EXAMPLE Doc::alias(QLatin1String("example"))
#define COMMAND_EXTERNALPAGE Doc::alias(QLatin1String("externalpage"))
diff --git a/src/qdoc/cppcodeparser.cpp b/src/qdoc/cppcodeparser.cpp
index 73936ed36..eb6a86b80 100644
--- a/src/qdoc/cppcodeparser.cpp
+++ b/src/qdoc/cppcodeparser.cpp
@@ -65,10 +65,10 @@ static QSet<QString> metaCommands_;
CppCodeParser::CppCodeParser()
{
if (topicCommands_.isEmpty()) {
- topicCommands_ << COMMAND_CLASS << COMMAND_DITAMAP << COMMAND_DONTDOCUMENT << COMMAND_ENUM
- << COMMAND_EXAMPLE << COMMAND_EXTERNALPAGE << COMMAND_FN << COMMAND_GROUP
- << COMMAND_HEADERFILE << COMMAND_MACRO << COMMAND_MODULE << COMMAND_NAMESPACE
- << COMMAND_PAGE << COMMAND_PROPERTY << COMMAND_TYPEALIAS << COMMAND_TYPEDEF
+ topicCommands_ << COMMAND_CLASS << COMMAND_DONTDOCUMENT << COMMAND_ENUM << COMMAND_EXAMPLE
+ << COMMAND_EXTERNALPAGE << COMMAND_FN << COMMAND_GROUP << COMMAND_HEADERFILE
+ << COMMAND_MACRO << COMMAND_MODULE << COMMAND_NAMESPACE << COMMAND_PAGE
+ << COMMAND_PROPERTY << COMMAND_TYPEALIAS << COMMAND_TYPEDEF
<< COMMAND_VARIABLE << COMMAND_QMLTYPE << COMMAND_QMLPROPERTY
<< COMMAND_QMLPROPERTYGROUP // mws 13/03/2019
<< COMMAND_QMLATTACHEDPROPERTY << COMMAND_QMLSIGNAL
@@ -134,7 +134,7 @@ void CppCodeParser::initializeParser()
if (!exampleFilePatterns.isEmpty())
m_exampleNameFilter = exampleFilePatterns.join(' ');
else
- m_exampleNameFilter = "*.cpp *.h *.js *.xq *.svg *.xml *.dita *.ui";
+ m_exampleNameFilter = "*.cpp *.h *.js *.xq *.svg *.xml *.ui";
QStringList exampleImagePatterns =
config.getStringList(CONFIG_EXAMPLES + Config::dot + CONFIG_IMAGEEXTENSIONS);
diff --git a/src/qdoc/ditaref.h b/src/qdoc/ditaref.h
deleted file mode 100644
index 3f455d38f..000000000
--- a/src/qdoc/ditaref.h
+++ /dev/null
@@ -1,83 +0,0 @@
-/****************************************************************************
-**
-** Copyright (C) 2020 The Qt Company Ltd.
-** Contact: https://www.qt.io/licensing/
-**
-** This file is part of the tools applications of the Qt Toolkit.
-**
-** $QT_BEGIN_LICENSE:GPL-EXCEPT$
-** Commercial License Usage
-** Licensees holding valid commercial Qt licenses may use this file in
-** accordance with the commercial license agreement provided with the
-** Software or, alternatively, in accordance with the terms contained in
-** a written agreement between you and The Qt Company. For licensing terms
-** and conditions see https://www.qt.io/terms-conditions. For further
-** information use the contact form at https://www.qt.io/contact-us.
-**
-** GNU General Public License Usage
-** Alternatively, this file may be used under the terms of the GNU
-** General Public License version 3 as published by the Free Software
-** Foundation with exceptions as appearing in the file LICENSE.GPL3-EXCEPT
-** included in the packaging of this file. Please review the following
-** information to ensure the GNU General Public License requirements will
-** be met: https://www.gnu.org/licenses/gpl-3.0.html.
-**
-** $QT_END_LICENSE$
-**
-****************************************************************************/
-#ifndef DITAREF_H
-#define DITAREF_H
-
-#include "location.h"
-
-#include <QtCore/qmap.h>
-#include <QtCore/qset.h>
-#include <QtCore/qstring.h>
-
-QT_BEGIN_NAMESPACE
-
-class DitaRef
-{
-public:
- DitaRef() = default;
- virtual ~DitaRef() = default;
-
- const QString &navtitle() const { return m_navTitle; }
- const QString &href() const { return m_href; }
- void setNavtitle(const QString &title) { m_navTitle = title; }
- void setHref(const QString &t) { m_href = t; }
- virtual bool isMapRef() const = 0;
- virtual const QList<DitaRef *> *subrefs() const { return nullptr; }
- virtual void appendSubref(DitaRef *) {}
-
-private:
- QString m_navTitle;
- QString m_href;
-};
-
-typedef QList<DitaRef *> DitaRefList;
-
-class TopicRef : public DitaRef
-{
-public:
- TopicRef() = default;
- ~TopicRef() override { qDeleteAll(m_subRefs); };
- bool isMapRef() const override { return false; }
- const QList<DitaRef *> *subrefs() const override { return &m_subRefs; }
- void appendSubref(DitaRef *t) override { m_subRefs.append(t); }
-
-private:
- DitaRefList m_subRefs;
-};
-
-class MapRef : public DitaRef
-{
-public:
- MapRef() {}
-
- bool isMapRef() const override { return true; }
-};
-
-QT_END_NAMESPACE
-
-#endif // DITAREF_H
diff --git a/src/qdoc/doc.h b/src/qdoc/doc.h
index 1f2643bf8..55153b7e6 100644
--- a/src/qdoc/doc.h
+++ b/src/qdoc/doc.h
@@ -35,7 +35,6 @@
#include "location.h"
-#include "ditaref.h"
#include "docutilities.h"
#include "topic.h"
diff --git a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc
index dedea4d5b..d5f1aab2b 100644
--- a/src/qdoc/doc/qdoc-manual-markupcmds.qdoc
+++ b/src/qdoc/doc/qdoc-manual-markupcmds.qdoc
@@ -1702,7 +1702,7 @@
By default, QDoc looks for \c{//!} as a code snippet marker.
For \c{.pro}, \c{.py}, \c{.cmake}, and \c{CMakeLists.txt}
files, \c {#!} is detected. Finally, \c{<!--} is accepted in
- \c{.html}, \c{.qrc}, \c{.ui}, \c{.xml}, \c{.dita}, and \c{.xq} files.
+ \c{.html}, \c{.qrc}, \c{.ui}, \c{.xml}, and \c{.xq} files.
\target codeline-command
\section1 \\codeline
diff --git a/src/qdoc/docparser.cpp b/src/qdoc/docparser.cpp
index 9fd1c7b4a..e6424a2d1 100644
--- a/src/qdoc/docparser.cpp
+++ b/src/qdoc/docparser.cpp
@@ -79,7 +79,6 @@ enum {
CMD_ENDSECTION4,
CMD_ENDSIDEBAR,
CMD_ENDTABLE,
- CMD_ENDTOPICREF,
CMD_FOOTNOTE,
CMD_GENERATELIST,
CMD_GRANULARITY,
@@ -99,7 +98,6 @@ enum {
CMD_LI,
CMD_LINK,
CMD_LIST,
- CMD_MAPREF,
CMD_META,
CMD_NEWCODE,
CMD_NOTE,
@@ -134,7 +132,6 @@ enum {
CMD_TABLE,
CMD_TABLEOFCONTENTS,
CMD_TARGET,
- CMD_TOPICREF,
CMD_TT,
CMD_UICONTROL,
CMD_UNDERLINE,
@@ -191,7 +188,6 @@ static struct
{ "endsection4", CMD_ENDSECTION4, nullptr }, // ### don't document for now
{ "endsidebar", CMD_ENDSIDEBAR, nullptr },
{ "endtable", CMD_ENDTABLE, nullptr },
- { "endtopicref", CMD_ENDTOPICREF, nullptr },
{ "footnote", CMD_FOOTNOTE, nullptr },
{ "generatelist", CMD_GENERATELIST, nullptr },
{ "granularity", CMD_GRANULARITY, nullptr }, // ### don't document for now
@@ -211,7 +207,6 @@ static struct
{ "li", CMD_LI, nullptr },
{ "link", CMD_LINK, nullptr },
{ "list", CMD_LIST, nullptr },
- { "mapref", CMD_MAPREF, nullptr },
{ "meta", CMD_META, nullptr },
{ "newcode", CMD_NEWCODE, nullptr },
{ "note", CMD_NOTE, nullptr },
@@ -246,7 +241,6 @@ static struct
{ "table", CMD_TABLE, nullptr },
{ "tableofcontents", CMD_TABLEOFCONTENTS, nullptr },
{ "target", CMD_TARGET, nullptr },
- { "topicref", CMD_TOPICREF, nullptr },
{ "tt", CMD_TT, nullptr },
{ "uicontrol", CMD_UICONTROL, nullptr },
{ "underline", CMD_UNDERLINE, nullptr },
@@ -562,11 +556,6 @@ void DocParser::parse(const QString &source, DocPrivate *docPrivate,
m_openedLists.pop();
}
break;
- case CMD_ENDMAPREF:
- case CMD_ENDTOPICREF:
- if (closeCommand(cmd))
- m_ditarefs.pop();
- break;
case CMD_ENDOMIT:
closeCommand(cmd);
break;
@@ -756,26 +745,6 @@ void DocParser::parse(const QString &source, DocPrivate *docPrivate,
m_openedLists.push(OpenedList(location(), getOptionalArgument()));
}
break;
- case CMD_TOPICREF:
- case CMD_MAPREF:
- if (openCommand(cmd)) {
- DitaRef *t = nullptr;
- if (cmd == CMD_MAPREF)
- t = new MapRef();
- else
- t = new TopicRef();
- t->setNavtitle(getArgument(true));
- if (cmd == CMD_MAPREF)
- t->setHref(getArgument());
- else
- t->setHref(getOptionalArgument());
- if (m_ditarefs.isEmpty())
- m_private->ditamap_.append(t);
- else
- m_ditarefs.top()->appendSubref(t);
- m_ditarefs.push(t);
- }
- break;
case CMD_META:
m_private->constructExtra();
p1 = getArgument();
@@ -1492,10 +1461,7 @@ bool DocParser::openCommand(int cmd)
ok = (cmd == CMD_LIST || cmd == CMD_FOOTNOTE || cmd == CMD_QUOTATION);
} else if (outer == CMD_FOOTNOTE || outer == CMD_LINK) {
ok = false;
- } else if (outer == CMD_TOPICREF)
- ok = (cmd == CMD_TOPICREF || cmd == CMD_MAPREF);
- else if (outer == CMD_MAPREF)
- ok = false;
+ }
}
if (ok) {
@@ -2408,10 +2374,6 @@ int DocParser::endCmdFor(int cmd)
return CMD_ENDSIDEBAR;
case CMD_TABLE:
return CMD_ENDTABLE;
- case CMD_TOPICREF:
- return CMD_ENDTOPICREF;
- case CMD_MAPREF:
- return CMD_ENDMAPREF;
default:
return cmd;
}
diff --git a/src/qdoc/docparser.h b/src/qdoc/docparser.h
index 4bc585fa8..f5f9d3607 100644
--- a/src/qdoc/docparser.h
+++ b/src/qdoc/docparser.h
@@ -151,7 +151,6 @@ private:
QStack<int> m_openedCommands;
QStack<OpenedList> m_openedLists;
Quoter m_quoter;
- QStack<DitaRef *> m_ditarefs;
Atom *m_lastAtom { nullptr };
static DocUtilities &m_utilities;
diff --git a/src/qdoc/docprivate.cpp b/src/qdoc/docprivate.cpp
index 54d1ac56f..14ece93da 100644
--- a/src/qdoc/docprivate.cpp
+++ b/src/qdoc/docprivate.cpp
@@ -36,13 +36,11 @@
QT_BEGIN_NAMESPACE
/*!
- If the doc is a ditamap, the destructor deletes each element
- in the ditamap structure. These were allocated as needed.
+ Deletes the DocPrivateExtra.
*/
DocPrivate::~DocPrivate()
{
delete extra;
- qDeleteAll(ditamap_);
}
void DocPrivate::addAlso(const Text &also)
diff --git a/src/qdoc/docprivate.h b/src/qdoc/docprivate.h
index 8fe1ba530..dab567f83 100644
--- a/src/qdoc/docprivate.h
+++ b/src/qdoc/docprivate.h
@@ -99,7 +99,6 @@ public:
CommandMap metaCommandMap;
DocPrivateExtra *extra { nullptr };
TopicList topics_;
- DitaRefList ditamap_;
bool hasLegalese : 1;
bool hasSectioningUnits : 1;
diff --git a/src/qdoc/qdoc.pro b/src/qdoc/qdoc.pro
index a6a31eb77..c71c6bbe1 100644
--- a/src/qdoc/qdoc.pro
+++ b/src/qdoc/qdoc.pro
@@ -42,7 +42,6 @@ HEADERS += access.h \
config.h \
cppcodemarker.h \
cppcodeparser.h \
- ditaref.h \
doc.h \
docbookgenerator.h \
docparser.h \
diff --git a/src/qdoc/quoter.cpp b/src/qdoc/quoter.cpp
index edef4f9fa..bbe0c685d 100644
--- a/src/qdoc/quoter.cpp
+++ b/src/qdoc/quoter.cpp
@@ -113,7 +113,7 @@ Quoter::Quoter() : silent(false)
//! [<id>]
* .pro, .py, CMake files:
#! [<id>]
- * .html, .qrc, .ui, .xq, .xml .dita files:
+ * .html, .qrc, .ui, .xq, .xml files:
<!-- [<id>] -->
*/
if (!commentHash.size()) {
@@ -124,7 +124,6 @@ Quoter::Quoter() : silent(false)
commentHash["qrc"] = "<!--";
commentHash["ui"] = "<!--";
commentHash["xml"] = "<!--";
- commentHash["dita"] = "<!--";
commentHash["xq"] = "<!--";
}
}