author | zecke <zecke> | 2003-02-18 20:42:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-18 20:42:05 (UTC) |
commit | d3f15e100af8a91504ac9e5fb95dce0cadfe4837 (patch) (side-by-side diff) | |
tree | 04ddeda0f690aa1d51ba486b114251250eef2ef9 /core/obex/obex.cc | |
parent | 9f5098a6da637e81f6525482456394a68524dc61 (diff) | |
download | opie-d3f15e100af8a91504ac9e5fb95dce0cadfe4837.zip opie-d3f15e100af8a91504ac9e5fb95dce0cadfe4837.tar.gz opie-d3f15e100af8a91504ac9e5fb95dce0cadfe4837.tar.bz2 |
Convert the way of storing the devices in the QTextBrowser
we assign ids by now
it looks soo nice... but it counts up tries and then say there was a failure
but it is working though
-rw-r--r-- | core/obex/obex.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/core/obex/obex.cc b/core/obex/obex.cc index b8ed6e0..595fed9 100644 --- a/core/obex/obex.cc +++ b/core/obex/obex.cc @@ -1,11 +1,14 @@ #include <qapplication.h> #include <qfile.h> -#include <qmessagebox.h> +#include <qfileinfo.h> +#include <qtextcodec.h> + #include <qpe/qcopenvelope_qws.h> + #include <opie/oprocess.h> #include "obex.h" using namespace OpieObex; Obex::Obex( QObject *parent, const char* name ) @@ -103,22 +106,35 @@ void Obex::slotExited(OProcess* proc ){ }else if ( proc == m_send ) { sendEnd(); } } void Obex::slotStdOut(OProcess* proc, char* buf, int len){ if ( proc == m_rec ) { // only receive - QString str = QString::fromUtf8( buf, len ); - m_outp.append( str ); + for (int i = 0; i < len; i++ ) { + printf("%c", buf[i] ); + } + printf("\n"); + 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; |