Diffstat (limited to 'noncore/apps/opie-console/io_irda.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/io_irda.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_irda.cpp b/noncore/apps/opie-console/io_irda.cpp index 8e31e82..56a373c 100644 --- a/noncore/apps/opie-console/io_irda.cpp +++ b/noncore/apps/opie-console/io_irda.cpp | |||
@@ -11,50 +11,52 @@ IOIrda::~IOIrda() { | |||
11 | delete m_attach; | 11 | delete m_attach; |
12 | } | 12 | } |
13 | } | 13 | } |
14 | 14 | ||
15 | 15 | ||
16 | void IOIrda::close() { | 16 | void IOIrda::close() { |
17 | 17 | ||
18 | IOSerial::close(); | 18 | IOSerial::close(); |
19 | // still need error handling | 19 | // still need error handling |
20 | delete m_attach; | 20 | delete m_attach; |
21 | } | 21 | } |
22 | 22 | ||
23 | bool IOIrda::open() { | 23 | bool IOIrda::open() { |
24 | 24 | ||
25 | // irdaattach here | 25 | // irdaattach here |
26 | m_attach = new OProcess(); | 26 | m_attach = new OProcess(); |
27 | *m_attach << "irattach /dev/ttyS2 -s"; | 27 | *m_attach << "irattach /dev/ttyS2 -s"; |
28 | 28 | ||
29 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), | 29 | connect( m_attach, SIGNAL( processExited( OProcess* ) ), |
30 | this, SLOT( slotExited( OProcess* ) ) ); | 30 | this, SLOT( slotExited( OProcess* ) ) ); |
31 | 31 | ||
32 | if ( m_attach->start() ) { | 32 | if ( m_attach->start() ) { |
33 | IOSerial::open(); | 33 | IOSerial::open(); |
34 | } else { | 34 | } else { |
35 | // emit error!!! | ||
35 | qWarning("could not attach to device"); | 36 | qWarning("could not attach to device"); |
36 | delete m_attach; | 37 | delete m_attach; |
38 | m_attach = 0l; | ||
37 | } | 39 | } |
38 | } | 40 | } |
39 | 41 | ||
40 | void IOIrda::reload( const Profile &config ) { | 42 | void IOIrda::reload( const Profile &config ) { |
41 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); | 43 | m_device = config.readEntry("Device", IRDA_DEFAULT_DEVICE); |
42 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); | 44 | m_baud = config.readNumEntry("Baud", IRDA_DEFAULT_BAUD); |
43 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); | 45 | m_parity = config.readNumEntry("Parity", IRDA_DEFAULT_PARITY); |
44 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); | 46 | m_dbits = config.readNumEntry("DataBits", IRDA_DEFAULT_DBITS); |
45 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); | 47 | m_sbits = config.readNumEntry("StopBits", IRDA_DEFAULT_SBITS); |
46 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); | 48 | m_flow = config.readNumEntry("Flow", IRDA_DEFAULT_FLOW); |
47 | } | 49 | } |
48 | 50 | ||
49 | 51 | ||
50 | QString IOIrda::identifier() const { | 52 | QString IOIrda::identifier() const { |
51 | return "irda"; | 53 | return "irda"; |
52 | } | 54 | } |
53 | 55 | ||
54 | QString IOIrda::name() const { | 56 | QString IOIrda::name() const { |
55 | return "Irda IO Layer"; | 57 | return "Irda IO Layer"; |
56 | } | 58 | } |
57 | 59 | ||
58 | void IOIrda::slotExited(OProcess* proc ){ | 60 | void IOIrda::slotExited(OProcess* proc ){ |
59 | close(); | 61 | close(); |
60 | } | 62 | } |