-rw-r--r-- | noncore/apps/opie-console/io_modem.cpp | 6 | ||||
-rw-r--r-- | noncore/apps/opie-console/io_serial.cpp | 1 | ||||
-rw-r--r-- | noncore/apps/opie-console/mainwindow.cpp | 10 |
3 files changed, 13 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/io_modem.cpp b/noncore/apps/opie-console/io_modem.cpp index 22a3673..41f553b 100644 --- a/noncore/apps/opie-console/io_modem.cpp +++ b/noncore/apps/opie-console/io_modem.cpp @@ -30,9 +30,13 @@ bool IOModem::open() { if(result == QDialog::Accepted) { return true; } - else return false; + else + { + close(); + return false; + } } void IOModem::reload( const Profile &config ) { diff --git a/noncore/apps/opie-console/io_serial.cpp b/noncore/apps/opie-console/io_serial.cpp index b89a53b..cc63c58 100644 --- a/noncore/apps/opie-console/io_serial.cpp +++ b/noncore/apps/opie-console/io_serial.cpp @@ -45,8 +45,9 @@ bool IOSerial::open() { struct termios tty; m_fd = ::open(m_device, O_RDWR | O_NOCTTY | O_NONBLOCK); if (m_fd < 0) { emit error(CouldNotOpen, strerror(errno)); + m_fd = 0; return FALSE; } tcgetattr(m_fd, &tty); diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp index 4326609..9ccefa0 100644 --- a/noncore/apps/opie-console/mainwindow.cpp +++ b/noncore/apps/opie-console/mainwindow.cpp @@ -317,10 +317,12 @@ void MainWindow::slotConnect() { bool ret = currentSession()->layer()->open(); if(!ret) QMessageBox::warning(currentSession()->widgetStack(), QObject::tr("Failed"), QObject::tr("Connecting failed for this session.")); - m_connect->setEnabled( false ); - m_disconnect->setEnabled( true ); + else { + m_connect->setEnabled( false ); + m_disconnect->setEnabled( true ); + } } } void MainWindow::slotDisconnect() { @@ -363,9 +365,11 @@ void MainWindow::slotClose() { return; Session* ses = currentSession(); qWarning("removing! currentSession %s", currentSession()->name().latin1() ); - tabWidget()->remove( currentSession() ); + /* set to NULL to be safe, if its needed slotSessionChanged resets it automatically */ + m_curSession = NULL; + tabWidget()->remove( /*currentSession()*/ses ); /*it's autodelete */ m_sessions.remove( ses ); qWarning("after remove!!"); |