summaryrefslogtreecommitdiff
path: root/core/obex/obex.cc
Side-by-side diff
Diffstat (limited to 'core/obex/obex.cc') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/obex.cc15
1 files changed, 3 insertions, 12 deletions
diff --git a/core/obex/obex.cc b/core/obex/obex.cc
index 595fed9..2a306de 100644
--- a/core/obex/obex.cc
+++ b/core/obex/obex.cc
@@ -2,24 +2,26 @@
#include <qapplication.h>
#include <qfile.h>
#include <qfileinfo.h>
#include <qtextcodec.h>
#include <qpe/qcopenvelope_qws.h>
#include <opie/oprocess.h>
#include "obex.h"
using namespace OpieObex;
+/* 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) ),
SLOT(slotError() ) );
};
@@ -100,47 +102,36 @@ void Obex::sendNow(){
emit currentTry( m_count );
}
void Obex::slotExited(OProcess* proc ){
if (proc == m_rec ) { // receive process
received();
}else if ( proc == m_send ) {
sendEnd();
}
}
void Obex::slotStdOut(OProcess* proc, char* buf, int len){
if ( proc == m_rec ) { // only receive
- for (int i = 0; i < len; i++ ) {
- printf("%c", buf[i] );
- }
- printf("\n");
- QByteArray ar( len );
+ QByteArray ar( len );
memcpy( ar.data(), buf, len );
qWarning("parsed: %s", ar.data() );
m_outp.append( ar );
}
}
void Obex::received() {
if (m_rec->normalExit() ) {
if ( m_rec->exitStatus() == 0 ) { // we got one
QString filename = parseOut();
qWarning("ACHTUNG %s", filename.latin1() );
- if (filename.contains( 'ö' ) || filename.contains( 'ä' ) || filename.contains('ü' ) ) {
- qWarning("renaming!!!!");
- QFileInfo inf( filename );
- QString newName = "/tmp/opie-obex." + inf.extension();
- ::rename( QFile::encodeName( filename ).data(), newName );
- qWarning("name is %s", QFile::encodeName( filename ).data() );
- }
emit receivedFile( filename );
}
}else{
emit done(false);
};
delete m_rec;
m_rec = 0;
receive();
}
void Obex::sendEnd() {
if (m_send->normalExit() ) {