summaryrefslogtreecommitdiffstats
path: root/src/xmlpatterns/utils/qxpathhelper.cpp
diff options
context:
space:
mode:
authorTobias Koenig <tokoe@kde.org>2009-05-16 10:30:25 (GMT)
committerTobias Koenig <tokoe@kde.org>2009-05-16 10:30:25 (GMT)
commit456463169c6d00b9938f0d975dbd7f398edea39d (patch)
tree13c1b245cffa15828ef1b12ac24c271c301221f2 /src/xmlpatterns/utils/qxpathhelper.cpp
parent135a028d9dc9a28a0a072665a7dc43b7e9e187be (diff)
downloadQt-456463169c6d00b9938f0d975dbd7f398edea39d.zip
Qt-456463169c6d00b9938f0d975dbd7f398edea39d.tar.gz
Qt-456463169c6d00b9938f0d975dbd7f398edea39d.tar.bz2
Various api, documentation and code cleanups
Diffstat (limited to 'src/xmlpatterns/utils/qxpathhelper.cpp')
-rw-r--r--src/xmlpatterns/utils/qxpathhelper.cpp12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/xmlpatterns/utils/qxpathhelper.cpp b/src/xmlpatterns/utils/qxpathhelper.cpp
index 127e21f..5b32906 100644
--- a/src/xmlpatterns/utils/qxpathhelper.cpp
+++ b/src/xmlpatterns/utils/qxpathhelper.cpp
@@ -125,4 +125,16 @@ ItemType::Ptr XPathHelper::typeFromKind(const QXmlNodeModelIndex::NodeKind nodeK
}
}
+QUrl XPathHelper::normalizeQueryURI(const QUrl &uri)
+{
+ Q_ASSERT_X(uri.isEmpty() || uri.isValid(), Q_FUNC_INFO,
+ "The URI passed to QXmlQuery::setQuery() must be valid or empty.");
+ if(uri.isEmpty())
+ return QUrl::fromLocalFile(QCoreApplication::applicationFilePath());
+ else if(uri.isRelative())
+ return QUrl::fromLocalFile(QCoreApplication::applicationFilePath()).resolved(uri);
+ else
+ return uri;
+}
+
QT_END_NAMESPACE