-rw-r--r-- | core/obex/obex.cpp | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/core/obex/obex.cpp b/core/obex/obex.cpp index e4a3c31..670f1a5 100644 --- a/core/obex/obex.cpp +++ b/core/obex/obex.cpp | |||
@@ -59,49 +59,48 @@ void Obex::receive() { | |||
59 | ObexBase::receive(); | 59 | ObexBase::receive(); |
60 | m_rec = new ObexServer(OBEX_TRANS_IRDA); | 60 | m_rec = new ObexServer(OBEX_TRANS_IRDA); |
61 | // connect to the necessary slots | 61 | // connect to the necessary slots |
62 | connect(m_rec, SIGNAL(processExited(Opie::Core::OProcess*) ), | 62 | connect(m_rec, SIGNAL(processExited(Opie::Core::OProcess*) ), |
63 | this, SLOT(slotExited(Opie::Core::OProcess*) ) ); | 63 | this, SLOT(slotExited(Opie::Core::OProcess*) ) ); |
64 | 64 | ||
65 | connect(m_rec, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ), | 65 | connect(m_rec, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int ) ), |
66 | this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) ); | 66 | this, SLOT(slotStdOut(Opie::Core::OProcess*, char*, int) ) ); |
67 | 67 | ||
68 | if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { | 68 | if(!m_rec->start(OProcess::NotifyOnExit, OProcess::AllOutput) ) { |
69 | emit done( false ); | 69 | emit done( false ); |
70 | delete m_rec; | 70 | delete m_rec; |
71 | m_rec = 0; | 71 | m_rec = 0; |
72 | } | 72 | } |
73 | } | 73 | } |
74 | 74 | ||
75 | // if currently receiving stop it send receive | 75 | // if currently receiving stop it send receive |
76 | void Obex::send(const QString& fileName, const QString& addr) { | 76 | void Obex::send(const QString& fileName, const QString& addr) { |
77 | ObexBase::send(fileName, addr); | 77 | ObexBase::send(fileName, addr); |
78 | if (m_rec != 0 ) { | 78 | if (m_rec != 0 ) { |
79 | if (m_rec->isRunning() ) { | 79 | if (m_rec->isRunning() ) { |
80 | emit error(-1 ); | 80 | emit error(-1 ); |
81 | delete m_rec; | 81 | delete m_rec; |
82 | m_rec = 0; | 82 | m_rec = 0; |
83 | |||
84 | }else{ | 83 | }else{ |
85 | emit error( -1 ); // we did not delete yet but it's not running slotExited is pending | 84 | emit error( -1 ); // we did not delete yet but it's not running slotExited is pending |
86 | return; | 85 | return; |
87 | } | 86 | } |
88 | } | 87 | } |
89 | sendNow(); | 88 | sendNow(); |
90 | } | 89 | } |
91 | void Obex::sendNow(){ | 90 | void Obex::sendNow(){ |
92 | if ( m_count >= 25 ) { // could not send | 91 | if ( m_count >= 25 ) { // could not send |
93 | emit error(-1 ); | 92 | emit error(-1 ); |
94 | emit sent(false); | 93 | emit sent(false); |
95 | return; | 94 | return; |
96 | } | 95 | } |
97 | // OProcess inititialisation | 96 | // OProcess inititialisation |
98 | m_send = new OProcess(); | 97 | m_send = new OProcess(); |
99 | m_send->setWorkingDirectory( QFileInfo(m_file).dirPath(true) ); | 98 | m_send->setWorkingDirectory( QFileInfo(m_file).dirPath(true) ); |
100 | 99 | ||
101 | *m_send << "irobex_palm3"; | 100 | *m_send << "irobex_palm3"; |
102 | *m_send << QFile::encodeName(QFileInfo(m_file).fileName()); | 101 | *m_send << QFile::encodeName(QFileInfo(m_file).fileName()); |
103 | 102 | ||
104 | // connect to slots Exited and and StdOut | 103 | // connect to slots Exited and and StdOut |
105 | connect(m_send, SIGNAL(processExited(Opie::Core::OProcess*) ), | 104 | connect(m_send, SIGNAL(processExited(Opie::Core::OProcess*) ), |
106 | this, SLOT(slotExited(Opie::Core::OProcess*)) ); | 105 | this, SLOT(slotExited(Opie::Core::OProcess*)) ); |
107 | connect(m_send, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int )), | 106 | connect(m_send, SIGNAL(receivedStdout(Opie::Core::OProcess*, char*, int )), |