summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlex Blasche <alexander.blasche@theqtcompany.com>2015-01-16 16:25:21 +0100
committerAlex Blasche <alexander.blasche@theqtcompany.com>2015-01-28 07:48:17 +0000
commit3402cb8695aee2625eee8a4a4a96f81511c820e8 (patch)
tree8185a533b406cc961da18a9fc58b4da66a08a78a
parentfd88da6bf12c7c8edfd6c3d44cc641aed7477f0b (diff)
Optimize qRegisterMetaType() calls for QBluetoothTransferReply
This reduces the number of registration calls since a QBluetoothTransferManager is created once or twice whereas multiple QBluetoothTransferReply instances are common. Change-Id: I14bc636cb91d9bd399d8dae55140808ec6bf7fe5 Reviewed-by: Timur Pocheptsov <Timur.Pocheptsov@digia.com> Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
-rw-r--r--src/bluetooth/qbluetoothtransfermanager.cpp2
-rw-r--r--src/bluetooth/qbluetoothtransferreply.cpp2
-rw-r--r--tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp1
3 files changed, 2 insertions, 3 deletions
diff --git a/src/bluetooth/qbluetoothtransfermanager.cpp b/src/bluetooth/qbluetoothtransfermanager.cpp
index 65eecae3..ea2406f1 100644
--- a/src/bluetooth/qbluetoothtransfermanager.cpp
+++ b/src/bluetooth/qbluetoothtransfermanager.cpp
@@ -90,6 +90,8 @@ QT_BEGIN_NAMESPACE
QBluetoothTransferManager::QBluetoothTransferManager(QObject *parent)
: QObject(parent)
{
+ qRegisterMetaType<QBluetoothTransferReply*>();
+ qRegisterMetaType<QBluetoothTransferReply::TransferError>();
}
/*!
diff --git a/src/bluetooth/qbluetoothtransferreply.cpp b/src/bluetooth/qbluetoothtransferreply.cpp
index af1bf828..a40e7191 100644
--- a/src/bluetooth/qbluetoothtransferreply.cpp
+++ b/src/bluetooth/qbluetoothtransferreply.cpp
@@ -118,8 +118,6 @@ void QBluetoothTransferReply::abort()
QBluetoothTransferReply::QBluetoothTransferReply(QObject *parent)
: QObject(parent), d_ptr(new QBluetoothTransferReplyPrivate())
{
- qRegisterMetaType<QBluetoothTransferReply*>();
- qRegisterMetaType<QBluetoothTransferReply::TransferError>();
}
/*!
diff --git a/tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp b/tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp
index b3b80e5e..b3271a5d 100644
--- a/tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp
+++ b/tests/auto/qbluetoothtransfermanager/tst_qbluetoothtransfermanager.cpp
@@ -92,7 +92,6 @@ private:
tst_QBluetoothTransferManager::tst_QBluetoothTransferManager()
{
- qRegisterMetaType<QBluetoothTransferReply*>();
}
tst_QBluetoothTransferManager::~tst_QBluetoothTransferManager()