author | zecke <zecke> | 2002-09-28 18:29:02 (UTC) |
---|---|---|
committer | zecke <zecke> | 2002-09-28 18:29:02 (UTC) |
commit | bc88219d0a9cf935d90c88fe75e238e86c675937 (patch) (side-by-side diff) | |
tree | 0121d1d3d881cf69948f3faf420a71d894dd6832 /noncore/apps/opie-console/io_serial.cpp | |
parent | 18d575d0ee47a0700091de81bc3e8c54be4eae18 (diff) | |
download | opie-bc88219d0a9cf935d90c88fe75e238e86c675937.zip opie-bc88219d0a9cf935d90c88fe75e238e86c675937.tar.gz opie-bc88219d0a9cf935d90c88fe75e238e86c675937.tar.bz2 |
io_layer take Profile instead of Config
Profile added including some Config like stuff
io_serial getBaud -> baud
a default for gcc3 later
tabdwidget will be our central widget
profileconfig I needed groups() and clearAll
that's pretty much it
Diffstat (limited to 'noncore/apps/opie-console/io_serial.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/io_serial.cpp | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp index c9155d1..b495f39 100644 --- a/noncore/apps/opie-console/io_serial.cpp +++ b/noncore/apps/opie-console/io_serial.cpp @@ -4,7 +4,7 @@ #include <unistd.h> #include "io_serial.h" -IOSerial::IOSerial(const Config &config) : IOLayer(config) { +IOSerial::IOSerial(const Profile &config) : IOLayer(config) { m_fd = 0; reload(config); } @@ -46,7 +46,7 @@ bool IOSerial::open() { tcgetattr(m_fd, &tty); /* Baud rate */ - int speed = getBaud(m_baud); + int speed = baud(m_baud); if (speed == -1) { emit error(Refuse, tr("Invalid baud rate")); } @@ -64,6 +64,7 @@ bool IOSerial::open() { case 6: tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS6; break; case 7: tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS7; break; case 8: tty.c_cflag = (tty.c_cflag & ~CSIZE) | CS8; break; + default: break; } /* Raw, no echo mode */ @@ -115,7 +116,7 @@ bool IOSerial::open() { } } -void IOSerial::reload(const Config &config) { +void IOSerial::reload(const Profile &config) { m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE); m_baud = config.readNumEntry("Baud", SERIAL_DEFAULT_BAUD); m_parity = config.readNumEntry("Parity", SERIAL_DEFAULT_PARITY); @@ -124,7 +125,7 @@ void IOSerial::reload(const Config &config) { m_flow = config.readNumEntry("Flow", SERIAL_DEFAULT_FLOW); } -int IOSerial::getBaud(int baud) const { +int IOSerial::baud(int baud) const { switch (baud) { case 300: return B300; break; case 600: return B600; break; |