summaryrefslogtreecommitdiffstats
path: root/src/bluetooth/qbluetoothuuid.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/bluetooth/qbluetoothuuid.cpp')
-rw-r--r--src/bluetooth/qbluetoothuuid.cpp29
1 files changed, 18 insertions, 11 deletions
diff --git a/src/bluetooth/qbluetoothuuid.cpp b/src/bluetooth/qbluetoothuuid.cpp
index cfce871c..3c8dc786 100644
--- a/src/bluetooth/qbluetoothuuid.cpp
+++ b/src/bluetooth/qbluetoothuuid.cpp
@@ -311,7 +311,7 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34
\value DescriptorValueChanged This characteristic is related to the Environmental Sensing Service.
\value DeviceName The Device Name characteristic contains the name of the device.
\value DewPoint This characteristic states the dew point in degree Celsius.
- \value DSTOffset The DST Offset characteristic describes the offset employed by the daylight saving time.
+ \value DSTOffset The DST Offset characteristic describes the offset employed by daylight-saving time.
\value Elevation The Elevation characteristic states the elevation above/below sea level.
\value EmailAddress This characteristic states the email of the user.
\value ExactTime256 The Exact Time 256 characteristic describes the data, day and time
@@ -497,16 +497,13 @@ Q_GLOBAL_STATIC_WITH_ARGS(QUuid, baseUuid, ("{00000000-0000-1000-8000-00805F9B34
\value UnknownDescriptorType The descriptor type is unknown.
*/
-namespace
+static void registerQBluetoothUuidMetaType()
{
- class BtUuidRegisterMetaTypes
- {
- public:
- BtUuidRegisterMetaTypes()
- {
- qRegisterMetaType<QBluetoothUuid>();
- }
- } _registerBtUuidMetaTypes;
+ static bool initDone = false;
+ if (!initDone) {
+ qRegisterMetaType<QBluetoothUuid>();
+ initDone = true;
+ }
}
/*!
@@ -514,6 +511,7 @@ namespace
*/
QBluetoothUuid::QBluetoothUuid()
{
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -525,6 +523,7 @@ QBluetoothUuid::QBluetoothUuid(ProtocolUuid uuid)
baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
baseUuid()->data4[6], baseUuid()->data4[7])
{
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -535,6 +534,7 @@ QBluetoothUuid::QBluetoothUuid(ServiceClassUuid uuid)
baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
baseUuid()->data4[6], baseUuid()->data4[7])
{
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -546,6 +546,7 @@ QBluetoothUuid::QBluetoothUuid(CharacteristicType uuid)
baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
baseUuid()->data4[6], baseUuid()->data4[7])
{
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -557,7 +558,7 @@ QBluetoothUuid::QBluetoothUuid(DescriptorType uuid)
baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
baseUuid()->data4[6], baseUuid()->data4[7])
{
-
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -568,6 +569,7 @@ QBluetoothUuid::QBluetoothUuid(quint16 uuid)
baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
baseUuid()->data4[6], baseUuid()->data4[7])
{
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -578,6 +580,7 @@ QBluetoothUuid::QBluetoothUuid(quint32 uuid)
baseUuid()->data4[2], baseUuid()->data4[3], baseUuid()->data4[4], baseUuid()->data4[5],
baseUuid()->data4[6], baseUuid()->data4[7])
{
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -587,6 +590,7 @@ QBluetoothUuid::QBluetoothUuid(quint32 uuid)
*/
QBluetoothUuid::QBluetoothUuid(quint128 uuid)
{
+ registerQBluetoothUuidMetaType();
QT_WARNING_PUSH
QT_WARNING_DISABLE_GCC("-Wstrict-aliasing")
data1 = qFromBigEndian<quint32>(*reinterpret_cast<quint32 *>(&uuid.data[0]));
@@ -605,6 +609,7 @@ QT_WARNING_POP
QBluetoothUuid::QBluetoothUuid(const QString &uuid)
: QUuid(uuid)
{
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -613,6 +618,7 @@ QBluetoothUuid::QBluetoothUuid(const QString &uuid)
QBluetoothUuid::QBluetoothUuid(const QBluetoothUuid &uuid)
: QUuid(uuid)
{
+ registerQBluetoothUuidMetaType();
}
/*!
@@ -621,6 +627,7 @@ QBluetoothUuid::QBluetoothUuid(const QBluetoothUuid &uuid)
QBluetoothUuid::QBluetoothUuid(const QUuid &uuid)
: QUuid(uuid)
{
+ registerQBluetoothUuidMetaType();
}
/*!