author | zecke <zecke> | 2003-02-18 20:42:05 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-18 20:42:05 (UTC) |
commit | d3f15e100af8a91504ac9e5fb95dce0cadfe4837 (patch) (unidiff) | |
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 @@ | |||
1 | 1 | ||
2 | #include <qapplication.h> | 2 | #include <qapplication.h> |
3 | #include <qfile.h> | 3 | #include <qfile.h> |
4 | #include <qmessagebox.h> | 4 | #include <qfileinfo.h> |
5 | #include <qtextcodec.h> | ||
6 | |||
5 | #include <qpe/qcopenvelope_qws.h> | 7 | #include <qpe/qcopenvelope_qws.h> |
8 | |||
6 | #include <opie/oprocess.h> | 9 | #include <opie/oprocess.h> |
7 | #include "obex.h" | 10 | #include "obex.h" |
8 | 11 | ||
9 | using namespace OpieObex; | 12 | using namespace OpieObex; |
10 | 13 | ||
11 | Obex::Obex( QObject *parent, const char* name ) | 14 | Obex::Obex( QObject *parent, const char* name ) |
@@ -103,22 +106,35 @@ void Obex::slotExited(OProcess* proc ){ | |||
103 | }else if ( proc == m_send ) { | 106 | }else if ( proc == m_send ) { |
104 | sendEnd(); | 107 | sendEnd(); |
105 | } | 108 | } |
106 | } | 109 | } |
107 | void Obex::slotStdOut(OProcess* proc, char* buf, int len){ | 110 | void Obex::slotStdOut(OProcess* proc, char* buf, int len){ |
108 | if ( proc == m_rec ) { // only receive | 111 | if ( proc == m_rec ) { // only receive |
109 | QString str = QString::fromUtf8( buf, len ); | 112 | for (int i = 0; i < len; i++ ) { |
110 | m_outp.append( str ); | 113 | printf("%c", buf[i] ); |
114 | } | ||
115 | printf("\n"); | ||
116 | QByteArray ar( len ); | ||
117 | memcpy( ar.data(), buf, len ); | ||
118 | qWarning("parsed: %s", ar.data() ); | ||
119 | m_outp.append( ar ); | ||
111 | } | 120 | } |
112 | } | 121 | } |
113 | 122 | ||
114 | void Obex::received() { | 123 | void Obex::received() { |
115 | if (m_rec->normalExit() ) { | 124 | if (m_rec->normalExit() ) { |
116 | if ( m_rec->exitStatus() == 0 ) { // we got one | 125 | if ( m_rec->exitStatus() == 0 ) { // we got one |
117 | QString filename = parseOut(); | 126 | QString filename = parseOut(); |
118 | qWarning("ACHTUNG %s", filename.latin1() ); | 127 | qWarning("ACHTUNG %s", filename.latin1() ); |
128 | if (filename.contains( 'ö' ) || filename.contains( 'ä' ) || filename.contains('ü' ) ) { | ||
129 | qWarning("renaming!!!!"); | ||
130 | QFileInfo inf( filename ); | ||
131 | QString newName = "/tmp/opie-obex." + inf.extension(); | ||
132 | ::rename( QFile::encodeName( filename ).data(), newName ); | ||
133 | qWarning("name is %s", QFile::encodeName( filename ).data() ); | ||
134 | } | ||
119 | emit receivedFile( filename ); | 135 | emit receivedFile( filename ); |
120 | } | 136 | } |
121 | }else{ | 137 | }else{ |
122 | emit done(false); | 138 | emit done(false); |
123 | }; | 139 | }; |
124 | delete m_rec; | 140 | delete m_rec; |