summaryrefslogtreecommitdiff
path: root/src/xmlpatterns
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-22 12:50:57 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2019-05-22 12:51:24 +0200
commitfc214a5d298e9d916882528c43e78e386ff8b0ad (patch)
treea90c252ed568e4e1baa4e5895b5bf324d14f5c1d /src/xmlpatterns
parentfe0475651556878b8b80b38058e5fa743822ddce (diff)
downloadqtxmlpatterns-fc214a5d298e9d916882528c43e78e386ff8b0ad.tar.gz
Fix deprecation warnings about deprecated container conversions
Fix warnings introduced by qtbase/92f984273262531f909ede17a324f546fe502b5c. Change-Id: I1f64f1573ae4cff9e39f1a340711f2e90a6a7dd1 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
Diffstat (limited to 'src/xmlpatterns')
-rw-r--r--src/xmlpatterns/parser/qmaintainingreader_tpl_p.h2
-rw-r--r--src/xmlpatterns/schema/qxsdelement.cpp2
-rw-r--r--src/xmlpatterns/schema/qxsdinstancereader.cpp5
-rw-r--r--src/xmlpatterns/schema/qxsdschemachecker.cpp7
-rw-r--r--src/xmlpatterns/schema/qxsdschemaparser.cpp20
-rw-r--r--src/xmlpatterns/schema/qxsdstatemachine_p.h2
6 files changed, 24 insertions, 14 deletions
diff --git a/src/xmlpatterns/parser/qmaintainingreader_tpl_p.h b/src/xmlpatterns/parser/qmaintainingreader_tpl_p.h
index fae1818..e110520 100644
--- a/src/xmlpatterns/parser/qmaintainingreader_tpl_p.h
+++ b/src/xmlpatterns/parser/qmaintainingreader_tpl_p.h
@@ -177,7 +177,7 @@ void MaintainingReader<TokenLookupClass, LookupKey>::validateElement(const Looku
{
QString translationString;
- QList<typename TokenLookupClass::NodeName> all(desc.requiredAttributes.toList() + desc.optionalAttributes.toList());
+ QList<typename TokenLookupClass::NodeName> all(desc.requiredAttributes.values() + desc.optionalAttributes.values());
const int totalCount = all.count();
QStringList allowed;
diff --git a/src/xmlpatterns/schema/qxsdelement.cpp b/src/xmlpatterns/schema/qxsdelement.cpp
index 94d3610..141c084 100644
--- a/src/xmlpatterns/schema/qxsdelement.cpp
+++ b/src/xmlpatterns/schema/qxsdelement.cpp
@@ -236,7 +236,7 @@ void XsdElement::addSubstitutionGroup(const XsdElement::Ptr &element)
XsdElement::List XsdElement::substitutionGroups() const
{
- return m_substitutionGroups.toList();
+ return m_substitutionGroups.values();
}
QT_END_NAMESPACE
diff --git a/src/xmlpatterns/schema/qxsdinstancereader.cpp b/src/xmlpatterns/schema/qxsdinstancereader.cpp
index 70c6fb9..18b7bc3 100644
--- a/src/xmlpatterns/schema/qxsdinstancereader.cpp
+++ b/src/xmlpatterns/schema/qxsdinstancereader.cpp
@@ -149,7 +149,10 @@ QString XsdInstanceReader::attribute(const QXmlName &name) const
QSet<QXmlName> XsdInstanceReader::attributeNames() const
{
- return m_cachedAttributes.keys().toSet();
+ QSet<QXmlName> result;
+ for (auto it = m_cachedAttributes.cbegin(), end = m_cachedAttributes.cend(); it != end; ++it)
+ result.insert(it.key());
+ return result;
}
QString XsdInstanceReader::text() const
diff --git a/src/xmlpatterns/schema/qxsdschemachecker.cpp b/src/xmlpatterns/schema/qxsdschemachecker.cpp
index 57ee3e6..91a796a 100644
--- a/src/xmlpatterns/schema/qxsdschemachecker.cpp
+++ b/src/xmlpatterns/schema/qxsdschemachecker.cpp
@@ -1525,11 +1525,14 @@ void XsdSchemaChecker::checkConstrainingFacets(const XsdFacet::Hash &facets, con
const QXmlName primitiveTypeName = simpleType->primitiveType()->name(m_namePool);
if (m_allowedAtomicFacets.contains(primitiveTypeName)) {
const QSet<XsdFacet::Type> allowedFacets = m_allowedAtomicFacets.value(primitiveTypeName);
- QSet<XsdFacet::Type> availableFacets = facets.keys().toSet();
+
+ QSet<XsdFacet::Type> availableFacets;
+ for (auto it = facets.cbegin(), end = facets.cend(); it != end; ++it)
+ availableFacets.insert(it.key());
if (!availableFacets.subtract(allowedFacets).isEmpty()) {
m_context->error(QtXmlPatterns::tr("Simple type contains not allowed facet %1.")
- .arg(formatKeyword(XsdFacet::typeName(availableFacets.toList().first()))),
+ .arg(formatKeyword(XsdFacet::typeName(availableFacets.values().constFirst()))),
XsdSchemaContext::XSDError, sourceLocation(simpleType));
return;
}
diff --git a/src/xmlpatterns/schema/qxsdschemaparser.cpp b/src/xmlpatterns/schema/qxsdschemaparser.cpp
index 6c4eafe..9f11d69 100644
--- a/src/xmlpatterns/schema/qxsdschemaparser.cpp
+++ b/src/xmlpatterns/schema/qxsdschemaparser.cpp
@@ -5420,7 +5420,8 @@ XsdWildcard::Ptr XsdSchemaParser::parseAny(const XsdParticle::Ptr &particle)
}
if (hasAttribute(QString::fromLatin1("namespace"))) {
- const QSet<QString> values = readAttribute(QString::fromLatin1("namespace")).split(QLatin1Char(' '), QString::SkipEmptyParts).toSet();
+ const auto valueList = readAttribute(QString::fromLatin1("namespace")).split(QLatin1Char(' '), QString::SkipEmptyParts);
+ const QSet<QString> values(valueList.cbegin(), valueList.cend());
if ((values.contains(QString::fromLatin1("##any")) || values.contains(QString::fromLatin1("##other"))) && values.count() != 1) {
error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs.")
.arg(formatAttribute("namespace"))
@@ -5440,7 +5441,7 @@ XsdWildcard::Ptr XsdSchemaParser::parseAny(const XsdParticle::Ptr &particle)
wildcard->namespaceConstraint()->setNamespaces(QSet<QString>() << XsdWildcard::absentNamespace());
} else {
wildcard->namespaceConstraint()->setVariety(XsdWildcard::NamespaceConstraint::Enumeration);
- QStringList newValues = values.toList();
+ QStringList newValues = values.values();
// replace the ##targetNamespace entry
for (int i = 0; i < newValues.count(); ++i) {
@@ -5466,7 +5467,7 @@ XsdWildcard::Ptr XsdSchemaParser::parseAny(const XsdParticle::Ptr &particle)
}
}
- wildcard->namespaceConstraint()->setNamespaces(newValues.toSet());
+ wildcard->namespaceConstraint()->setNamespaces(QSet<QString>(newValues.cbegin(), newValues.cend()));
}
} else {
wildcard->namespaceConstraint()->setVariety(XsdWildcard::NamespaceConstraint::Any);
@@ -5532,7 +5533,8 @@ XsdWildcard::Ptr XsdSchemaParser::parseAnyAttribute()
// parse attributes
if (hasAttribute(QString::fromLatin1("namespace"))) {
- const QSet<QString> values = readAttribute(QString::fromLatin1("namespace")).split(QLatin1Char(' '), QString::SkipEmptyParts).toSet();
+ const auto valueList = readAttribute(QString::fromLatin1("namespace")).split(QLatin1Char(' '), QString::SkipEmptyParts);
+ const QSet<QString> values(valueList.cbegin(), valueList.cend());
if ((values.contains(QString::fromLatin1("##any")) || values.contains(QString::fromLatin1("##other"))) && values.count() != 1) {
error(QtXmlPatterns::tr("%1 attribute of %2 element must contain %3, %4 or a list of URIs.")
.arg(formatAttribute("namespace"))
@@ -5552,7 +5554,7 @@ XsdWildcard::Ptr XsdSchemaParser::parseAnyAttribute()
wildcard->namespaceConstraint()->setNamespaces(QSet<QString>() << XsdWildcard::absentNamespace());
} else {
wildcard->namespaceConstraint()->setVariety(XsdWildcard::NamespaceConstraint::Enumeration);
- QStringList newValues = values.toList();
+ QStringList newValues = values.values();
// replace the ##targetNamespace entry
for (int i = 0; i < newValues.count(); ++i) {
@@ -5578,7 +5580,7 @@ XsdWildcard::Ptr XsdSchemaParser::parseAnyAttribute()
}
}
- wildcard->namespaceConstraint()->setNamespaces(newValues.toSet());
+ wildcard->namespaceConstraint()->setNamespaces(QSet<QString>(newValues.cbegin(), newValues.cend()));
}
} else {
wildcard->namespaceConstraint()->setVariety(XsdWildcard::NamespaceConstraint::Any);
@@ -5815,7 +5817,8 @@ SchemaType::DerivationConstraints XsdSchemaParser::readDerivationConstraintAttri
content = m_finalDefault;
}
- QSet<QString> contentSet = content.split(QLatin1Char(' '), QString::SkipEmptyParts).toSet();
+ const auto &contentList = content.split(QLatin1Char(' '), QString::SkipEmptyParts);
+ QSet<QString> contentSet(contentList.cbegin(), contentList.cend());
// if the '#all' tag is defined, we return all allowed values
if (contentSet.contains(QString::fromLatin1("#all"))) {
@@ -5876,7 +5879,8 @@ NamedSchemaComponent::BlockingConstraints XsdSchemaParser::readBlockingConstrain
content = m_blockDefault;
}
- QSet<QString> contentSet = content.split(QLatin1Char(' '), QString::SkipEmptyParts).toSet();
+ const auto &contentList = content.split(QLatin1Char(' '), QString::SkipEmptyParts);
+ QSet<QString> contentSet(contentList.cbegin(), contentList.cend());
// if the '#all' tag is defined, we return all allowed values
if (contentSet.contains(QString::fromLatin1("#all"))) {
diff --git a/src/xmlpatterns/schema/qxsdstatemachine_p.h b/src/xmlpatterns/schema/qxsdstatemachine_p.h
index e535c8b..a82e29c 100644
--- a/src/xmlpatterns/schema/qxsdstatemachine_p.h
+++ b/src/xmlpatterns/schema/qxsdstatemachine_p.h
@@ -224,7 +224,7 @@ namespace QPatternist
QSet<StateId> result = input;
// add the input states to the list of to be processed states
- QList<StateId> workStates = input.toList();
+ QList<StateId> workStates = input.values();
while (!workStates.isEmpty()) { // while there are states to be processed left...
// dequeue one state from list