summaryrefslogtreecommitdiff
path: root/core/obex
Side-by-side diff
Diffstat (limited to 'core/obex') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/config.in2
-rw-r--r--core/obex/obex.cc19
-rw-r--r--core/obex/obex.h10
-rw-r--r--core/obex/obex.pro4
-rw-r--r--core/obex/obeximpl.cpp2
5 files changed, 20 insertions, 17 deletions
diff --git a/core/obex/config.in b/core/obex/config.in
index ef09f7a..c0208d1 100644
--- a/core/obex/config.in
+++ b/core/obex/config.in
@@ -1,4 +1,4 @@
config OBEX
boolean "libopieobex0 (library needed for beaming in Opie)"
default "y"
- depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIE
+ depends ( LIBQPE || LIBQPE-X11 ) && LIBOPIECORE2
diff --git a/core/obex/obex.cc b/core/obex/obex.cc
index 50e5201..3c99af6 100644
--- a/core/obex/obex.cc
+++ b/core/obex/obex.cc
@@ -1,21 +1,22 @@
#include <qfileinfo.h>
-#include <opie/oprocess.h>
+#include <opie2/oprocess.h>
#include "obex.h"
using namespace OpieObex;
+using namespace Opie::Core;
/* TRANSLATOR OpieObex::Obex */
Obex::Obex( QObject *parent, const char* name )
: QObject(parent, name )
{
m_rec = 0;
m_send=0;
m_count = 0;
m_receive = false;
connect( this, SIGNAL(error(int) ), // for recovering to receive
SLOT(slotError() ) );
connect( this, SIGNAL(sent(bool) ),
@@ -23,29 +24,29 @@ Obex::Obex( QObject *parent, const char* name )
};
Obex::~Obex() {
delete m_rec;
delete m_send;
}
void Obex::receive() {
m_receive = true;
m_outp = QString::null;
qWarning("Receive" );
m_rec = new OProcess();
*m_rec << "irobex_palm3";
// connect to the necessary slots
- connect(m_rec, SIGNAL(processExited(OProcess*) ),
- this, SLOT(slotExited(OProcess*) ) );
+ connect(m_rec, SIGNAL(processExited(Opie::Core::OProcess*) ),
+ this, SLOT(slotExited(Opie::Core::OProcess*) ) );
- connect(m_rec, SIGNAL(receivedStdout(OProcess*, char*, int ) ),
- this, SLOT(slotStdOut(OProcess*, char*, int) ) );
+ 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) ) {
qWarning("could not start :(");
emit done( false );
delete m_rec;
m_rec = 0;
}
// emit currentTry(m_count );
}
void Obex::send( const QString& fileName) { // if currently receiving stop it send receive
m_count = 0;
@@ -71,28 +72,28 @@ void Obex::sendNow(){
qWarning("sendNow");
if ( m_count >= 25 ) { // could not send
emit error(-1 );
emit sent(false);
return;
}
// OProcess inititialisation
m_send = new OProcess();
*m_send << "irobex_palm3";
*m_send << QFile::encodeName(m_file);
// connect to slots Exited and and StdOut
- connect(m_send, SIGNAL(processExited(OProcess*) ),
- this, SLOT(slotExited(OProcess*)) );
- connect(m_send, SIGNAL(receivedStdout(OProcess*, char*, int )),
- this, SLOT(slotStdOut(OProcess*, char*, int) ) );
+ connect(m_send, SIGNAL(processExited(Opie::Core::OProcess*) ),
+ this, SLOT(slotExited(Opie::Core::OProcess*)) );
+ connect(m_send, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int )),
+ this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) );
// now start it
if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) {
qWarning("could not send" );
m_count = 25;
emit error(-1 );
delete m_send;
m_send=0;
}
// end
m_count++;
emit currentTry( m_count );
diff --git a/core/obex/obex.h b/core/obex/obex.h
index 60f5d28..284cb12 100644
--- a/core/obex/obex.h
+++ b/core/obex/obex.h
@@ -1,20 +1,20 @@
#ifndef OpieObex_H
#define OpieObex_H
#include <qobject.h>
-class OProcess;
+namespace Opie {namespace Core {class OProcess;}}
class QCopChannel;
namespace OpieObex {
class Obex : public QObject {
Q_OBJECT
public:
/**
* Obex c'tor look
*/
Obex( QObject *parent, const char* name);
/**
* d'tor
*/
@@ -44,40 +44,40 @@ namespace OpieObex {
*/
void currentTry(unsigned int);
/**
* signal sent The file got beamed to the remote location
*/
void sent(bool);
void done(bool);
private:
uint m_count;
QString m_file;
QString m_outp;
- OProcess *m_send;
- OProcess *m_rec;
+ Opie::Core::OProcess *m_send;
+ Opie::Core::OProcess *m_rec;
bool m_receive : 1;
void shutDownReceive();
private slots:
/**
* send over palm obex
*/
//void send(const QString&);
// the process exited
- void slotExited(OProcess* proc) ;
- void slotStdOut(OProcess*, char*, int);
+ void slotExited(Opie::Core::OProcess* proc) ;
+ void slotStdOut(Opie::Core::OProcess*, char*, int);
void slotError();
private:
void sendNow();
QString parseOut();
void received();
void sendEnd();
};
};
diff --git a/core/obex/obex.pro b/core/obex/obex.pro
index a296b2c..51fa300 100644
--- a/core/obex/obex.pro
+++ b/core/obex/obex.pro
@@ -1,13 +1,13 @@
TEMPLATE = lib
CONFIG += qt warn_on release
-HEADERS = obex.h obexhandler.h obexsend.h receiver.h
-SOURCES = obex.cc obexsend.cpp obexhandler.cpp receiver.cpp
+HEADERS = obex.h obexhandler.h obexsend.h receiver.h obeximpl.h
+SOURCES = obex.cc obexsend.cpp obexhandler.cpp receiver.cpp obeximpl.cpp
TARGET = opieobex
DESTDIR = $(OPIEDIR)/plugins/obex
INCLUDEPATH += $(OPIEDIR)/include $(OPIEDIR)/core/launcher
DEPENDPATH += ../$(OPIEDIR)/include
LIBS += -lqpe -lopiecore2
VERSION = 0.0.2
include ( $(OPIEDIR)/include.pro )
target.path = $$prefix/plugins/applets
diff --git a/core/obex/obeximpl.cpp b/core/obex/obeximpl.cpp
index 5b53644..ca6ce7b 100644
--- a/core/obex/obeximpl.cpp
+++ b/core/obex/obeximpl.cpp
@@ -1,15 +1,17 @@
#include "obexhandler.h"
#include "obeximpl.h"
+
+
using namespace OpieObex;
/* TRANSLATOR OpieObex::ObexImpl */
ObexImpl::ObexImpl() {
m_handler = new ObexHandler;
}
ObexImpl::~ObexImpl() {
delete m_handler;
}
QRESULT ObexImpl::queryInterface( const QUuid& uuid, QUnknownInterface **iface ) {
*iface = 0;