Diffstat (limited to 'noncore/apps/opie-console/io_serial.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/io_serial.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp index b495f39..77ced85 100644 --- a/noncore/apps/opie-console/io_serial.cpp +++ b/noncore/apps/opie-console/io_serial.cpp | |||
@@ -2,12 +2,14 @@ | |||
2 | #include <termios.h> | 2 | #include <termios.h> |
3 | #include <errno.h> | 3 | #include <errno.h> |
4 | #include <unistd.h> | 4 | #include <unistd.h> |
5 | #include "io_serial.h" | 5 | #include "io_serial.h" |
6 | 6 | ||
7 | IOSerial::IOSerial(const Profile &config) : IOLayer(config) { | 7 | IOSerial::IOSerial(const Profile &config) : IOLayer(config) { |
8 | m_read = 0l; | ||
9 | m_error = 0l; | ||
8 | m_fd = 0; | 10 | m_fd = 0; |
9 | reload(config); | 11 | reload(config); |
10 | } | 12 | } |
11 | 13 | ||
12 | 14 | ||
13 | IOSerial::~IOSerial() { | 15 | IOSerial::~IOSerial() { |
@@ -109,12 +111,13 @@ bool IOSerial::open() { | |||
109 | m_error = new QSocketNotifier(m_fd, QSocketNotifier::Exception, this); | 111 | m_error = new QSocketNotifier(m_fd, QSocketNotifier::Exception, this); |
110 | connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived())); | 112 | connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived())); |
111 | connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured())); | 113 | connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured())); |
112 | return TRUE; | 114 | return TRUE; |
113 | } else { | 115 | } else { |
114 | emit error(Refuse, tr("Device is already connected")); | 116 | emit error(Refuse, tr("Device is already connected")); |
117 | m_fd = 0; | ||
115 | return FALSE; | 118 | return FALSE; |
116 | } | 119 | } |
117 | } | 120 | } |
118 | 121 | ||
119 | void IOSerial::reload(const Profile &config) { | 122 | void IOSerial::reload(const Profile &config) { |
120 | m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE); | 123 | m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE); |