diff options
author | Alex Blasche <alexander.blasche@theqtcompany.com> | 2015-11-27 10:19:02 +0100 |
---|---|---|
committer | Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> | 2015-11-30 11:06:41 +0000 |
commit | 741f5e26cd618aeff349dd612516148b50c85dde (patch) | |
tree | 99d1f78443a2dc34b6b3fcce32e46f2c9834a4aa /src/bluetooth/qbluetoothlocaldevice.cpp | |
parent | 2d9c73c35b99453f8f36f9dcc4a4f6a8856d7877 (diff) |
Don't register meta types during static init time5.5
The QMetaType register my not be up and running by the time
we attempt these meta type registration.
Change-Id: I1a857a936a24b4b00a49574fac311c08c09b3d5a
Task-number: QTBUG-49455
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com>
Diffstat (limited to 'src/bluetooth/qbluetoothlocaldevice.cpp')
-rw-r--r-- | src/bluetooth/qbluetoothlocaldevice.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/bluetooth/qbluetoothlocaldevice.cpp b/src/bluetooth/qbluetoothlocaldevice.cpp index 0eb97647..ddbce02b 100644 --- a/src/bluetooth/qbluetoothlocaldevice.cpp +++ b/src/bluetooth/qbluetoothlocaldevice.cpp @@ -97,20 +97,17 @@ QT_BEGIN_NAMESPACE */ -namespace { -class LocalDeviceRegisterMetaTypes +void registerQBluetoothLocalDeviceMetaType() { -public: - LocalDeviceRegisterMetaTypes() - { + static bool initDone = false; + if (!initDone) { qRegisterMetaType<QBluetoothLocalDevice::HostMode>(); qRegisterMetaType<QBluetoothLocalDevice::Pairing>(); qRegisterMetaType<QBluetoothLocalDevice::Error>(); + initDone = true; } -} _registerLocalDeviceMetaTypes; } - #ifndef QT_OSX_BLUETOOTH /*! |