-rw-r--r-- | core/obex/obex.cpp | 3 | ||||
-rw-r--r-- | core/obex/obex.h | 4 |
2 files changed, 1 insertions, 6 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 | |||
@@ -40,25 +40,25 @@ | |||
40 | 40 | ||
41 | 41 | ||
42 | 42 | ||
43 | using namespace OpieObex; | 43 | using namespace OpieObex; |
44 | 44 | ||
45 | using namespace Opie::Core; | 45 | using namespace Opie::Core; |
46 | /* TRANSLATOR OpieObex::Obex */ | 46 | /* TRANSLATOR OpieObex::Obex */ |
47 | 47 | ||
48 | Obex::Obex( QObject *parent, const char* name ) | 48 | Obex::Obex( QObject *parent, const char* name ) |
49 | : ObexBase(parent, name ) | 49 | : ObexBase(parent, name ) |
50 | { | 50 | { |
51 | m_rec = 0; | 51 | m_rec = 0; |
52 | m_send=0; | 52 | m_send = 0; |
53 | }; | 53 | }; |
54 | Obex::~Obex() { | 54 | Obex::~Obex() { |
55 | delete m_rec; | 55 | delete m_rec; |
56 | delete m_send; | 56 | delete m_send; |
57 | } | 57 | } |
58 | void Obex::receive() { | 58 | 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 | ||
@@ -71,25 +71,24 @@ void Obex::receive() { | |||
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; |
diff --git a/core/obex/obex.h b/core/obex/obex.h index b948ce4..745f1c2 100644 --- a/core/obex/obex.h +++ b/core/obex/obex.h | |||
@@ -72,30 +72,26 @@ namespace OpieObex { | |||
72 | void error( int ); | 72 | void error( int ); |
73 | /** | 73 | /** |
74 | * The current try to receive data | 74 | * The current try to receive data |
75 | */ | 75 | */ |
76 | void currentTry(unsigned int); | 76 | void currentTry(unsigned int); |
77 | /** | 77 | /** |
78 | * signal sent The file got beamed to the remote location | 78 | * signal sent The file got beamed to the remote location |
79 | */ | 79 | */ |
80 | void sent(bool); | 80 | void sent(bool); |
81 | void done(bool); | 81 | void done(bool); |
82 | 82 | ||
83 | private: | 83 | private: |
84 | uint m_count; | ||
85 | QString m_file; | ||
86 | QString m_outp; | ||
87 | Opie::Core::OProcess *m_send; | 84 | Opie::Core::OProcess *m_send; |
88 | ObexServer* m_rec; //The OBEX server | 85 | ObexServer* m_rec; //The OBEX server |
89 | bool m_receive : 1; | ||
90 | void shutDownReceive(); | 86 | void shutDownReceive(); |
91 | 87 | ||
92 | private slots: | 88 | private slots: |
93 | 89 | ||
94 | /** | 90 | /** |
95 | * send over palm obex | 91 | * send over palm obex |
96 | */ | 92 | */ |
97 | 93 | ||
98 | //void send(const QString&); | 94 | //void send(const QString&); |
99 | 95 | ||
100 | // the process exited | 96 | // the process exited |
101 | void slotExited(Opie::Core::OProcess* proc) ; | 97 | void slotExited(Opie::Core::OProcess* proc) ; |