author | zecke <zecke> | 2002-10-11 22:31:15 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-10-11 22:31:15 (UTC) |
commit | c8c961b4106f49f544195733cef17af5f15f6bb8 (patch) (side-by-side diff) | |
tree | 3db3cad73021d14c417de2166249ec9e7a5f1aa4 /noncore/apps/opie-console/io_serial.cpp | |
parent | 597cda9456f8ef883d486b6ed7d7c09339919da9 (diff) | |
download | opie-c8c961b4106f49f544195733cef17af5f15f6bb8.zip opie-c8c961b4106f49f544195733cef17af5f15f6bb8.tar.gz opie-c8c961b4106f49f544195733cef17af5f15f6bb8.tar.bz2 |
suspending connections in rawMode... closeRawIO afterwards please
Progress for FileTransfer
FileTransferLayer updates. ErrorCodes + Better methods cancel and better progress
default switch to FileTransfer
TabWidget is a OTabWidget again
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 | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp index 845f4be..4129d64 100644 --- a/noncore/apps/opie-console/io_serial.cpp +++ b/noncore/apps/opie-console/io_serial.cpp @@ -24,12 +24,13 @@ void IOSerial::send(const QByteArray &data) { } else { emit error(Refuse, tr("Not connected")); } } void IOSerial::close() { + qWarning("closing!"); if (m_fd) { delete m_read; delete m_error; ::close(m_fd); m_fd = 0; } else { @@ -114,13 +115,13 @@ bool IOSerial::open() { m_read = new QSocketNotifier(m_fd, QSocketNotifier::Read, this); m_error = new QSocketNotifier(m_fd, QSocketNotifier::Exception, this); connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived())); connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured())); return TRUE; } else { - qWarning("opened"); + qWarning(" already opened"); emit error(Refuse, tr("Device is already connected")); m_fd = 0; return FALSE; } } @@ -173,10 +174,23 @@ QString IOSerial::identifier() const { } QString IOSerial::name() const { return "RS232 Serial IO Layer"; } int IOSerial::rawIO()const { + if (m_read ) + disconnect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived())); + if (m_error ) + disconnect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured())); + int fd = ::open(m_device, O_RDWR ); return fd; }; +void IOSerial::closeRawIO(int fd) { + if (m_read ) + connect(m_read, SIGNAL(activated(int)), this, SLOT(dataArrived())); + if (m_error ) + connect(m_error, SIGNAL(activated(int)), this, SLOT(errorOccured())); + + ::close( fd ); +} |