From 640b381a2bf72b32e6a98adc366e5f56140a5597 Mon Sep 17 00:00:00 2001 From: Sergio Martins Date: Sun, 10 Jan 2016 23:59:29 +0000 Subject: Fix QAbstractMessageHandler's docs regarding thread safety The QMutexLocker's usage was bogus, it didn't do any locking because it was being created as an anonymous temporary. It's too late in the game to fix the locking. The user's virtual function might have it's own locking to workaround this bug and might re-enter Qtxmlpatterns API causing a dead-lock. So instead, make the docs consistent with the current behavior. Change-Id: I4d2bdb1431b44262583abf48f795067ed37281d5 Reviewed-by: Olivier Goffart (Woboq GmbH) --- src/xmlpatterns/api/qabstractmessagehandler.cpp | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/src/xmlpatterns/api/qabstractmessagehandler.cpp b/src/xmlpatterns/api/qabstractmessagehandler.cpp index 0916fe45..def8a390 100644 --- a/src/xmlpatterns/api/qabstractmessagehandler.cpp +++ b/src/xmlpatterns/api/qabstractmessagehandler.cpp @@ -31,22 +31,13 @@ ** ****************************************************************************/ -#include - #include "private/qobject_p.h" #include "qabstractmessagehandler.h" QT_BEGIN_NAMESPACE -class QAbstractMessageHandlerPrivate : public QObjectPrivate -{ -public: - QMutex mutex; -}; - /*! \class QAbstractMessageHandler - \threadsafe \since 4.4 \ingroup xml-tools \inmodule QtXmlPatterns @@ -65,8 +56,6 @@ public: instance of your subclass to any classes that must generate messages. The messages are sent to the message handler via the message() function, which forwards them to your handleMessge(). - The effect is to serialize the handling of all messages, which - means your QAbstractMessageHandler subclass is thread safe. A single instance of QAbstractMessageHandler can be called on to handle messages from multiple sources. Hence, the content of a @@ -81,7 +70,7 @@ public: Constructs a QAbstractMessageHandler. The \a parent is passed to the QObject base class constructor. */ -QAbstractMessageHandler::QAbstractMessageHandler(QObject *parent) : QObject(*new QAbstractMessageHandlerPrivate(), parent) +QAbstractMessageHandler::QAbstractMessageHandler(QObject *parent) : QObject(parent) { } @@ -121,8 +110,6 @@ void QAbstractMessageHandler::message(QtMsgType type, const QUrl &identifier, const QSourceLocation &sourceLocation) { - Q_D(QAbstractMessageHandler); - QMutexLocker(&d->mutex); handleMessage(type, description, identifier, sourceLocation); } @@ -135,6 +122,9 @@ void QAbstractMessageHandler::message(QtMsgType type, This function must be implemented by the sub-class. message() will call this function, passing in its parameters, \a type, \a description, \a identifier and \a sourceLocation unmodified. + + This function can potentially be called from multiple threads. It's the reimplementation's + responsibility to ensure thread safety. */ QT_END_NAMESPACE -- cgit v1.2.3 From de2dadb8af67f9d425c3a8d2353a7d5b07588915 Mon Sep 17 00:00:00 2001 From: Nico Vertriest Date: Tue, 26 Jan 2016 14:38:00 +0100 Subject: Doc: removed links to QObject XML Model Example MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Uses Qt Webkit which is not part of 5.6 Task-number: QTBUG-43810 Change-Id: I89d74eb9555f04f90f930fa52a834997b5f1e99d Reviewed-by: Martin Smith Reviewed-by: Topi Reiniƶ --- examples/xmlpatterns/filetree/doc/src/filetree.qdoc | 16 +++++++--------- src/xmlpatterns/doc/src/xml-patterns.qdoc | 2 +- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/examples/xmlpatterns/filetree/doc/src/filetree.qdoc b/examples/xmlpatterns/filetree/doc/src/filetree.qdoc index cf485ae3..796861d6 100644 --- a/examples/xmlpatterns/filetree/doc/src/filetree.qdoc +++ b/examples/xmlpatterns/filetree/doc/src/filetree.qdoc @@ -118,15 +118,13 @@ file system. At this point it is instructive to note that although the node model class for this example (\c{FileTree}) actually builds and contains the custom node model, building the custom node model - isn't always required. The node model class for the \l{QObject XML - Model Example} {QObject node model example} does not build its node - model but instead uses an already existing QObject tree as its node - model and just implements the callback interface for that already - existing data structure. In this file system example, however, - although we have an already existing data structure, i.e. the file - system, that data structure is not in memory and is not in a form we - can use. So we must build an analog of the file system in memory - from instances of QFileInfo, and we use that analog as the custom + isn't always required. For example, it is possible to use an already + existing QObject tree as a node model and just implement the callback + interface for that already existing data structure. In this file system + example, however, although we have an already existing data structure, + i.e. the file system, that data structure is not in memory and is not + in a form we can use. So we must build an analog of the file system in + memory from instances of QFileInfo, and we use that analog as the custom node model. The two sets of flags, \c{m_filterAllowAll} and \c{m_sortFlags}, diff --git a/src/xmlpatterns/doc/src/xml-patterns.qdoc b/src/xmlpatterns/doc/src/xml-patterns.qdoc index ae1ed3b8..407e2d11 100644 --- a/src/xmlpatterns/doc/src/xml-patterns.qdoc +++ b/src/xmlpatterns/doc/src/xml-patterns.qdoc @@ -538,7 +538,7 @@ \li The set of D-Bus interfaces available in a system - \li A QObject hierarchy, as seen in the \l{QObject XML Model Example}. + \li A QObject hierarchy. \endlist -- cgit v1.2.3 From a8d103a05bc195dd045779f3aebdf67bd0140df1 Mon Sep 17 00:00:00 2001 From: Oswald Buddenhagen Date: Mon, 8 Feb 2016 14:56:52 +0100 Subject: Bump version Change-Id: I4f9880fa8f325069ac55973cf591c6ed40edbabc --- .qmake.conf | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.qmake.conf b/.qmake.conf index fc13c75d..5c427194 100644 --- a/.qmake.conf +++ b/.qmake.conf @@ -2,4 +2,4 @@ load(qt_build_config) CONFIG += qt_example_installs CONFIG += warning_clean -MODULE_VERSION = 5.6.0 +MODULE_VERSION = 5.6.1 -- cgit v1.2.3