-rw-r--r-- | core/obex/receiver.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/core/obex/receiver.cpp b/core/obex/receiver.cpp index 7d9a42a..e153152 100644 --- a/core/obex/receiver.cpp +++ b/core/obex/receiver.cpp | |||
@@ -1,54 +1,59 @@ | |||
1 | #include "obex.h" | 1 | #include "obex.h" |
2 | #include "btobex.h" | ||
3 | #include "obexbase.h" | ||
2 | #include "receiver.h" | 4 | #include "receiver.h" |
3 | using namespace OpieObex; | 5 | using namespace OpieObex; |
4 | 6 | ||
5 | /* OPIE */ | 7 | /* OPIE */ |
6 | #include <opie2/odebug.h> | 8 | #include <opie2/odebug.h> |
7 | #include <qpe/applnk.h> | 9 | #include <qpe/applnk.h> |
8 | #include <qpe/qpeapplication.h> | 10 | #include <qpe/qpeapplication.h> |
9 | #include <qpe/qcopenvelope_qws.h> | 11 | #include <qpe/qcopenvelope_qws.h> |
10 | #include <qpe/filemanager.h> | 12 | #include <qpe/filemanager.h> |
11 | using namespace Opie::Core; | 13 | using namespace Opie::Core; |
12 | 14 | ||
13 | /* QT */ | 15 | /* QT */ |
14 | #include <qfileinfo.h> | 16 | #include <qfileinfo.h> |
15 | #include <qlabel.h> | 17 | #include <qlabel.h> |
16 | #include <qtextview.h> | 18 | #include <qtextview.h> |
17 | #include <qpushbutton.h> | 19 | #include <qpushbutton.h> |
18 | 20 | ||
19 | /* STD */ | 21 | /* STD */ |
20 | #include <sys/types.h> | 22 | #include <sys/types.h> |
21 | #include <sys/stat.h> | 23 | #include <sys/stat.h> |
22 | #include <sys/mman.h> | 24 | #include <sys/mman.h> |
23 | #include <stdlib.h> // int system | 25 | #include <stdlib.h> // int system |
24 | #include <unistd.h> | 26 | #include <unistd.h> |
25 | #include <fcntl.h> | 27 | #include <fcntl.h> |
26 | 28 | ||
27 | /* TRANSLATOR OpieObex::Receiver */ | 29 | /* TRANSLATOR OpieObex::Receiver */ |
28 | 30 | ||
29 | Receiver::Receiver() { | 31 | Receiver::Receiver(RecType type) { |
32 | if (type == REC_IRDA) | ||
30 | m_obex = new Obex(this, "Receiver"); | 33 | m_obex = new Obex(this, "Receiver"); |
34 | else | ||
35 | m_obex = new BtObex(this, "Receiver"); | ||
31 | connect(m_obex, SIGNAL(receivedFile(const QString&) ), | 36 | connect(m_obex, SIGNAL(receivedFile(const QString&) ), |
32 | this, SLOT(slotReceived(const QString&) ) ); | 37 | this, SLOT(slotReceived(const QString&) ) ); |
33 | m_obex->receive(); | 38 | m_obex->receive(); |
34 | } | 39 | } |
35 | Receiver::~Receiver() { | 40 | Receiver::~Receiver() { |
36 | m_obex->setReceiveEnabled( false ); | 41 | m_obex->setReceiveEnabled( false ); |
37 | delete m_obex; | 42 | delete m_obex; |
38 | } | 43 | } |
39 | void Receiver::slotReceived( const QString& _file ) { | 44 | void Receiver::slotReceived( const QString& _file ) { |
40 | QString file = _file; | 45 | QString file = _file; |
41 | int check = checkFile(file); | 46 | int check = checkFile(file); |
42 | if ( check == AddressBook ) | 47 | if ( check == AddressBook ) |
43 | handleAddr( file ); | 48 | handleAddr( file ); |
44 | else if ( check == Datebook ) | 49 | else if ( check == Datebook ) |
45 | handleDateTodo( file ); | 50 | handleDateTodo( file ); |
46 | else | 51 | else |
47 | handleOther( file ); | 52 | handleOther( file ); |
48 | } | 53 | } |
49 | void Receiver::handleAddr( const QString& str ) { | 54 | void Receiver::handleAddr( const QString& str ) { |
50 | QCopEnvelope e("QPE/Application/addressbook", "setDocument(QString)" ); | 55 | QCopEnvelope e("QPE/Application/addressbook", "setDocument(QString)" ); |
51 | e << str; | 56 | e << str; |
52 | } | 57 | } |
53 | /* we can not say for sure if it's a VEevent ot VTodo */ | 58 | /* we can not say for sure if it's a VEevent ot VTodo */ |
54 | void Receiver::handleDateTodo( const QString& str ) { | 59 | void Receiver::handleDateTodo( const QString& str ) { |