summaryrefslogtreecommitdiff
path: root/core/obex/btobex.cpp
Side-by-side diff
Diffstat (limited to 'core/obex/btobex.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/btobex.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/core/obex/btobex.cpp b/core/obex/btobex.cpp
index 212a084..4e078b0 100644
--- a/core/obex/btobex.cpp
+++ b/core/obex/btobex.cpp
@@ -20,97 +20,97 @@
 -.   .:....=;==+<; You should have received a copy of the GNU
  -_. . .   )=.  = Library General Public License along with
  --        :-= this library; see the file COPYING.LIB.
If not, write to the Free Software Foundation,
Inc., 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA.
*/
/*
* The Bluetooth OBEX manipulating class implementation
*/
#include "btobex.h"
#include <manager.h>
#include <services.h>
/* OPIE */
#include <opie2/oprocess.h>
#include <opie2/odebug.h>
/* QT */
#include <qfileinfo.h>
#include <qstring.h>
#include <qmap.h>
#include <qmessagebox.h>
using namespace OpieObex;
using namespace Opie::Core;
/* TRANSLATOR OpieObex::Obex */
using namespace OpieTooth;
BtObex::BtObex( QObject *parent, const char* name )
: ObexBase(parent, name )
{
m_rec = 0;
m_send=0;
btManager = NULL;
};
BtObex::~BtObex() {
delete btManager;
delete m_rec;
delete m_send;
}
void BtObex::receive() {
ObexBase::receive();
- m_rec = new ObexServer();
+ m_rec = new ObexServer(OBEX_TRANS_BLUETOOTH);
odebug << "BT OBEX do receive" << oendl;
// TODO mbhaynie: No idea if this actually works -- maybe opd is better.
// connect to the necessary slots
connect(m_rec, SIGNAL(processExited(Opie::Core::OProcess*) ),
this, SLOT(slotExited(Opie::Core::OProcess*) ) );
connect(m_rec, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ),
this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) );
if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) {
emit done( false );
delete m_rec;
m_rec = 0;
}
}
void BtObex::send( const QString& fileName, const QString& bdaddr) {
ObexBase::send(fileName, bdaddr);
// if currently receiving stop it send receive
if (m_send != 0) {
if (m_send->isSending())
return;
else {
delete m_send;
m_send = 0;
}
}
if (m_rec != 0 ) {
if (m_rec->isRunning() ) {
emit error(-1 );
delete m_rec;
m_rec = 0;
}else{
emit error( -1 ); // we did not delete yet but it's not running slotExited is pending
return;
}
}
//Now we need to find out if the OBEX push is supported for this device
//And get the port number
if (!btManager) {
btManager = new Manager("hci0");
connect(btManager,
SIGNAL(foundServices(const QString&, Services::ValueList)),
this, SLOT(slotFoundServices(const QString&, Services::ValueList)));
}
btManager->searchServices(bdaddr);