summaryrefslogtreecommitdiff
path: root/core/obex/obex.cpp
Unidiff
Diffstat (limited to 'core/obex/obex.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--core/obex/obex.cpp49
1 files changed, 37 insertions, 12 deletions
diff --git a/core/obex/obex.cpp b/core/obex/obex.cpp
index 36634ec..95c561a 100644
--- a/core/obex/obex.cpp
+++ b/core/obex/obex.cpp
@@ -1,3 +1,33 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 Maximilian Reiss <max.reiss@gmx.de>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <,   >  .   <= redistribute it and/or modify it under
7:=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; version 2 of the License.
10     ._= =}       :
11    .%+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=| MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22   --        :-= this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28/*
29 * The Infrared OBEX handling class implementation
30 */
1 31
2#include "obex.h" 32#include "obex.h"
3 33
@@ -16,24 +46,17 @@ using namespace Opie::Core;
16/* TRANSLATOR OpieObex::Obex */ 46/* TRANSLATOR OpieObex::Obex */
17 47
18Obex::Obex( QObject *parent, const char* name ) 48Obex::Obex( QObject *parent, const char* name )
19 : QObject(parent, name ) 49 : ObexBase(parent, name )
20{ 50{
21 m_rec = 0; 51 m_rec = 0;
22 m_send=0; 52 m_send=0;
23 m_count = 0;
24 m_receive = false;
25 connect( this, SIGNAL(error(int) ), // for recovering to receive
26 SLOT(slotError() ) );
27 connect( this, SIGNAL(sent(bool) ),
28 SLOT(slotError() ) );
29}; 53};
30Obex::~Obex() { 54Obex::~Obex() {
31 delete m_rec; 55 delete m_rec;
32 delete m_send; 56 delete m_send;
33} 57}
34void Obex::receive() { 58void Obex::receive() {
35 m_receive = true; 59 ObexBase::receive();
36 m_outp = QString::null;
37 m_rec = new OProcess(); 60 m_rec = new OProcess();
38 *m_rec << "irobex_palm3"; 61 *m_rec << "irobex_palm3";
39 // connect to the necessary slots 62 // connect to the necessary slots
@@ -50,9 +73,9 @@ void Obex::receive() {
50 } 73 }
51} 74}
52 75
53void Obex::send( const QString& fileName) { // if currently receiving stop it send receive 76// if currently receiving stop it send receive
54 m_count = 0; 77void Obex::send(const QString& fileName, const QString& addr) {
55 m_file = fileName; 78 ObexBase::send(fileName, addr);
56 if (m_rec != 0 ) { 79 if (m_rec != 0 ) {
57 if (m_rec->isRunning() ) { 80 if (m_rec->isRunning() ) {
58 emit error(-1 ); 81 emit error(-1 );
@@ -165,10 +188,12 @@ QString Obex::parseOut( ){
165 * when sent is done slotError is called we will start receive again 188 * when sent is done slotError is called we will start receive again
166 */ 189 */
167void Obex::slotError() { 190void Obex::slotError() {
191 ObexBase::slotError();
168 if ( m_receive ) 192 if ( m_receive )
169 receive(); 193 receive();
170}; 194};
171void Obex::setReceiveEnabled( bool receive ) { 195void Obex::setReceiveEnabled( bool receive ) {
196 ObexBase::setReceiveEnabled(receive);
172 if ( !receive ) { // 197 if ( !receive ) { //
173 m_receive = false; 198 m_receive = false;
174 shutDownReceive(); 199 shutDownReceive();