summaryrefslogtreecommitdiff
Side-by-side diff
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/io_serial.cpp3
-rw-r--r--noncore/apps/opie-console/mainwindow.cpp7
2 files changed, 7 insertions, 3 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 @@
#include <termios.h>
#include <errno.h>
#include <unistd.h>
#include "io_serial.h"
IOSerial::IOSerial(const Profile &config) : IOLayer(config) {
+ m_read = 0l;
+ m_error = 0l;
m_fd = 0;
reload(config);
}
IOSerial::~IOSerial() {
@@ -109,12 +111,13 @@ bool IOSerial::open() {
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 {
emit error(Refuse, tr("Device is already connected"));
+ m_fd = 0;
return FALSE;
}
}
void IOSerial::reload(const Profile &config) {
m_device = config.readEntry("Device", SERIAL_DEFAULT_DEVICE);
diff --git a/noncore/apps/opie-console/mainwindow.cpp b/noncore/apps/opie-console/mainwindow.cpp
index aeb3742..0bd6a13 100644
--- a/noncore/apps/opie-console/mainwindow.cpp
+++ b/noncore/apps/opie-console/mainwindow.cpp
@@ -66,13 +66,13 @@ void MainWindow::initUI() {
/*
* terminate action
*/
m_terminate = new QAction();
m_terminate->setText( tr("Terminate") );
m_terminate->addTo( m_console );
- connect(m_disconnect, SIGNAL(activated() ),
+ connect(m_terminate, SIGNAL(activated() ),
this, SLOT(slotTerminate() ) );
a = new QAction();
a->setText( tr("Close Window") );
a->addTo( m_console );
connect(a, SIGNAL(activated() ),
@@ -185,20 +185,21 @@ void MainWindow::slotConfigure() {
* this window from the tabwidget
* remove it from the list
* delete it
* and set the currentSession()
*/
void MainWindow::slotClose() {
+ qWarning("close");
if (!currentSession() )
return;
tabWidget()->remove( currentSession() );
- tabWidget()->setCurrent( m_sessions.first() );
+ /*it's autodelete */
m_sessions.remove( m_curSession );
- delete m_curSession;
m_curSession = m_sessions.first();
+ tabWidget()->setCurrent( m_curSession );
}
/*
* We will get the name
* Then the profile
* and then we will make a profile