5.9.1
This commit is contained in:
parent
46844ac115
commit
69c9a202b6
3
.gitignore
vendored
3
.gitignore
vendored
@ -1 +1,2 @@
|
|||||||
/qtbase-opensource-src-5.9.0.tar.xz
|
/qtbase-opensource-src-5.9.1.tar.xz
|
||||||
|
/0086-Fix-detection-of-AT-SPI.patch
|
||||||
|
@ -1,429 +0,0 @@
|
|||||||
From 04cc2a3abad6ed825a97225b96a2e04f30fefcb1 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thiago Macieira <thiago.macieira@intel.com>
|
|
||||||
Date: Thu, 28 Apr 2016 15:00:58 -0700
|
|
||||||
Subject: [PATCH 1/2] Merge the QDBusMetaType's custom information to
|
|
||||||
QDBusConnectionManager
|
|
||||||
|
|
||||||
This allows us to get rid of two Q_GLOBAL_STATIC in QtDBus, which means
|
|
||||||
fewer opportunities for screwing up the order of destruction. And since
|
|
||||||
QDBusConnectionManager now ensures that the types are initialized, we
|
|
||||||
don't need to re-initialize them everywhere.
|
|
||||||
|
|
||||||
The Q_GLOBAL_STATIC for QDBusConnectionManager ensures the proper
|
|
||||||
thread-safe locking, so we don't need to lock for every type that we're
|
|
||||||
trying to register. This should make things faster.
|
|
||||||
|
|
||||||
But as a side-effect, trying to register a D-Bus metatype will cause the
|
|
||||||
QDBusConnectionManager thread to start too.
|
|
||||||
|
|
||||||
Change-Id: Ifea6e497f11a461db432ffff1449a4e535234485
|
|
||||||
---
|
|
||||||
src/dbus/qdbusconnection.cpp | 1 +
|
|
||||||
src/dbus/qdbusconnectionmanager_p.h | 3 +-
|
|
||||||
src/dbus/qdbusintegrator.cpp | 1 -
|
|
||||||
src/dbus/qdbusmetatype.cpp | 185 +++++++++++++++++++-----------------
|
|
||||||
src/dbus/qdbusmetatype_p.h | 27 +++++-
|
|
||||||
src/dbus/qdbusmisc.cpp | 3 +-
|
|
||||||
6 files changed, 127 insertions(+), 93 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
|
|
||||||
index f95cc3a..4187f19 100644
|
|
||||||
--- a/src/dbus/qdbusconnection.cpp
|
|
||||||
+++ b/src/dbus/qdbusconnection.cpp
|
|
||||||
@@ -182,6 +182,7 @@ void QDBusConnectionManager::run()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
connectionHash.clear();
|
|
||||||
+ customTypes.clear();
|
|
||||||
|
|
||||||
// allow deletion from any thread without warning
|
|
||||||
moveToThread(Q_NULLPTR);
|
|
||||||
diff --git a/src/dbus/qdbusconnectionmanager_p.h b/src/dbus/qdbusconnectionmanager_p.h
|
|
||||||
index 1c7dea8..fd6cd84 100644
|
|
||||||
--- a/src/dbus/qdbusconnectionmanager_p.h
|
|
||||||
+++ b/src/dbus/qdbusconnectionmanager_p.h
|
|
||||||
@@ -55,13 +55,14 @@
|
|
||||||
|
|
||||||
#include <QtDBus/private/qtdbusglobal_p.h>
|
|
||||||
#include "qdbusconnection_p.h"
|
|
||||||
+#include "qdbusmetatype_p.h"
|
|
||||||
#include "private/qthread_p.h"
|
|
||||||
|
|
||||||
#ifndef QT_NO_DBUS
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
-class QDBusConnectionManager : public QDaemonThread
|
|
||||||
+class QDBusConnectionManager : public QDaemonThread, public QDBusMetaTypeId
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
struct ConnectionRequestData;
|
|
||||||
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
|
|
||||||
index c63fb05..19f79e9 100644
|
|
||||||
--- a/src/dbus/qdbusintegrator.cpp
|
|
||||||
+++ b/src/dbus/qdbusintegrator.cpp
|
|
||||||
@@ -1036,7 +1036,6 @@ QDBusConnectionPrivate::QDBusConnectionPrivate(QObject *p)
|
|
||||||
qdbusThreadDebug = qdbusDefaultThreadDebug;
|
|
||||||
#endif
|
|
||||||
|
|
||||||
- QDBusMetaTypeId::init();
|
|
||||||
connect(this, &QDBusConnectionPrivate::dispatchStatusChanged,
|
|
||||||
this, &QDBusConnectionPrivate::doDispatch, Qt::QueuedConnection);
|
|
||||||
connect(this, &QDBusConnectionPrivate::spyHooksFinished,
|
|
||||||
diff --git a/src/dbus/qdbusmetatype.cpp b/src/dbus/qdbusmetatype.cpp
|
|
||||||
index fb2b407..9ab3c34 100644
|
|
||||||
--- a/src/dbus/qdbusmetatype.cpp
|
|
||||||
+++ b/src/dbus/qdbusmetatype.cpp
|
|
||||||
@@ -1,6 +1,7 @@
|
|
||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
+** Copyright (C) 2016 Intel Corporation.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of the QtDBus module of the Qt Toolkit.
|
|
||||||
@@ -39,19 +40,15 @@
|
|
||||||
|
|
||||||
#include "qdbusmetatype.h"
|
|
||||||
#include "qdbusmetatype_p.h"
|
|
||||||
-
|
|
||||||
-#include <string.h>
|
|
||||||
#include "qdbus_symbols_p.h"
|
|
||||||
|
|
||||||
-#include <qbytearray.h>
|
|
||||||
-#include <qglobal.h>
|
|
||||||
-#include <qreadwritelock.h>
|
|
||||||
-#include <qvector.h>
|
|
||||||
+#include <string.h>
|
|
||||||
|
|
||||||
#include "qdbusargument_p.h"
|
|
||||||
#include "qdbusutil_p.h"
|
|
||||||
#include "qdbusunixfiledescriptor.h"
|
|
||||||
#ifndef QT_BOOTSTRAPPED
|
|
||||||
+#include "qdbusconnectionmanager_p.h"
|
|
||||||
#include "qdbusmessage.h"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
@@ -64,82 +61,72 @@
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
-class QDBusCustomTypeInfo
|
|
||||||
-{
|
|
||||||
-public:
|
|
||||||
- QDBusCustomTypeInfo() : signature(), marshall(0), demarshall(0)
|
|
||||||
- { }
|
|
||||||
-
|
|
||||||
- // Suggestion:
|
|
||||||
- // change 'signature' to char* and make QDBusCustomTypeInfo a Movable type
|
|
||||||
- QByteArray signature;
|
|
||||||
- QDBusMetaType::MarshallFunction marshall;
|
|
||||||
- QDBusMetaType::DemarshallFunction demarshall;
|
|
||||||
-};
|
|
||||||
+static void registerMarshallOperatorsNoLock(QVector<QDBusCustomTypeInfo> &ct, int id,
|
|
||||||
+ QDBusMetaType::MarshallFunction mf,
|
|
||||||
+ QDBusMetaType::DemarshallFunction df);
|
|
||||||
|
|
||||||
template<typename T>
|
|
||||||
-inline static void registerHelper(T * = 0)
|
|
||||||
+inline static void registerHelper(QVector<QDBusCustomTypeInfo> &ct)
|
|
||||||
{
|
|
||||||
void (*mf)(QDBusArgument &, const T *) = qDBusMarshallHelper<T>;
|
|
||||||
void (*df)(const QDBusArgument &, T *) = qDBusDemarshallHelper<T>;
|
|
||||||
- QDBusMetaType::registerMarshallOperators(qMetaTypeId<T>(),
|
|
||||||
+ registerMarshallOperatorsNoLock(ct, qMetaTypeId<T>(),
|
|
||||||
reinterpret_cast<QDBusMetaType::MarshallFunction>(mf),
|
|
||||||
reinterpret_cast<QDBusMetaType::DemarshallFunction>(df));
|
|
||||||
}
|
|
||||||
|
|
||||||
-void QDBusMetaTypeId::init()
|
|
||||||
+QDBusMetaTypeId *QDBusMetaTypeId::instance()
|
|
||||||
{
|
|
||||||
- static QBasicAtomicInt initialized = Q_BASIC_ATOMIC_INITIALIZER(false);
|
|
||||||
-
|
|
||||||
- // reentrancy is not a problem since everything else is locked on their own
|
|
||||||
- // set the guard variable at the end
|
|
||||||
- if (!initialized.load()) {
|
|
||||||
- // register our types with Qt Core (calling qMetaTypeId<T>() does this implicitly)
|
|
||||||
- (void)message();
|
|
||||||
- (void)argument();
|
|
||||||
- (void)variant();
|
|
||||||
- (void)objectpath();
|
|
||||||
- (void)signature();
|
|
||||||
- (void)error();
|
|
||||||
- (void)unixfd();
|
|
||||||
+#ifdef QT_BOOTSTRAPPED
|
|
||||||
+ static QDBusMetaTypeId self;
|
|
||||||
+ return &self;
|
|
||||||
+#else
|
|
||||||
+ return QDBusConnectionManager::instance();
|
|
||||||
+#endif
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+QDBusMetaTypeId::QDBusMetaTypeId()
|
|
||||||
+{
|
|
||||||
+ // register our types with Qt Core (calling qMetaTypeId<T>() does this implicitly)
|
|
||||||
+ (void)message();
|
|
||||||
+ (void)argument();
|
|
||||||
+ (void)variant();
|
|
||||||
+ (void)objectpath();
|
|
||||||
+ (void)signature();
|
|
||||||
+ (void)error();
|
|
||||||
+ (void)unixfd();
|
|
||||||
|
|
||||||
#ifndef QDBUS_NO_SPECIALTYPES
|
|
||||||
- // and register Qt Core's with us
|
|
||||||
- registerHelper<QDate>();
|
|
||||||
- registerHelper<QTime>();
|
|
||||||
- registerHelper<QDateTime>();
|
|
||||||
- registerHelper<QRect>();
|
|
||||||
- registerHelper<QRectF>();
|
|
||||||
- registerHelper<QSize>();
|
|
||||||
- registerHelper<QSizeF>();
|
|
||||||
- registerHelper<QPoint>();
|
|
||||||
- registerHelper<QPointF>();
|
|
||||||
- registerHelper<QLine>();
|
|
||||||
- registerHelper<QLineF>();
|
|
||||||
- registerHelper<QVariantList>();
|
|
||||||
- registerHelper<QVariantMap>();
|
|
||||||
- registerHelper<QVariantHash>();
|
|
||||||
-
|
|
||||||
- qDBusRegisterMetaType<QList<bool> >();
|
|
||||||
- qDBusRegisterMetaType<QList<short> >();
|
|
||||||
- qDBusRegisterMetaType<QList<ushort> >();
|
|
||||||
- qDBusRegisterMetaType<QList<int> >();
|
|
||||||
- qDBusRegisterMetaType<QList<uint> >();
|
|
||||||
- qDBusRegisterMetaType<QList<qlonglong> >();
|
|
||||||
- qDBusRegisterMetaType<QList<qulonglong> >();
|
|
||||||
- qDBusRegisterMetaType<QList<double> >();
|
|
||||||
- qDBusRegisterMetaType<QList<QDBusObjectPath> >();
|
|
||||||
- qDBusRegisterMetaType<QList<QDBusSignature> >();
|
|
||||||
- qDBusRegisterMetaType<QList<QDBusUnixFileDescriptor> >();
|
|
||||||
+ // and register Qt Core's with us
|
|
||||||
+ registerHelper<QDate>(customTypes);
|
|
||||||
+ registerHelper<QTime>(customTypes);
|
|
||||||
+ registerHelper<QDateTime>(customTypes);
|
|
||||||
+ registerHelper<QRect>(customTypes);
|
|
||||||
+ registerHelper<QRectF>(customTypes);
|
|
||||||
+ registerHelper<QSize>(customTypes);
|
|
||||||
+ registerHelper<QSizeF>(customTypes);
|
|
||||||
+ registerHelper<QPoint>(customTypes);
|
|
||||||
+ registerHelper<QPointF>(customTypes);
|
|
||||||
+ registerHelper<QLine>(customTypes);
|
|
||||||
+ registerHelper<QLineF>(customTypes);
|
|
||||||
+ registerHelper<QVariantList>(customTypes);
|
|
||||||
+ registerHelper<QVariantMap>(customTypes);
|
|
||||||
+ registerHelper<QVariantHash>(customTypes);
|
|
||||||
+
|
|
||||||
+ registerHelper<QList<bool> >(customTypes);
|
|
||||||
+ registerHelper<QList<short> >(customTypes);
|
|
||||||
+ registerHelper<QList<ushort> >(customTypes);
|
|
||||||
+ registerHelper<QList<int> >(customTypes);
|
|
||||||
+ registerHelper<QList<uint> >(customTypes);
|
|
||||||
+ registerHelper<QList<qlonglong> >(customTypes);
|
|
||||||
+ registerHelper<QList<qulonglong> >(customTypes);
|
|
||||||
+ registerHelper<QList<double> >(customTypes);
|
|
||||||
+ registerHelper<QList<QDBusObjectPath> >(customTypes);
|
|
||||||
+ registerHelper<QList<QDBusSignature> >(customTypes);
|
|
||||||
+ registerHelper<QList<QDBusUnixFileDescriptor> >(customTypes);
|
|
||||||
#endif
|
|
||||||
-
|
|
||||||
- initialized.store(true);
|
|
||||||
- }
|
|
||||||
}
|
|
||||||
|
|
||||||
-Q_GLOBAL_STATIC(QVector<QDBusCustomTypeInfo>, customTypes)
|
|
||||||
-Q_GLOBAL_STATIC(QReadWriteLock, customTypesLock)
|
|
||||||
-
|
|
||||||
/*!
|
|
||||||
\class QDBusMetaType
|
|
||||||
\inmodule QtDBus
|
|
||||||
@@ -217,14 +204,22 @@ void QDBusMetaType::registerMarshallOperators(int id, MarshallFunction mf,
|
|
||||||
DemarshallFunction df)
|
|
||||||
{
|
|
||||||
QByteArray var;
|
|
||||||
- QVector<QDBusCustomTypeInfo> *ct = customTypes();
|
|
||||||
- if (id < 0 || !mf || !df || !ct)
|
|
||||||
+ QDBusMetaTypeId *mgr = QDBusMetaTypeId::instance();
|
|
||||||
+ if (id < 0 || !mf || !df || !mgr)
|
|
||||||
return; // error!
|
|
||||||
|
|
||||||
- QWriteLocker locker(customTypesLock());
|
|
||||||
- if (id >= ct->size())
|
|
||||||
- ct->resize(id + 1);
|
|
||||||
- QDBusCustomTypeInfo &info = (*ct)[id];
|
|
||||||
+ QWriteLocker locker(&mgr->customTypesLock);
|
|
||||||
+ QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
|
|
||||||
+ registerMarshallOperatorsNoLock(ct, id, mf, df);
|
|
||||||
+}
|
|
||||||
+
|
|
||||||
+static void registerMarshallOperatorsNoLock(QVector<QDBusCustomTypeInfo> &ct, int id,
|
|
||||||
+ QDBusMetaType::MarshallFunction mf,
|
|
||||||
+ QDBusMetaType::DemarshallFunction df)
|
|
||||||
+{
|
|
||||||
+ if (id >= ct.size())
|
|
||||||
+ ct.resize(id + 1);
|
|
||||||
+ QDBusCustomTypeInfo &info = ct[id];
|
|
||||||
info.marshall = mf;
|
|
||||||
info.demarshall = df;
|
|
||||||
}
|
|
||||||
@@ -241,12 +236,16 @@ bool QDBusMetaType::marshall(QDBusArgument &arg, int id, const void *data)
|
|
||||||
|
|
||||||
MarshallFunction mf;
|
|
||||||
{
|
|
||||||
- QReadLocker locker(customTypesLock());
|
|
||||||
- QVector<QDBusCustomTypeInfo> *ct = customTypes();
|
|
||||||
- if (id >= ct->size())
|
|
||||||
+ const QDBusMetaTypeId *mgr = QDBusMetaTypeId::instance();
|
|
||||||
+ if (!mgr)
|
|
||||||
+ return false; // shutting down
|
|
||||||
+
|
|
||||||
+ QReadLocker locker(&mgr->customTypesLock);
|
|
||||||
+ const QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
|
|
||||||
+ if (id >= ct.size())
|
|
||||||
return false; // non-existent
|
|
||||||
|
|
||||||
- const QDBusCustomTypeInfo &info = (*ct).at(id);
|
|
||||||
+ const QDBusCustomTypeInfo &info = ct.at(id);
|
|
||||||
if (!info.marshall) {
|
|
||||||
mf = 0; // make gcc happy
|
|
||||||
return false;
|
|
||||||
@@ -270,12 +269,16 @@ bool QDBusMetaType::demarshall(const QDBusArgument &arg, int id, void *data)
|
|
||||||
|
|
||||||
DemarshallFunction df;
|
|
||||||
{
|
|
||||||
- QReadLocker locker(customTypesLock());
|
|
||||||
- QVector<QDBusCustomTypeInfo> *ct = customTypes();
|
|
||||||
- if (id >= ct->size())
|
|
||||||
+ const QDBusMetaTypeId *mgr = QDBusMetaTypeId::instance();
|
|
||||||
+ if (!mgr)
|
|
||||||
+ return false; // shutting down
|
|
||||||
+
|
|
||||||
+ QReadLocker locker(&mgr->customTypesLock);
|
|
||||||
+ const QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
|
|
||||||
+ if (id >= ct.size())
|
|
||||||
return false; // non-existent
|
|
||||||
|
|
||||||
- const QDBusCustomTypeInfo &info = (*ct).at(id);
|
|
||||||
+ const QDBusCustomTypeInfo &info = ct.at(id);
|
|
||||||
if (!info.demarshall) {
|
|
||||||
df = 0; // make gcc happy
|
|
||||||
return false;
|
|
||||||
@@ -434,7 +437,11 @@ const char *QDBusMetaType::typeToSignature(int type)
|
|
||||||
DBUS_TYPE_BYTE_AS_STRING; // ay
|
|
||||||
}
|
|
||||||
|
|
||||||
- QDBusMetaTypeId::init();
|
|
||||||
+ // try the database
|
|
||||||
+ QDBusMetaTypeId *mgr = QDBusMetaTypeId::instance();
|
|
||||||
+ if (!mgr)
|
|
||||||
+ return Q_NULLPTR; // shutting down
|
|
||||||
+
|
|
||||||
if (type == QDBusMetaTypeId::variant())
|
|
||||||
return DBUS_TYPE_VARIANT_AS_STRING;
|
|
||||||
else if (type == QDBusMetaTypeId::objectpath())
|
|
||||||
@@ -444,14 +451,13 @@ const char *QDBusMetaType::typeToSignature(int type)
|
|
||||||
else if (type == QDBusMetaTypeId::unixfd())
|
|
||||||
return DBUS_TYPE_UNIX_FD_AS_STRING;
|
|
||||||
|
|
||||||
- // try the database
|
|
||||||
- QVector<QDBusCustomTypeInfo> *ct = customTypes();
|
|
||||||
{
|
|
||||||
- QReadLocker locker(customTypesLock());
|
|
||||||
- if (type >= ct->size())
|
|
||||||
+ QReadLocker locker(&mgr->customTypesLock);
|
|
||||||
+ const QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
|
|
||||||
+ if (type >= ct.size())
|
|
||||||
return 0; // type not registered with us
|
|
||||||
|
|
||||||
- const QDBusCustomTypeInfo &info = (*ct).at(type);
|
|
||||||
+ const QDBusCustomTypeInfo &info = ct.at(type);
|
|
||||||
|
|
||||||
if (!info.signature.isNull())
|
|
||||||
return info.signature;
|
|
||||||
@@ -468,8 +474,9 @@ const char *QDBusMetaType::typeToSignature(int type)
|
|
||||||
QByteArray signature = QDBusArgumentPrivate::createSignature(type);
|
|
||||||
|
|
||||||
// re-acquire lock
|
|
||||||
- QWriteLocker locker(customTypesLock());
|
|
||||||
- info = &(*ct)[type];
|
|
||||||
+ QWriteLocker locker(&mgr->customTypesLock);
|
|
||||||
+ QVector<QDBusCustomTypeInfo> &ct = mgr->customTypes;
|
|
||||||
+ info = &ct[type];
|
|
||||||
info->signature = signature;
|
|
||||||
}
|
|
||||||
return info->signature;
|
|
||||||
diff --git a/src/dbus/qdbusmetatype_p.h b/src/dbus/qdbusmetatype_p.h
|
|
||||||
index 1aa1155..1f7e613 100644
|
|
||||||
--- a/src/dbus/qdbusmetatype_p.h
|
|
||||||
+++ b/src/dbus/qdbusmetatype_p.h
|
|
||||||
@@ -1,6 +1,7 @@
|
|
||||||
/****************************************************************************
|
|
||||||
**
|
|
||||||
** Copyright (C) 2016 The Qt Company Ltd.
|
|
||||||
+** Copyright (C) 2016 Intel Corporation.
|
|
||||||
** Contact: https://www.qt.io/licensing/
|
|
||||||
**
|
|
||||||
** This file is part of the QtDBus module of the Qt Toolkit.
|
|
||||||
@@ -60,10 +61,27 @@
|
|
||||||
#include <qdbuserror.h>
|
|
||||||
#include <qdbusunixfiledescriptor.h>
|
|
||||||
|
|
||||||
+#include <qbytearray.h>
|
|
||||||
+#include <qreadwritelock.h>
|
|
||||||
+#include <qvector.h>
|
|
||||||
+
|
|
||||||
#ifndef QT_NO_DBUS
|
|
||||||
|
|
||||||
QT_BEGIN_NAMESPACE
|
|
||||||
|
|
||||||
+class QDBusCustomTypeInfo
|
|
||||||
+{
|
|
||||||
+public:
|
|
||||||
+ QDBusCustomTypeInfo() : signature(), marshall(0), demarshall(0)
|
|
||||||
+ { }
|
|
||||||
+
|
|
||||||
+ // Suggestion:
|
|
||||||
+ // change 'signature' to char* and make QDBusCustomTypeInfo a Movable type
|
|
||||||
+ QByteArray signature;
|
|
||||||
+ QDBusMetaType::MarshallFunction marshall;
|
|
||||||
+ QDBusMetaType::DemarshallFunction demarshall;
|
|
||||||
+};
|
|
||||||
+
|
|
||||||
struct QDBusMetaTypeId
|
|
||||||
{
|
|
||||||
static int message(); // QDBusMessage
|
|
||||||
@@ -74,7 +92,14 @@ struct QDBusMetaTypeId
|
|
||||||
static int error(); // QDBusError
|
|
||||||
static int unixfd(); // QDBusUnixFileDescriptor
|
|
||||||
|
|
||||||
- static void init();
|
|
||||||
+ static void init() { instance(); }
|
|
||||||
+ static QDBusMetaTypeId *instance();
|
|
||||||
+
|
|
||||||
+ mutable QReadWriteLock customTypesLock;
|
|
||||||
+ QVector<QDBusCustomTypeInfo> customTypes;
|
|
||||||
+
|
|
||||||
+protected:
|
|
||||||
+ QDBusMetaTypeId();
|
|
||||||
};
|
|
||||||
|
|
||||||
inline int QDBusMetaTypeId::message()
|
|
||||||
diff --git a/src/dbus/qdbusmisc.cpp b/src/dbus/qdbusmisc.cpp
|
|
||||||
index 930c3bd..01436da 100644
|
|
||||||
--- a/src/dbus/qdbusmisc.cpp
|
|
||||||
+++ b/src/dbus/qdbusmisc.cpp
|
|
||||||
@@ -144,8 +144,9 @@ int qDBusParametersForMethod(const QMetaMethod &mm, QVector<int> &metaTypes, QSt
|
|
||||||
|
|
||||||
int qDBusParametersForMethod(const QList<QByteArray> ¶meterTypes, QVector<int>& metaTypes, QString &errorMsg)
|
|
||||||
{
|
|
||||||
- QDBusMetaTypeId::init();
|
|
||||||
metaTypes.clear();
|
|
||||||
+ if (!QDBusMetaTypeId::instance())
|
|
||||||
+ return -1;
|
|
||||||
|
|
||||||
metaTypes.append(0); // return type
|
|
||||||
int inputCount = 0;
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,121 +0,0 @@
|
|||||||
From 72700167cf051e5053f03bf4f4be391cd7514502 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Thiago Macieira <thiago.macieira@intel.com>
|
|
||||||
Date: Tue, 31 May 2016 17:33:03 -0300
|
|
||||||
Subject: [PATCH 2/2] Fix some QtDBus crashes during application destruction
|
|
||||||
|
|
||||||
It's possible that some code executes after QDBusConnectionManager is
|
|
||||||
destroyed and still tries to access QtDBus. Protect against such
|
|
||||||
crashes.
|
|
||||||
|
|
||||||
Change-Id: I87e17314d8b24ae983b1fffd1453c13fbd3cf48e
|
|
||||||
---
|
|
||||||
src/dbus/qdbusconnection.cpp | 12 ++++++++----
|
|
||||||
src/dbus/qdbusintegrator.cpp | 3 +++
|
|
||||||
src/dbus/qdbusserver.cpp | 12 ++++++++++--
|
|
||||||
3 files changed, 21 insertions(+), 6 deletions(-)
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusconnection.cpp b/src/dbus/qdbusconnection.cpp
|
|
||||||
index 4187f19..aa14ac2 100644
|
|
||||||
--- a/src/dbus/qdbusconnection.cpp
|
|
||||||
+++ b/src/dbus/qdbusconnection.cpp
|
|
||||||
@@ -418,7 +418,7 @@ void QDBusConnectionManager::createServer(const QString &address, void *server)
|
|
||||||
*/
|
|
||||||
QDBusConnection::QDBusConnection(const QString &name)
|
|
||||||
{
|
|
||||||
- if (name.isEmpty()) {
|
|
||||||
+ if (name.isEmpty() || _q_manager.isDestroyed()) {
|
|
||||||
d = 0;
|
|
||||||
} else {
|
|
||||||
QMutexLocker locker(&_q_manager()->mutex);
|
|
||||||
@@ -483,7 +483,7 @@ QDBusConnection &QDBusConnection::operator=(const QDBusConnection &other)
|
|
||||||
*/
|
|
||||||
QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
|
|
||||||
{
|
|
||||||
- if (!qdbus_loadLibDBus()) {
|
|
||||||
+ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
|
|
||||||
QDBusConnectionPrivate *d = 0;
|
|
||||||
return QDBusConnection(d);
|
|
||||||
}
|
|
||||||
@@ -497,7 +497,7 @@ QDBusConnection QDBusConnection::connectToBus(BusType type, const QString &name)
|
|
||||||
QDBusConnection QDBusConnection::connectToBus(const QString &address,
|
|
||||||
const QString &name)
|
|
||||||
{
|
|
||||||
- if (!qdbus_loadLibDBus()) {
|
|
||||||
+ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
|
|
||||||
QDBusConnectionPrivate *d = 0;
|
|
||||||
return QDBusConnection(d);
|
|
||||||
}
|
|
||||||
@@ -512,7 +512,7 @@ QDBusConnection QDBusConnection::connectToBus(const QString &address,
|
|
||||||
QDBusConnection QDBusConnection::connectToPeer(const QString &address,
|
|
||||||
const QString &name)
|
|
||||||
{
|
|
||||||
- if (!qdbus_loadLibDBus()) {
|
|
||||||
+ if (_q_manager.isDestroyed() || !qdbus_loadLibDBus()) {
|
|
||||||
QDBusConnectionPrivate *d = 0;
|
|
||||||
return QDBusConnection(d);
|
|
||||||
}
|
|
||||||
@@ -1167,6 +1167,8 @@ bool QDBusConnection::unregisterService(const QString &serviceName)
|
|
||||||
*/
|
|
||||||
QDBusConnection QDBusConnection::sessionBus()
|
|
||||||
{
|
|
||||||
+ if (_q_manager.isDestroyed())
|
|
||||||
+ return QDBusConnection(Q_NULLPTR);
|
|
||||||
return QDBusConnection(_q_manager()->busConnection(SessionBus));
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1179,6 +1181,8 @@ QDBusConnection QDBusConnection::sessionBus()
|
|
||||||
*/
|
|
||||||
QDBusConnection QDBusConnection::systemBus()
|
|
||||||
{
|
|
||||||
+ if (_q_manager.isDestroyed())
|
|
||||||
+ return QDBusConnection(Q_NULLPTR);
|
|
||||||
return QDBusConnection(_q_manager()->busConnection(SystemBus));
|
|
||||||
}
|
|
||||||
|
|
||||||
diff --git a/src/dbus/qdbusintegrator.cpp b/src/dbus/qdbusintegrator.cpp
|
|
||||||
index 19f79e9..f8dc702 100644
|
|
||||||
--- a/src/dbus/qdbusintegrator.cpp
|
|
||||||
+++ b/src/dbus/qdbusintegrator.cpp
|
|
||||||
@@ -299,6 +299,9 @@ static void qDBusNewConnection(DBusServer *server, DBusConnection *connection, v
|
|
||||||
Q_ASSERT(connection);
|
|
||||||
Q_ASSERT(data);
|
|
||||||
|
|
||||||
+ if (!QDBusConnectionManager::instance())
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
// keep the connection alive
|
|
||||||
q_dbus_connection_ref(connection);
|
|
||||||
QDBusConnectionPrivate *serverConnection = static_cast<QDBusConnectionPrivate *>(data);
|
|
||||||
diff --git a/src/dbus/qdbusserver.cpp b/src/dbus/qdbusserver.cpp
|
|
||||||
index 027ce93..b1f9be2 100644
|
|
||||||
--- a/src/dbus/qdbusserver.cpp
|
|
||||||
+++ b/src/dbus/qdbusserver.cpp
|
|
||||||
@@ -68,7 +68,11 @@ QDBusServer::QDBusServer(const QString &address, QObject *parent)
|
|
||||||
if (!qdbus_loadLibDBus())
|
|
||||||
return;
|
|
||||||
|
|
||||||
- emit QDBusConnectionManager::instance()->serverRequested(address, this);
|
|
||||||
+ QDBusConnectionManager *instance = QDBusConnectionManager::instance();
|
|
||||||
+ if (!instance)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ emit instance->serverRequested(address, this);
|
|
||||||
QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
|
|
||||||
this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
|
|
||||||
}
|
|
||||||
@@ -93,7 +97,11 @@ QDBusServer::QDBusServer(QObject *parent)
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
- emit QDBusConnectionManager::instance()->serverRequested(address, this);
|
|
||||||
+ QDBusConnectionManager *instance = QDBusConnectionManager::instance();
|
|
||||||
+ if (!instance)
|
|
||||||
+ return;
|
|
||||||
+
|
|
||||||
+ emit instance->serverRequested(address, this);
|
|
||||||
QObject::connect(d, SIGNAL(newServerConnection(QDBusConnectionPrivate*)),
|
|
||||||
this, SLOT(_q_newConnection(QDBusConnectionPrivate*)), Qt::QueuedConnection);
|
|
||||||
}
|
|
||||||
--
|
|
||||||
2.9.3
|
|
||||||
|
|
@ -1,37 +0,0 @@
|
|||||||
diff -r -u a/config.tests/unix/ibase/ibase.cpp b/config.tests/unix/ibase/ibase.cpp
|
|
||||||
--- a/config.tests/unix/ibase/ibase.cpp 2017-01-18 15:20:58.000000000 +0100
|
|
||||||
+++ b/config.tests/unix/ibase/ibase.cpp 2017-01-27 11:19:39.894994134 +0100
|
|
||||||
@@ -37,7 +37,7 @@
|
|
||||||
**
|
|
||||||
****************************************************************************/
|
|
||||||
|
|
||||||
-#include <ibase.h>
|
|
||||||
+#include <firebird/ibase.h>
|
|
||||||
|
|
||||||
int main(int, char **)
|
|
||||||
{
|
|
||||||
diff -r -u a/src/plugins/sqldrivers/ibase/qsql_ibase_p.h b/src/plugins/sqldrivers/ibase/qsql_ibase_p.h
|
|
||||||
--- a/src/plugins/sqldrivers/ibase/qsql_ibase_p.h 2017-01-18 15:20:58.000000000 +0100
|
|
||||||
+++ b/src/plugins/sqldrivers/ibase/qsql_ibase_p.h 2017-01-27 11:29:10.169983782 +0100
|
|
||||||
@@ -52,7 +52,7 @@
|
|
||||||
//
|
|
||||||
|
|
||||||
#include <QtSql/qsqldriver.h>
|
|
||||||
-#include <ibase.h>
|
|
||||||
+#include <firebird/ibase.h>
|
|
||||||
|
|
||||||
#ifdef QT_PLUGIN
|
|
||||||
#define Q_EXPORT_SQLDRIVER_IBASE
|
|
||||||
diff -r -u a/src/sql/configure.json b/src/sql/configure.json
|
|
||||||
--- a/src/sql/configure.json 2017-01-18 15:20:58.000000000 +0100
|
|
||||||
+++ b/src/sql/configure.json 2017-01-27 11:23:31.186794680 +0100
|
|
||||||
@@ -51,7 +51,8 @@
|
|
||||||
"test": "unix/ibase",
|
|
||||||
"sources": [
|
|
||||||
{ "libs": "-lgds32_ms", "condition": "config.win32" },
|
|
||||||
- { "libs": "-lgds", "condition": "!config.win32" }
|
|
||||||
+ { "libs": "-lgds", "condition": "!config.win32" },
|
|
||||||
+ { "libs": "-lfbclient", "condition": "!config.win32" }
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"mysql": {
|
|
37
qt5-qtbase-5.9.1-firebird.patch
Normal file
37
qt5-qtbase-5.9.1-firebird.patch
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
diff -up qtbase-opensource-src-5.9.1/config.tests/unix/ibase/ibase.cpp.firebird qtbase-opensource-src-5.9.1/config.tests/unix/ibase/ibase.cpp
|
||||||
|
--- qtbase-opensource-src-5.9.1/config.tests/unix/ibase/ibase.cpp.firebird 2017-06-28 04:54:29.000000000 -0500
|
||||||
|
+++ qtbase-opensource-src-5.9.1/config.tests/unix/ibase/ibase.cpp 2017-07-16 08:28:47.833992502 -0500
|
||||||
|
@@ -37,7 +37,7 @@
|
||||||
|
**
|
||||||
|
****************************************************************************/
|
||||||
|
|
||||||
|
-#include <ibase.h>
|
||||||
|
+#include <firebird/ibase.h>
|
||||||
|
|
||||||
|
int main(int, char **)
|
||||||
|
{
|
||||||
|
diff -up qtbase-opensource-src-5.9.1/src/plugins/sqldrivers/configure.json.firebird qtbase-opensource-src-5.9.1/src/plugins/sqldrivers/configure.json
|
||||||
|
--- qtbase-opensource-src-5.9.1/src/plugins/sqldrivers/configure.json.firebird 2017-06-28 04:54:29.000000000 -0500
|
||||||
|
+++ qtbase-opensource-src-5.9.1/src/plugins/sqldrivers/configure.json 2017-07-16 12:38:43.730108724 -0500
|
||||||
|
@@ -50,7 +50,8 @@
|
||||||
|
"test": "unix/ibase",
|
||||||
|
"sources": [
|
||||||
|
{ "libs": "-lgds32_ms", "condition": "config.win32" },
|
||||||
|
- { "libs": "-lgds", "condition": "!config.win32" }
|
||||||
|
+ { "libs": "-lgds", "condition": "!config.win32" },
|
||||||
|
+ { "libs": "-lfbclient", "condition": "!config.win32" }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"mysql": {
|
||||||
|
diff -up qtbase-opensource-src-5.9.1/src/plugins/sqldrivers/ibase/qsql_ibase_p.h.firebird qtbase-opensource-src-5.9.1/src/plugins/sqldrivers/ibase/qsql_ibase_p.h
|
||||||
|
--- qtbase-opensource-src-5.9.1/src/plugins/sqldrivers/ibase/qsql_ibase_p.h.firebird 2017-06-28 04:54:29.000000000 -0500
|
||||||
|
+++ qtbase-opensource-src-5.9.1/src/plugins/sqldrivers/ibase/qsql_ibase_p.h 2017-07-16 08:28:47.833992502 -0500
|
||||||
|
@@ -52,7 +52,7 @@
|
||||||
|
//
|
||||||
|
|
||||||
|
#include <QtSql/qsqldriver.h>
|
||||||
|
-#include <ibase.h>
|
||||||
|
+#include <firebird/ibase.h>
|
||||||
|
|
||||||
|
#ifdef QT_PLUGIN
|
||||||
|
#define Q_EXPORT_SQLDRIVER_IBASE
|
@ -48,8 +48,8 @@ BuildRequires: pkgconfig(libsystemd)
|
|||||||
|
|
||||||
Name: qt5-qtbase
|
Name: qt5-qtbase
|
||||||
Summary: Qt5 - QtBase components
|
Summary: Qt5 - QtBase components
|
||||||
Version: 5.9.0
|
Version: 5.9.1
|
||||||
Release: 6%{?dist}
|
Release: 1%{?dist}
|
||||||
|
|
||||||
# See LGPL_EXCEPTIONS.txt, for exception details
|
# See LGPL_EXCEPTIONS.txt, for exception details
|
||||||
License: LGPLv2 with exceptions or GPLv3 with exceptions
|
License: LGPLv2 with exceptions or GPLv3 with exceptions
|
||||||
@ -99,14 +99,13 @@ Patch61: qt5-qtbase-cxxflag.patch
|
|||||||
Patch63: qt5-qtbase-5.7.1-openssl11.patch
|
Patch63: qt5-qtbase-5.7.1-openssl11.patch
|
||||||
|
|
||||||
# support firebird version 3.x
|
# support firebird version 3.x
|
||||||
Patch64: qt5-qtbase-5.8.0-firebird.patch
|
Patch64: qt5-qtbase-5.9.1-firebird.patch
|
||||||
|
|
||||||
# fix for new mariadb
|
# fix for new mariadb
|
||||||
Patch65: qtbase-opensource-src-5.9.0-mysql.patch
|
Patch65: qtbase-opensource-src-5.9.0-mysql.patch
|
||||||
|
|
||||||
## upstream patches (under review)
|
## upstream patches (5.9 branch)
|
||||||
# https://codereview.qt-project.org/#/c/180232/
|
Patch486: 0086-Fix-detection-of-AT-SPI.patch
|
||||||
Patch401: 0001-Merge-the-QDBusMetaType-s-custom-information-to-QDBu.patch
|
|
||||||
|
|
||||||
# Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires.
|
# Do not check any files in %%{_qt5_plugindir}/platformthemes/ for requires.
|
||||||
# Those themes are there for platform integration. If the required libraries are
|
# Those themes are there for platform integration. If the required libraries are
|
||||||
@ -124,6 +123,8 @@ BuildRequires: libjpeg-devel
|
|||||||
BuildRequires: libmng-devel
|
BuildRequires: libmng-devel
|
||||||
BuildRequires: libtiff-devel
|
BuildRequires: libtiff-devel
|
||||||
BuildRequires: pkgconfig(alsa)
|
BuildRequires: pkgconfig(alsa)
|
||||||
|
# required for -accessibility
|
||||||
|
BuildRequires: pkgconfig(atspi-2)
|
||||||
%if 0%{?use_clang}
|
%if 0%{?use_clang}
|
||||||
BuildRequires: clang >= 3.7.0
|
BuildRequires: clang >= 3.7.0
|
||||||
%endif
|
%endif
|
||||||
@ -336,8 +337,6 @@ Qt5 libraries used for drawing widgets and OpenGL items.
|
|||||||
%prep
|
%prep
|
||||||
%setup -q -n %{qt_module}-opensource-src-%{version}
|
%setup -q -n %{qt_module}-opensource-src-%{version}
|
||||||
|
|
||||||
%patch401 -p1 -b .0401
|
|
||||||
|
|
||||||
%patch4 -p1 -b .QTBUG-35459
|
%patch4 -p1 -b .QTBUG-35459
|
||||||
|
|
||||||
%patch50 -p1 -b .QT_VERSION_CHECK
|
%patch50 -p1 -b .QT_VERSION_CHECK
|
||||||
@ -350,6 +349,8 @@ Qt5 libraries used for drawing widgets and OpenGL items.
|
|||||||
%patch64 -p1 -b .firebird
|
%patch64 -p1 -b .firebird
|
||||||
%patch65 -p1 -b .mysql
|
%patch65 -p1 -b .mysql
|
||||||
|
|
||||||
|
%patch486 -p1 -b .0086
|
||||||
|
|
||||||
%if 0%{?inject_optflags}
|
%if 0%{?inject_optflags}
|
||||||
## adjust $RPM_OPT_FLAGS
|
## adjust $RPM_OPT_FLAGS
|
||||||
|
|
||||||
@ -586,6 +587,7 @@ cat >>${privat_header_file}<<EOF
|
|||||||
#endif
|
#endif
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
|
||||||
%check
|
%check
|
||||||
%if 0%{?tests}
|
%if 0%{?tests}
|
||||||
## see tests/README for expected environment (running a plasma session essentially)
|
## see tests/README for expected environment (running a plasma session essentially)
|
||||||
@ -963,6 +965,9 @@ fi
|
|||||||
|
|
||||||
|
|
||||||
%changelog
|
%changelog
|
||||||
|
* Wed Jul 19 2017 Rex Dieter <rdieter@fedoraproject.org> - 5.9.1-1
|
||||||
|
- 5.9.1
|
||||||
|
|
||||||
* Tue Jul 18 2017 Than Ngo <than@redhat.com> - 5.9.0-6
|
* Tue Jul 18 2017 Than Ngo <than@redhat.com> - 5.9.0-6
|
||||||
- fixed bz#1442553, multilib issue
|
- fixed bz#1442553, multilib issue
|
||||||
|
|
||||||
|
3
sources
3
sources
@ -1 +1,2 @@
|
|||||||
SHA512 (qtbase-opensource-src-5.9.0.tar.xz) = 15b921c26dbedc7c339a5e1a235255a18b66fa53ac8af6f2d1ad64d939f1fee9817c8f115eac9a417ed0d2f832fb895b29acc61e393c97415447a067ea031be7
|
SHA512 (qtbase-opensource-src-5.9.1.tar.xz) = b384e91b3fd88b2f32e826e3dd1c930213683a0fdbfd284a319204fa8d27c796b54324cf4a715f6bebd92fca6426e37cf0be5866fc1f6053b8758570ddb2fa45
|
||||||
|
SHA512 (0086-Fix-detection-of-AT-SPI.patch) = f78f481369e4b68400ae122a7cf4d20030ee8ea89ea211f98f5ffa895d449acd9a7207d3b010e927a7a33d644eab90e1d5bb951d71e1a5b1a11f4ac1a0241bce
|
||||||
|
Loading…
Reference in New Issue
Block a user