Remove many unneeded virtuals.
Cleanup a ### Qt 5 TODO. Change-Id: I384e868ecc3ca4d80e4e71bb54d402f4ec1337a8 Reviewed-by: David Faure <faure@kde.org>bb10
parent
83176f27a4
commit
4dabe78387
|
|
@ -80,8 +80,6 @@ QT_BEGIN_NAMESPACE
|
|||
|
||||
Make a lot of the (mostly empty) methods in the public classes inline.
|
||||
Specially constructors assignment operators and comparison operators are candidates.
|
||||
|
||||
The virtual isXxx functions in *Private can probably be replaced by inline methods checking the nodeType().
|
||||
*/
|
||||
|
||||
/*
|
||||
|
|
@ -167,19 +165,22 @@ public:
|
|||
}
|
||||
|
||||
// Dynamic cast
|
||||
virtual bool isAttr() const { return false; }
|
||||
virtual bool isCDATASection() const { return false; }
|
||||
virtual bool isDocumentFragment() const { return false; }
|
||||
virtual bool isDocument() const { return false; }
|
||||
virtual bool isDocumentType() const { return false; }
|
||||
virtual bool isElement() const { return false; }
|
||||
virtual bool isEntityReference() const { return false; }
|
||||
virtual bool isText() const { return false; }
|
||||
virtual bool isEntity() const { return false; }
|
||||
virtual bool isNotation() const { return false; }
|
||||
virtual bool isProcessingInstruction() const { return false; }
|
||||
virtual bool isCharacterData() const { return false; }
|
||||
virtual bool isComment() const { return false; }
|
||||
bool isAttr() const { return nodeType() == QDomNode::AttributeNode; }
|
||||
bool isCDATASection() const { return nodeType() == QDomNode::CDATASectionNode; }
|
||||
bool isDocumentFragment() const { return nodeType() == QDomNode::DocumentFragmentNode; }
|
||||
bool isDocument() const { return nodeType() == QDomNode::DocumentNode; }
|
||||
bool isDocumentType() const { return nodeType() == QDomNode::DocumentTypeNode; }
|
||||
bool isElement() const { return nodeType() == QDomNode::ElementNode; }
|
||||
bool isEntityReference() const { return nodeType() == QDomNode::EntityReferenceNode; }
|
||||
bool isText() const { return (nodeType() == QDomNode::TextNode)
|
||||
|| (nodeType() == QDomNode::CDATASectionNode); }
|
||||
bool isEntity() const { return nodeType() == QDomNode::EntityNode; }
|
||||
bool isNotation() const { return nodeType() == QDomNode::NotationNode; }
|
||||
bool isProcessingInstruction() const { return nodeType() == QDomNode::ProcessingInstructionNode; }
|
||||
bool isCharacterData() const { return (nodeType() == QDomNode::CharacterDataNode)
|
||||
|| (nodeType() == QDomNode::TextNode)
|
||||
|| (nodeType() == QDomNode::CommentNode); }
|
||||
bool isComment() const { return nodeType() == QDomNode::CommentNode; }
|
||||
|
||||
virtual QDomNode::NodeType nodeType() const { return QDomNode::BaseNode; }
|
||||
|
||||
|
|
@ -296,7 +297,6 @@ public:
|
|||
QDomNodePrivate* removeChild(QDomNodePrivate* oldChild);
|
||||
QDomNodePrivate* appendChild(QDomNodePrivate* newChild);
|
||||
|
||||
virtual bool isDocumentType() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::DocumentTypeNode; }
|
||||
|
||||
void save(QTextStream& s, int, int) const;
|
||||
|
|
@ -317,7 +317,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
virtual QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual bool isDocumentFragment() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::DocumentFragmentNode; }
|
||||
};
|
||||
|
||||
|
|
@ -335,7 +334,6 @@ public:
|
|||
void replaceData(unsigned long offset, unsigned long count, const QString& arg);
|
||||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
virtual bool isCharacterData() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::CharacterDataNode; }
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
};
|
||||
|
|
@ -350,7 +348,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual bool isText() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::TextNode; }
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
};
|
||||
|
|
@ -367,7 +364,6 @@ public:
|
|||
// Reimplemented from QDomNodePrivate
|
||||
void setNodeValue(const QString& v);
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual bool isAttr() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::AttributeNode; }
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
|
||||
|
|
@ -401,7 +397,6 @@ public:
|
|||
// Reimplemented from QDomNodePrivate
|
||||
QDomNamedNodeMapPrivate* attributes() { return m_attr; }
|
||||
bool hasAttributes() { return (m_attr->length() > 0); }
|
||||
virtual bool isElement() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::ElementNode; }
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
|
|
@ -419,7 +414,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual bool isComment() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::CommentNode; }
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
};
|
||||
|
|
@ -432,7 +426,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual bool isCDATASection() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::CDATASectionNode; }
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
};
|
||||
|
|
@ -446,7 +439,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual bool isNotation() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::NotationNode; }
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
|
||||
|
|
@ -464,7 +456,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual bool isEntity() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::EntityNode; }
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
|
||||
|
|
@ -482,7 +473,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
bool isEntityReference() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::EntityReferenceNode; }
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
};
|
||||
|
|
@ -496,7 +486,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
virtual bool isProcessingInstruction() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::ProcessingInstructionNode; }
|
||||
virtual void save(QTextStream& s, int, int) const;
|
||||
};
|
||||
|
|
@ -534,7 +523,6 @@ public:
|
|||
|
||||
// Reimplemented from QDomNodePrivate
|
||||
QDomNodePrivate* cloneNode(bool deep = true);
|
||||
bool isDocument() const { return true; }
|
||||
QDomNode::NodeType nodeType() const { return QDomNode::DocumentNode; }
|
||||
void clear();
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue