summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/tools/qdoc/node.h6
-rw-r--r--src/tools/qdoc/qdocdatabase.cpp2
-rw-r--r--src/tools/qdoc/qdocindexfiles.cpp21
3 files changed, 22 insertions, 7 deletions
diff --git a/src/tools/qdoc/node.h b/src/tools/qdoc/node.h
index 8364fac82f..76e762120e 100644
--- a/src/tools/qdoc/node.h
+++ b/src/tools/qdoc/node.h
@@ -169,7 +169,7 @@ public:
void setBaseName(const QString& bn) { baseName_ = bn; }
void setAccess(Access access) { access_ = access; }
- void setLocation(const Location& location) { loc = location; }
+ void setLocation(const Location& location) { loc_ = location; }
void setDoc(const Doc& doc, bool replace = false);
void setStatus(Status status) {
if (status_ == Obsolete && status == Deprecated)
@@ -241,7 +241,7 @@ public:
Access access() const { return access_; }
QString accessString() const;
- const Location& location() const { return loc; }
+ const Location& location() const { return loc_; }
const Doc& doc() const { return doc_; }
Status status() const { return status_; }
Status inheritedStatus() const;
@@ -304,7 +304,7 @@ private:
InnerNode* parent_;
InnerNode* relatesTo_;
QString name_;
- Location loc;
+ Location loc_;
Doc doc_;
QMap<LinkType, QPair<QString, QString> > linkMap_;
QString baseName_;
diff --git a/src/tools/qdoc/qdocdatabase.cpp b/src/tools/qdoc/qdocdatabase.cpp
index a50f428d24..821170d0b1 100644
--- a/src/tools/qdoc/qdocdatabase.cpp
+++ b/src/tools/qdoc/qdocdatabase.cpp
@@ -932,7 +932,7 @@ const DocNode* QDocDatabase::findDocNodeByTitle(const QString& title, const Node
++j;
}
if (internalLocations.size() > 0) {
- i.value()->location().warning(tr("This page exists in more than one file: \"%1\"").arg(title));
+ i.value()->location().warning(tr("This page title exists in more than one file: \"%1\"").arg(title));
foreach (const Location &location, internalLocations)
location.warning(tr("[It also exists here]"));
}
diff --git a/src/tools/qdoc/qdocindexfiles.cpp b/src/tools/qdoc/qdocindexfiles.cpp
index 265142d320..d8cb42513e 100644
--- a/src/tools/qdoc/qdocindexfiles.cpp
+++ b/src/tools/qdoc/qdocindexfiles.cpp
@@ -172,6 +172,12 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
Node* node;
Location location;
+ QString filePath;
+ int lineNo = 0;
+ if (element.hasAttribute("filepath")) {
+ filePath = element.attribute("filepath", QString());
+ lineNo = element.attribute("lineno", QString()).toInt();
+ }
if (element.nodeName() == "namespace") {
node = new NamespaceNode(parent, name);
@@ -519,6 +525,12 @@ void QDocIndexFiles::readIndexSection(const QDomElement& element,
// Create some content for the node.
QSet<QString> emptySet;
+ Location t(filePath);
+ if (!filePath.isEmpty()) {
+ t.setLineNo(lineNo);
+ node->setLocation(t);
+ location = t;
+ }
Doc doc(location, location, " ", emptySet, emptySet); // placeholder
node->setDoc(doc);
node->setIndexNodeFlag();
@@ -774,8 +786,12 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
href.append(QLatin1Char('/'));
href.append(gen_->fullDocumentLocation(node));
writer.writeAttribute("href", href);
- if ((node->type() != Node::Document) && (!node->isQmlNode()))
- writer.writeAttribute("location", node->location().fileName());
+
+ writer.writeAttribute("location", node->location().fileName());
+ if (!node->location().filePath().isEmpty()) {
+ writer.writeAttribute("filepath", node->location().filePath());
+ writer.writeAttribute("lineno", QString("%1").arg(node->location().lineNo()));
+ }
if (!node->since().isEmpty()) {
writer.writeAttribute("since", node->since());
@@ -870,7 +886,6 @@ bool QDocIndexFiles::generateIndexSection(QXmlStreamWriter& writer,
writer.writeAttribute("title", docNode->title());
writer.writeAttribute("fulltitle", docNode->fullTitle());
writer.writeAttribute("subtitle", docNode->subTitle());
- writer.writeAttribute("location", docNode->doc().location().fileName());
if (!node->moduleName().isEmpty() && writeModuleName) {
writer.writeAttribute("module", node->moduleName());
}