1
/***************************************************************************
2
* This file is part of the KDE project *
4
* Copyright (C) 2010 Alejandro Fiestas Olivares <alex@ufocoders.com> *
5
* Copyright (C) 2010 UFO Coders <info@ufocoders.com> *
7
* This program is free software; you can redistribute it and/or modify *
8
* it under the terms of the GNU General Public License as published by *
9
* the Free Software Foundation; either version 2 of the License, or *
10
* (at your option) any later version. *
12
* This program is distributed in the hope that it will be useful, *
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
15
* GNU General Public License for more details. *
17
* You should have received a copy of the GNU General Public License *
18
* along with this program; if not, write to the *
19
* Free Software Foundation, Inc., *
20
* 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA *
21
***************************************************************************/
23
#include "obexagent.h"
24
#include "obex_transfer.h"
26
#include <QtCore/QDebug>
28
#include <QDBusConnection>
29
#include <QDBusPendingCall>
30
#include <QDBusMessage>
32
ObexAgent::ObexAgent(QObject* parent): QDBusAbstractAdaptor(parent)
35
if (!QDBusConnection::sessionBus().registerObject("/BlueDevil_sendAgent", parent)) {
36
qDebug() << "The dbus object can't be registered";
41
void ObexAgent::Release() const
45
QString ObexAgent::Request(QDBusObjectPath transfer)
47
OrgOpenobexTransferInterface *transferObj = new OrgOpenobexTransferInterface("org.openobex.client", transfer.path(), QDBusConnection::sessionBus());
49
if (m_killed == true) {
50
transferObj->Cancel();
53
emit request(transferObj);
57
void ObexAgent::Progress(QDBusObjectPath transfer, quint64 transferred)
60
Q_UNUSED(transferred);
62
emit progress(transfer, transferred);
66
void ObexAgent::Complete(QDBusObjectPath transfer)
70
emit completed(transfer);
73
void ObexAgent::Error(QDBusObjectPath transfer, const QString& message)
78
emit error(transfer, message);
81
void ObexAgent::setKilled()
b'\\ No newline at end of file'