From e86b3b1c04f0abff92aeb752f3a5b8c9842d6934 Mon Sep 17 00:00:00 2001 From: Alex Blasche Date: Fri, 20 Sep 2013 10:05:27 +0200 Subject: Simplify QBluetoothTransferManager code. QBluetoothTransferManager implementation is very simple. There is no need for three individual files. Change-Id: Ia205f96c4b59366f6b9613a7b45f2836a93a03e6 Reviewed-by: Fabian Bumberger Reviewed-by: Alex Blasche --- src/bluetooth/bluetooth.pro | 7 +-- src/bluetooth/qbluetoothtransfermanager.cpp | 24 ++++++++++ src/bluetooth/qbluetoothtransfermanager_bluez.cpp | 57 ----------------------- src/bluetooth/qbluetoothtransfermanager_p.cpp | 56 ---------------------- src/bluetooth/qbluetoothtransfermanager_qnx.cpp | 55 ---------------------- 5 files changed, 26 insertions(+), 173 deletions(-) delete mode 100644 src/bluetooth/qbluetoothtransfermanager_bluez.cpp delete mode 100644 src/bluetooth/qbluetoothtransfermanager_p.cpp delete mode 100644 src/bluetooth/qbluetoothtransfermanager_qnx.cpp diff --git a/src/bluetooth/bluetooth.pro b/src/bluetooth/bluetooth.pro index 1415b851..ebf6f500 100644 --- a/src/bluetooth/bluetooth.pro +++ b/src/bluetooth/bluetooth.pro @@ -70,8 +70,7 @@ config_bluez:qtHaveModule(dbus) { qbluetoothsocket_bluez.cpp \ qbluetoothserver_bluez.cpp \ qbluetoothlocaldevice_bluez.cpp \ - qbluetoothtransferreply_bluez.cpp \ - qbluetoothtransfermanager_bluez.cpp + qbluetoothtransferreply_bluez.cpp } else:qnx{ DEFINES += QT_QNX_BLUETOOTH #BT_BBPPSDEBUG @@ -88,7 +87,6 @@ config_bluez:qtHaveModule(dbus) { qbluetoothservicediscoveryagent_qnx.cpp \ qbluetoothsocket_qnx.cpp \ qbluetoothserver_qnx.cpp \ - qbluetoothtransfermanager_qnx.cpp \ qbluetoothtransferreply_qnx.cpp } else { @@ -100,8 +98,7 @@ config_bluez:qtHaveModule(dbus) { qbluetoothserviceinfo_p.cpp \ qbluetoothservicediscoveryagent_p.cpp \ qbluetoothsocket_p.cpp \ - qbluetoothserver_p.cpp \ - qbluetoothtransfermanager_p.cpp + qbluetoothserver_p.cpp } diff --git a/src/bluetooth/qbluetoothtransfermanager.cpp b/src/bluetooth/qbluetoothtransfermanager.cpp index 6b3dd89f..ffb4862c 100644 --- a/src/bluetooth/qbluetoothtransfermanager.cpp +++ b/src/bluetooth/qbluetoothtransfermanager.cpp @@ -41,6 +41,13 @@ #include "qbluetoothtransfermanager.h" #include "qbluetoothtransferrequest.h" +#include "qbluetoothtransferreply.h" +#ifdef QT_BLUEZ_BLUETOOTH +#include "qbluetoothtransferreply_bluez_p.h" +#elif QT_QNX_BLUETOOTH +#include "qbluetoothtransferreply_qnx_p.h" +#else +#endif QT_BEGIN_NAMESPACE @@ -83,6 +90,23 @@ QBluetoothTransferManager::~QBluetoothTransferManager() { } +QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, + QIODevice *data) +{ +#ifdef QT_BLUEZ_BLUETOOTH + QBluetoothTransferReplyBluez *rep = new QBluetoothTransferReplyBluez(data, request, this); + connect(rep, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); + return rep; +#elif QT_QNX_BLUETOOTH + QBluetoothTransferReplyQnx *reply = new QBluetoothTransferReplyQnx(data, request, this); + connect(reply, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); + return reply; +#else + Q_UNUSED(request); + Q_UNUSED(data); + return 0; +#endif +} #include "moc_qbluetoothtransfermanager.cpp" QT_END_NAMESPACE diff --git a/src/bluetooth/qbluetoothtransfermanager_bluez.cpp b/src/bluetooth/qbluetoothtransfermanager_bluez.cpp deleted file mode 100644 index a6fce5d4..00000000 --- a/src/bluetooth/qbluetoothtransfermanager_bluez.cpp +++ /dev/null @@ -1,57 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qbluetoothtransfermanager.h" -#include "qbluetoothtransferrequest.h" -#include "qbluetoothtransferreply.h" -#include "qbluetoothtransferreply_bluez_p.h" - -QT_BEGIN_NAMESPACE - -QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, - QIODevice *data) -{ - QBluetoothTransferReplyBluez *rep = new QBluetoothTransferReplyBluez(data, request, this); - connect(rep, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); - return rep; -} - -QT_END_NAMESPACE diff --git a/src/bluetooth/qbluetoothtransfermanager_p.cpp b/src/bluetooth/qbluetoothtransfermanager_p.cpp deleted file mode 100644 index 561a0c32..00000000 --- a/src/bluetooth/qbluetoothtransfermanager_p.cpp +++ /dev/null @@ -1,56 +0,0 @@ -/**************************************************************************** -** -** Copyright (C) 2013 Digia Plc and/or its subsidiary(-ies). -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qbluetoothtransfermanager.h" -#include "qbluetoothtransferrequest.h" -#include "qbluetoothtransferreply.h" - -QT_BEGIN_NAMESPACE - -QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, - QIODevice *data) -{ - Q_UNUSED(request); - Q_UNUSED(data); - return 0; -} - -QT_END_NAMESPACE diff --git a/src/bluetooth/qbluetoothtransfermanager_qnx.cpp b/src/bluetooth/qbluetoothtransfermanager_qnx.cpp deleted file mode 100644 index 8a9d7a3c..00000000 --- a/src/bluetooth/qbluetoothtransfermanager_qnx.cpp +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** -** -** Copyright (C) 2013 Research In Motion -** Contact: http://www.qt-project.org/legal -** -** This file is part of the QtBluetooth module of the Qt Toolkit. -** -** $QT_BEGIN_LICENSE:LGPL$ -** Commercial License Usage -** Licensees holding valid commercial Qt licenses may use this file in -** accordance with the commercial license agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. For licensing terms and -** conditions see http://qt.digia.com/licensing. For further information -** use the contact form at http://qt.digia.com/contact-us. -** -** GNU Lesser General Public License Usage -** Alternatively, this file may be used under the terms of the GNU Lesser -** General Public License version 2.1 as published by the Free Software -** Foundation and appearing in the file LICENSE.LGPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU Lesser General Public License version 2.1 requirements -** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. -** -** In addition, as a special exception, Digia gives you certain additional -** rights. These rights are described in the Digia Qt LGPL Exception -** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. -** -** GNU General Public License Usage -** Alternatively, this file may be used under the terms of the GNU -** General Public License version 3.0 as published by the Free Software -** Foundation and appearing in the file LICENSE.GPL included in the -** packaging of this file. Please review the following information to -** ensure the GNU General Public License version 3.0 requirements will be -** met: http://www.gnu.org/copyleft/gpl.html. -** -** -** $QT_END_LICENSE$ -** -****************************************************************************/ - -#include "qbluetoothtransferreply_qnx_p.h" -#include - -QT_BEGIN_NAMESPACE - -QBluetoothTransferReply *QBluetoothTransferManager::put(const QBluetoothTransferRequest &request, - QIODevice *data) -{ - QBluetoothTransferReplyQnx *reply = new QBluetoothTransferReplyQnx(data, request, this); - connect(reply, SIGNAL(finished(QBluetoothTransferReply*)), this, SIGNAL(finished(QBluetoothTransferReply*))); - return reply; -} - -QT_END_NAMESPACE -- cgit v1.2.3