author | zecke <zecke> | 2002-06-12 17:08:42 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-06-12 17:08:42 (UTC) |
commit | d57ced2b9c8f3ac79bae54bef7d5026d24e2bb98 (patch) (unidiff) | |
tree | 2db69c92fb707834b798f815f812cbf30b9f09b1 | |
parent | ac707e366de561cabc8074b62025d143200869d7 (diff) | |
download | opie-d57ced2b9c8f3ac79bae54bef7d5026d24e2bb98.zip opie-d57ced2b9c8f3ac79bae54bef7d5026d24e2bb98.tar.gz opie-d57ced2b9c8f3ac79bae54bef7d5026d24e2bb98.tar.bz2 |
Send Receive working now it's time for a gui
-rw-r--r-- | core/applets/obex/obex.cc | 11 | ||||
-rw-r--r-- | core/applets/obex/obeximpl.cc | 3 |
2 files changed, 11 insertions, 3 deletions
diff --git a/core/applets/obex/obex.cc b/core/applets/obex/obex.cc index 582ebbc..f35d57a 100644 --- a/core/applets/obex/obex.cc +++ b/core/applets/obex/obex.cc | |||
@@ -1,3 +1,4 @@ | |||
1 | 1 | ||
2 | #include <qapplication.h> | ||
2 | 3 | ||
3 | #include <opie/oprocess.h> | 4 | #include <opie/oprocess.h> |
@@ -18,4 +19,5 @@ Obex::~Obex() { | |||
18 | } | 19 | } |
19 | void Obex::receive() { | 20 | void Obex::receive() { |
21 | qWarning("Receive" ); | ||
20 | m_rec = new OProcess(); | 22 | m_rec = new OProcess(); |
21 | *m_rec << "irobex_palm3"; | 23 | *m_rec << "irobex_palm3"; |
@@ -40,6 +42,7 @@ void Obex::send( const QString& fileName) { | |||
40 | } | 42 | } |
41 | void Obex::sendNow(){ | 43 | void Obex::sendNow(){ |
42 | if ( m_count >= 15 ) { // could not send | 44 | if ( m_count >= 25 ) { // could not send |
43 | emit error(-1 ); | 45 | emit error(-1 ); |
46 | return; | ||
44 | } | 47 | } |
45 | // OProcess inititialisation | 48 | // OProcess inititialisation |
@@ -55,5 +58,6 @@ void Obex::sendNow(){ | |||
55 | // now start it | 58 | // now start it |
56 | if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { | 59 | if (!m_send->start(/*OProcess::NotifyOnExit, OProcess::AllOutput*/ ) ) { |
57 | m_count = 15; | 60 | qWarning("could not send" ); |
61 | m_count = 25; | ||
58 | emit error(-1 ); | 62 | emit error(-1 ); |
59 | } | 63 | } |
@@ -93,4 +97,5 @@ void Obex::sendEnd() { | |||
93 | delete m_send; | 97 | delete m_send; |
94 | m_send=0; | 98 | m_send=0; |
99 | qWarning("done" ); | ||
95 | emit sent(); | 100 | emit sent(); |
96 | }else if (m_send->exitStatus() == 255 ) { // it failed maybe the other side wasn't ready | 101 | }else if (m_send->exitStatus() == 255 ) { // it failed maybe the other side wasn't ready |
@@ -98,4 +103,5 @@ void Obex::sendEnd() { | |||
98 | delete m_send; | 103 | delete m_send; |
99 | m_send = 0; | 104 | m_send = 0; |
105 | qWarning("try sending again" ); | ||
100 | sendNow(); | 106 | sendNow(); |
101 | } | 107 | } |
@@ -114,4 +120,5 @@ QString Obex::parseOut( ){ | |||
114 | QStringList pathes = QStringList::split(' ', (*it) ); | 120 | QStringList pathes = QStringList::split(' ', (*it) ); |
115 | path = pathes[1]; | 121 | path = pathes[1]; |
122 | qWarning("path %s", path.latin1() ); | ||
116 | } | 123 | } |
117 | } | 124 | } |
diff --git a/core/applets/obex/obeximpl.cc b/core/applets/obex/obeximpl.cc index fa2a30a..82ff1a1 100644 --- a/core/applets/obex/obeximpl.cc +++ b/core/applets/obex/obeximpl.cc | |||
@@ -47,5 +47,6 @@ void ObexImpl::slotMessage( const QCString& msg, const QByteArray&data ) { | |||
47 | QCopEnvelope e ("QPE/Obex", "done(QString)" ); | 47 | QCopEnvelope e ("QPE/Obex", "done(QString)" ); |
48 | e << filename; | 48 | e << filename; |
49 | }else if(msg == "receive(bool)" ) { | 49 | }else if(msg == "receive(bool)" ) { // open a GUI |
50 | m_obex->receive(); | ||
50 | ; | 51 | ; |
51 | } | 52 | } |