author | zecke <zecke> | 2003-02-16 17:12:10 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-16 17:12:10 (UTC) |
commit | e9e20c4e64b8b228af928822e3d4a49ed773dc2e (patch) (unidiff) | |
tree | 17cdd250d08093d4c1564b7e61015d764da7e590 /core/obex/obex.cc | |
parent | 7280d00082163307ecc09d8f4b98397dda460dd5 (diff) | |
download | opie-e9e20c4e64b8b228af928822e3d4a49ed773dc2e.zip opie-e9e20c4e64b8b228af928822e3d4a49ed773dc2e.tar.gz opie-e9e20c4e64b8b228af928822e3d4a49ed773dc2e.tar.bz2 |
Debug output
disabled some features inside the QTextView..
fixed two typos and the order of filename + description
it's sending now again
-rw-r--r-- | core/obex/obex.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/obex/obex.cc b/core/obex/obex.cc index 83d1faf..92cd317 100644 --- a/core/obex/obex.cc +++ b/core/obex/obex.cc | |||
@@ -1,14 +1,15 @@ | |||
1 | 1 | ||
2 | #include <qapplication.h> | 2 | #include <qapplication.h> |
3 | #include <qfile.h> | ||
3 | #include <qmessagebox.h> | 4 | #include <qmessagebox.h> |
4 | #include <qpe/qcopenvelope_qws.h> | 5 | #include <qpe/qcopenvelope_qws.h> |
5 | #include <opie/oprocess.h> | 6 | #include <opie/oprocess.h> |
6 | #include "obex.h" | 7 | #include "obex.h" |
7 | 8 | ||
8 | using namespace OpieObex; | 9 | using namespace OpieObex; |
9 | 10 | ||
10 | Obex::Obex( QObject *parent, const char* name ) | 11 | Obex::Obex( QObject *parent, const char* name ) |
11 | : QObject(parent, name ) | 12 | : QObject(parent, name ) |
12 | { | 13 | { |
13 | m_rec = 0; | 14 | m_rec = 0; |
14 | m_send=0; | 15 | m_send=0; |
@@ -39,25 +40,25 @@ void Obex::receive() { | |||
39 | if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { | 40 | if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { |
40 | qWarning("could not start :("); | 41 | qWarning("could not start :("); |
41 | emit done( false ); | 42 | emit done( false ); |
42 | delete m_rec; | 43 | delete m_rec; |
43 | m_rec = 0; | 44 | m_rec = 0; |
44 | } | 45 | } |
45 | // emit currentTry(m_count ); | 46 | // emit currentTry(m_count ); |
46 | 47 | ||
47 | } | 48 | } |
48 | void Obex::send( const QString& fileName) { // if currently receiving stop it send receive | 49 | void Obex::send( const QString& fileName) { // if currently receiving stop it send receive |
49 | m_count = 0; | 50 | m_count = 0; |
50 | m_file = fileName; | 51 | m_file = fileName; |
51 | qWarning("send"); | 52 | qWarning("send %s", fileName.latin1() ); |
52 | if (m_rec != 0 ) { | 53 | if (m_rec != 0 ) { |
53 | qWarning("running"); | 54 | qWarning("running"); |
54 | if (m_rec->isRunning() ) { | 55 | if (m_rec->isRunning() ) { |
55 | emit error(-1 ); | 56 | emit error(-1 ); |
56 | qWarning("is running"); | 57 | qWarning("is running"); |
57 | delete m_rec; | 58 | delete m_rec; |
58 | m_rec = 0; | 59 | m_rec = 0; |
59 | 60 | ||
60 | }else{ | 61 | }else{ |
61 | qWarning("is not running"); | 62 | qWarning("is not running"); |
62 | emit error( -1 ); // we did not delete yet but it's not running slotExited is pending | 63 | emit error( -1 ); // we did not delete yet but it's not running slotExited is pending |
63 | return; | 64 | return; |
@@ -66,25 +67,25 @@ void Obex::send( const QString& fileName) { // if currently receiving stop it se | |||
66 | sendNow(); | 67 | sendNow(); |
67 | } | 68 | } |
68 | void Obex::sendNow(){ | 69 | void Obex::sendNow(){ |
69 | qWarning("sendNow"); | 70 | qWarning("sendNow"); |
70 | if ( m_count >= 25 ) { // could not send | 71 | if ( m_count >= 25 ) { // could not send |
71 | emit error(-1 ); | 72 | emit error(-1 ); |
72 | emit sent(false); | 73 | emit sent(false); |
73 | return; | 74 | return; |
74 | } | 75 | } |
75 | // OProcess inititialisation | 76 | // OProcess inititialisation |
76 | m_send = new OProcess(); | 77 | m_send = new OProcess(); |
77 | *m_send << "irobex_palm3"; | 78 | *m_send << "irobex_palm3"; |
78 | *m_send << m_file; | 79 | *m_send << QFile::encodeName(m_file); |
79 | 80 | ||
80 | // connect to slots Exited and and StdOut | 81 | // connect to slots Exited and and StdOut |
81 | connect(m_send, SIGNAL(processExited(OProcess*) ), | 82 | connect(m_send, SIGNAL(processExited(OProcess*) ), |
82 | this, SLOT(slotExited(OProcess*)) ); | 83 | this, SLOT(slotExited(OProcess*)) ); |
83 | connect(m_send, SIGNAL(receivedStdout(OProcess*, char*, int )), | 84 | connect(m_send, SIGNAL(receivedStdout(OProcess*, char*, int )), |
84 | this, SLOT(slotStdOut(OProcess*, char*, int) ) ); | 85 | this, SLOT(slotStdOut(OProcess*, char*, int) ) ); |
85 | 86 | ||
86 | // now start it | 87 | // now start it |
87 | if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { | 88 | if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { |
88 | qWarning("could not send" ); | 89 | qWarning("could not send" ); |
89 | m_count = 25; | 90 | m_count = 25; |
90 | emit error(-1 ); | 91 | emit error(-1 ); |