summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-09 18:10:14 +0200
committerFrederik Gladhorn <frederik.gladhorn@digia.com>2014-10-09 18:10:14 +0200
commitd31582e689bb9aa68aaa9223577db81620e106b9 (patch)
treebf62828c8b8132ffa1d62d9df6a1e72cf55d0188
parent5cf5e9323d921f5c44a94a4fa20707c681b48f77 (diff)
parent045028f951959dc217a0fc1c19f014989bfaaa1f (diff)
downloadqtxmlpatterns-d31582e689bb9aa68aaa9223577db81620e106b9.tar.gz
Merge remote-tracking branch 'origin/5.4' into dev
Change-Id: I4a853063ea9aaeb5d7055d4652be6faef468236e
-rw-r--r--.gitignore1
-rw-r--r--examples/xmlpatterns/schema/mainwindow.cpp26
-rw-r--r--src/xmlpatterns/acceltree/qacceltreebuilder_tpl_p.h11
-rw-r--r--src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp20
-rw-r--r--src/xmlpatterns/acceltree/qacceltreeresourceloader_p.h34
-rw-r--r--src/xmlpatterns/api/qxmlquery.cpp2
-rw-r--r--src/xmlpatterns/data/qabstractfloat_tpl_p.h11
-rw-r--r--src/xmlpatterns/data/qabstractfloatcasters_tpl_p.h11
-rw-r--r--src/xmlpatterns/data/qabstractfloatmathematician_tpl_p.h11
-rw-r--r--src/xmlpatterns/doc/src/xml-patterns.qdoc6
-rw-r--r--src/xmlpatterns/environment/qstackcontextbase_tpl_p.h11
-rw-r--r--src/xmlpatterns/expr/qcastingplatform_tpl_p.h11
-rw-r--r--src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h11
-rw-r--r--src/xmlpatterns/expr/qevaluationcache_tpl_p.h11
-rw-r--r--src/xmlpatterns/functions/qcomparingaggregator_tpl_p.h11
-rw-r--r--src/xmlpatterns/functions/qdatetimefns_tpl_p.h11
-rw-r--r--src/xmlpatterns/parser/qmaintainingreader_tpl_p.h11
-rw-r--r--src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h11
-rw-r--r--src/xmlpatterns/schema/qxsduserschematype_tpl_p.h11
-rw-r--r--src/xmlpatterns/type/qbuiltinnodetype_tpl_p.h11
20 files changed, 192 insertions, 51 deletions
diff --git a/.gitignore b/.gitignore
index c66a88c..446d0d9 100644
--- a/.gitignore
+++ b/.gitignore
@@ -69,7 +69,6 @@ bin/pixeltool*
bin/qmake*
bin/qdoc3*
bin/qt3to4*
-bin/qtdemo*
bin/qttracereplay*
bin/rcc*
bin/uic*
diff --git a/examples/xmlpatterns/schema/mainwindow.cpp b/examples/xmlpatterns/schema/mainwindow.cpp
index 0de5309..bb18e38 100644
--- a/examples/xmlpatterns/schema/mainwindow.cpp
+++ b/examples/xmlpatterns/schema/mainwindow.cpp
@@ -130,8 +130,15 @@ void MainWindow::schemaSelected(int index)
}
textChanged();
- QFile schemaFile(QString(":/schema_%1.xsd").arg(index));
- schemaFile.open(QIODevice::ReadOnly);
+ const QString fileName = QStringLiteral(":/schema_")
+ + QString::number(index) + QStringLiteral(".xsd");
+ QFile schemaFile(fileName);
+ if (!schemaFile.open(QIODevice::ReadOnly)) {
+ qWarning() << "Cannot open" << QDir::toNativeSeparators(fileName)
+ << ':' << schemaFile.errorString();
+ return;
+ }
+
const QString schemaText(QString::fromUtf8(schemaFile.readAll()));
schemaView->setPlainText(schemaText);
@@ -142,8 +149,19 @@ void MainWindow::schemaSelected(int index)
//! [2]
void MainWindow::instanceSelected(int index)
{
- QFile instanceFile(QString(":/instance_%1.xml").arg((2*schemaSelection->currentIndex()) + index));
- instanceFile.open(QIODevice::ReadOnly);
+ if (index < 0) {
+ instanceEdit->setPlainText(QString());
+ return;
+ }
+ const QString fileName = QStringLiteral(":/instance_")
+ + QString::number(2 * schemaSelection->currentIndex() + index)
+ + QStringLiteral(".xml");
+ QFile instanceFile(fileName);
+ if (!instanceFile.open(QIODevice::ReadOnly)) {
+ qWarning() << "Cannot open" << QDir::toNativeSeparators(fileName)
+ << ':' << instanceFile.errorString();
+ return;
+ }
const QString instanceText(QString::fromUtf8(instanceFile.readAll()));
instanceEdit->setPlainText(instanceText);
diff --git a/src/xmlpatterns/acceltree/qacceltreebuilder_tpl_p.h b/src/xmlpatterns/acceltree/qacceltreebuilder_tpl_p.h
index 85330d4..3de58f0 100644
--- a/src/xmlpatterns/acceltree/qacceltreebuilder_tpl_p.h
+++ b/src/xmlpatterns/acceltree/qacceltreebuilder_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by qacceltreebuilder_p.h.
diff --git a/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp b/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp
index 7c877c6..85ea41a 100644
--- a/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp
+++ b/src/xmlpatterns/acceltree/qacceltreeresourceloader.cpp
@@ -110,15 +110,20 @@ QNetworkReply *AccelTreeResourceLoader::load(const QUrl &uri,
Q_ASSERT(networkManager);
Q_ASSERT(uri.isValid());
- NetworkLoop networkLoop;
-
+ const bool ftpSchemeUsed = (uri.scheme() == QStringLiteral("ftp"));
+ // QNAM doesn't have support for SynchronousRequestAttribute in its ftp backend.
+ QEventLoop ftpNetworkLoop;
QNetworkRequest request(uri);
+ if (!ftpSchemeUsed)
+ request.setAttribute(QNetworkRequest::SynchronousRequestAttribute, true);
QNetworkReply *const reply = networkManager->get(request);
- networkLoop.connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(error(QNetworkReply::NetworkError)));
- networkLoop.connect(reply, SIGNAL(finished()), SLOT(finished()));
+ if (ftpSchemeUsed) {
+ ftpNetworkLoop.connect(reply, SIGNAL(error(QNetworkReply::NetworkError)), SLOT(quit()));
+ ftpNetworkLoop.connect(reply, SIGNAL(finished()), SLOT(quit()));
+ ftpNetworkLoop.exec(QEventLoop::ExcludeUserInputEvents);
+ }
- if(networkLoop.exec(QEventLoop::ExcludeUserInputEvents))
- {
+ if (reply->error() != QNetworkReply::NoError) {
const QString errorMessage(escape(reply->errorString()));
/* Note, we delete reply before we exit this function with error(). */
@@ -130,8 +135,7 @@ QNetworkReply *AccelTreeResourceLoader::load(const QUrl &uri,
context->error(errorMessage, ReportContext::FODC0002, location);
return 0;
- }
- else
+ } else
return reply;
}
diff --git a/src/xmlpatterns/acceltree/qacceltreeresourceloader_p.h b/src/xmlpatterns/acceltree/qacceltreeresourceloader_p.h
index 0adc8c8..7ac4389 100644
--- a/src/xmlpatterns/acceltree/qacceltreeresourceloader_p.h
+++ b/src/xmlpatterns/acceltree/qacceltreeresourceloader_p.h
@@ -62,40 +62,6 @@ class QIODevice;
namespace QPatternist
{
/**
- * @short An helper class which enables QNetworkAccessManager
- * to be used in a blocking manner.
- *
- * @see AccelTreeResourceLoader::load()
- * @author Frans Englich <frans.englich@nokia.com>
- */
- class NetworkLoop : public QEventLoop
- {
- Q_OBJECT
- public:
- NetworkLoop() : m_hasReceivedError(false)
- {
- }
-
- public Q_SLOTS:
- void error(QNetworkReply::NetworkError code)
- {
- Q_UNUSED(code);
- m_hasReceivedError = true;
- exit(1);
- }
-
- void finished()
- {
- if(m_hasReceivedError)
- exit(1);
- else
- exit(0);
- }
- private:
- bool m_hasReceivedError;
- };
-
- /**
* @short Handles requests for documents, and instantiates
* them as AccelTree instances.
*
diff --git a/src/xmlpatterns/api/qxmlquery.cpp b/src/xmlpatterns/api/qxmlquery.cpp
index f16ab91..2bacff3 100644
--- a/src/xmlpatterns/api/qxmlquery.cpp
+++ b/src/xmlpatterns/api/qxmlquery.cpp
@@ -123,7 +123,7 @@ QT_BEGIN_NAMESPACE
running an XPath expression is the same as running an XQuery
query. Pass the XPath expression to QXmlQuery using setQuery().
- \section1 Running XSLT stylesheets
+ \section1 Running XSLT Stylesheets
Running an XSLT stylesheet is like running an XQuery, except that
when you construct your QXmlQuery, you must pass QXmlQuery::XSLT20
diff --git a/src/xmlpatterns/data/qabstractfloat_tpl_p.h b/src/xmlpatterns/data/qabstractfloat_tpl_p.h
index 8f8d5f4..b72ce97 100644
--- a/src/xmlpatterns/data/qabstractfloat_tpl_p.h
+++ b/src/xmlpatterns/data/qabstractfloat_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by qabstractfloat_p.h.
diff --git a/src/xmlpatterns/data/qabstractfloatcasters_tpl_p.h b/src/xmlpatterns/data/qabstractfloatcasters_tpl_p.h
index c9e09b1..c3f2ec6 100644
--- a/src/xmlpatterns/data/qabstractfloatcasters_tpl_p.h
+++ b/src/xmlpatterns/data/qabstractfloatcasters_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/*
* NOTE: This file is included by qabstractfloatcasters_p.h
* if you need some includes, put them in qabstractfloatcasters_p.h (outside of the namespace)
diff --git a/src/xmlpatterns/data/qabstractfloatmathematician_tpl_p.h b/src/xmlpatterns/data/qabstractfloatmathematician_tpl_p.h
index 02d442d..6131468 100644
--- a/src/xmlpatterns/data/qabstractfloatmathematician_tpl_p.h
+++ b/src/xmlpatterns/data/qabstractfloatmathematician_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/*
* @file
* @short This file is included by qatomicmathematicians_p.h
diff --git a/src/xmlpatterns/doc/src/xml-patterns.qdoc b/src/xmlpatterns/doc/src/xml-patterns.qdoc
index b231d62..540d325 100644
--- a/src/xmlpatterns/doc/src/xml-patterns.qdoc
+++ b/src/xmlpatterns/doc/src/xml-patterns.qdoc
@@ -55,7 +55,7 @@
Readers who are not familiar with the XQuery/XPath language can read
\l {A Short Path to XQuery} for a brief introduction.
- \section1 Advantages of using Qt XML Patterns and XQuery
+ \section1 Advantages of Using Qt XML Patterns and XQuery
The XQuery/XPath language simplifies data searching and
transformation tasks by eliminating the need for doing a lot of
@@ -107,7 +107,7 @@
\endlist
- \section1 Using the Qt XML Patterns module
+ \section1 Using the Qt XML Patterns Module
There are two ways Qt XML Patterns can be used to evaluate queries.
You can run the query engine in your Qt application using the
@@ -546,7 +546,7 @@
See the QAbstractXmlNodeModel documentation for information about
how to implement custom XML node models.
- \section1 More on using Qt XML Patterns with non-XML Data
+ \section1 More on Using Qt XML Patterns with Non-XML Data
Subclassing QAbstractXmlNodeModel to let the query engine access
non-XML data by the same API it uses for XML is the feature that
diff --git a/src/xmlpatterns/environment/qstackcontextbase_tpl_p.h b/src/xmlpatterns/environment/qstackcontextbase_tpl_p.h
index 879b7b1..538b9ba 100644
--- a/src/xmlpatterns/environment/qstackcontextbase_tpl_p.h
+++ b/src/xmlpatterns/environment/qstackcontextbase_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by qstackcontextbase_p.h.
diff --git a/src/xmlpatterns/expr/qcastingplatform_tpl_p.h b/src/xmlpatterns/expr/qcastingplatform_tpl_p.h
index b76863b..782c223 100644
--- a/src/xmlpatterns/expr/qcastingplatform_tpl_p.h
+++ b/src/xmlpatterns/expr/qcastingplatform_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by qcastingplatform_p.h.
diff --git a/src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h b/src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h
index 7076e41..0ab9ad8 100644
--- a/src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h
+++ b/src/xmlpatterns/expr/qcomparisonplatform_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by qcomparisonplatform_p.h.
diff --git a/src/xmlpatterns/expr/qevaluationcache_tpl_p.h b/src/xmlpatterns/expr/qevaluationcache_tpl_p.h
index 2d4b4c9..cb4f5a7 100644
--- a/src/xmlpatterns/expr/qevaluationcache_tpl_p.h
+++ b/src/xmlpatterns/expr/qevaluationcache_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by qevaluationcache_p.h.
diff --git a/src/xmlpatterns/functions/qcomparingaggregator_tpl_p.h b/src/xmlpatterns/functions/qcomparingaggregator_tpl_p.h
index 8794a39..0221d80 100644
--- a/src/xmlpatterns/functions/qcomparingaggregator_tpl_p.h
+++ b/src/xmlpatterns/functions/qcomparingaggregator_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file qcomparingaggregator.cpp
* @short This file is included by qcomparingaggregator_p.h.
diff --git a/src/xmlpatterns/functions/qdatetimefns_tpl_p.h b/src/xmlpatterns/functions/qdatetimefns_tpl_p.h
index 84cc762..5154dbc 100644
--- a/src/xmlpatterns/functions/qdatetimefns_tpl_p.h
+++ b/src/xmlpatterns/functions/qdatetimefns_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by qdatetimefns_p.h.
diff --git a/src/xmlpatterns/parser/qmaintainingreader_tpl_p.h b/src/xmlpatterns/parser/qmaintainingreader_tpl_p.h
index fa5a2bd..2fb4ee4 100644
--- a/src/xmlpatterns/parser/qmaintainingreader_tpl_p.h
+++ b/src/xmlpatterns/parser/qmaintainingreader_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by qcastingplatform_p.h.
diff --git a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
index 88b04c5..9012511 100644
--- a/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
+++ b/src/xmlpatterns/schema/qxsdstatemachine_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/*
* NOTE: This file is included by qxsdstatemachine_p.h
* if you need some includes, put them in qxsdstatemachine_p.h (outside of the namespace)
diff --git a/src/xmlpatterns/schema/qxsduserschematype_tpl_p.h b/src/xmlpatterns/schema/qxsduserschematype_tpl_p.h
index 2450770..4de53c0 100644
--- a/src/xmlpatterns/schema/qxsduserschematype_tpl_p.h
+++ b/src/xmlpatterns/schema/qxsduserschematype_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/*
* NOTE: This file is included by qxsduserschematype_p.h
* if you need some includes, put them in qxsduserschematype_p.h (outside of the namespace)
diff --git a/src/xmlpatterns/type/qbuiltinnodetype_tpl_p.h b/src/xmlpatterns/type/qbuiltinnodetype_tpl_p.h
index e726428..7b15412 100644
--- a/src/xmlpatterns/type/qbuiltinnodetype_tpl_p.h
+++ b/src/xmlpatterns/type/qbuiltinnodetype_tpl_p.h
@@ -31,6 +31,17 @@
**
****************************************************************************/
+//
+// W A R N I N G
+// -------------
+//
+// This file is not part of the Qt API. It exists purely as an
+// implementation detail. This header file may change from version to
+// version without notice, or even be removed.
+//
+// We mean it.
+//
+
/**
* @file
* @short This file is included by BuiltintNodeType.h.