author | zecke <zecke> | 2003-02-16 15:49:02 (UTC) |
---|---|---|
committer | zecke <zecke> | 2003-02-16 15:49:02 (UTC) |
commit | 30a098530260176ac20d75ba6cb7abfb3d998c13 (patch) (side-by-side diff) | |
tree | ee5c08ca67fa00574414153921ab2de654c60421 /core/applets/obex/processwrapper.cc | |
parent | 7fab90d46144843d32e476ada8d0a5f40f50aa60 (diff) | |
download | opie-30a098530260176ac20d75ba6cb7abfb3d998c13.zip opie-30a098530260176ac20d75ba6cb7abfb3d998c13.tar.gz opie-30a098530260176ac20d75ba6cb7abfb3d998c13.tar.bz2 |
disable snd in IrDaApplet it hangs on my machine..
Remove the hacky OBEX Implementation
Add a more cleaned up more appealing (not yet working) version
which will even be able to do OBEX over Bluetooth in the future
-It handles receive better
let's you choose what to do with custom files and created a DocLnk
-Send lets you beam to multiple devices
this needs the IrDa Applet to be present
Diffstat (limited to 'core/applets/obex/processwrapper.cc') (more/less context) (show whitespace changes)
-rwxr-xr-x | core/applets/obex/processwrapper.cc | 114 |
1 files changed, 0 insertions, 114 deletions
diff --git a/core/applets/obex/processwrapper.cc b/core/applets/obex/processwrapper.cc deleted file mode 100755 index ebc7794..0000000 --- a/core/applets/obex/processwrapper.cc +++ b/dev/null @@ -1,114 +0,0 @@ -// -m_rec == KProcess -m_count = int // the number of tries to recieve -m_send == KProcess -m_file == QString filename to send -m_outp == the output of the process - -// - - -void receive() { - m_rec = new KProcess(); - *m_rec << "irobex_palm3"; - // connect to the necessary slots - connect(m_rec, SIGNAL(processExited(KProcess*) ), - this, SLOT(slotExited(KProcess*) ) ); - - connect(m_rec, SIGNAL(receivedStdout(KProcess*, char*, int ) ), - this, SLOT(slotStdOut(KProcess*, char*, int) ) ); - - if(!m_rec->start(KProcess::NotifyOnExit, KProcess::AllOutput) ) { - qWarning("could not start :("); - emit done( false ); - } - emit try(m_count ) -} -void send(const QString &fileName) { - m_count = 0; - m_file = fileName; - sendNow(); -} -void sendNow() { - if ( m_count >= 15 ) { // could not send - emit error(-1 ); - } - // KProcess inititialisation - m_send = new KProcess(); - m_send << "irobex_palm3"; - m_send << m_file; - - // connect to slots Exited and and StdOut - connect(m_send, SIGNAL(processExited(KProcess*) ), - this, SLOT(slotExited(KProcess*)) ); - connect(m_send, SIGNAL(receivedStdout(KProcess*, char*, int ) ) - this, SLOT(slotStdOut(KProcess*, char*, int) ) ); - // now start it - if (!m_send->start(/*KProcess::NotifyOnExit, KProcess::AllOutput*/ ) ) { - m_count = 15; - emit error(-1 ); - } - // end - m_count++; - emit try( m_count ); -} - -void recieved() { - if (m_rec->normalExit() ) { - if ( m_rec->exitStatus() == 0 ) { // we got one - QString filename = parseOut(); - emit recievedFile( filename ); - } - }else{ - emit error(-1); - }; - delete m_rec; -} - - -void slotExited(KProcess* proc) { - if (proc == m_rec ) { // recieve process - recieved(); - }else if ( proc == m_send ) { - send(); - } -} - - -void send() { - if (m_send->normalExit() ) { - if ( m_send->exitStatus() == 0 ) { - delete m_send; - m_send=0; - emit sent(); - }else if (m_send->exitStatus() == 255 ) { // it failed maybe the other side wasn't ready - // let's try it again - delete m_send; - m_send = 0; - sendNow(); - } - }else { - emit error( -1 ); - delete m_send; - m_send = 0; - } - -} -void parseOut() { - QStringList list = QStringList::split("\n", m_outp); - QStringList::Iterator it; - for (it = list.begin(); it != list.end(); ++it ) { - if ( (*it).startsWith("Wrote" ) ) { - QStringList pathes = QStringList::split(' ', (*it) ); - QString path = pathes[1]; - } - } -} - -void slotStdOut(KProcess* proc, char* buf, int len) { - if ( proc == m_rec ) { // only recieve - QCString cstring( buf, len ); - m_outp.append( cstring.data() ); - } - -} |