summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/MyPty.cpp
Side-by-side diff
Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (show whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp23
1 files changed, 19 insertions, 4 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index b6ae1d9..565d03f 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -119,3 +119,5 @@ void MyPty::donePty()
delete m_sn_e;
+ delete m_sn_r;
m_sn_e = 0l;
+ m_sn_r = 0l;
}
@@ -123,2 +125,3 @@ void MyPty::donePty()
m_cpid = 0;
+ m_fd = -1;
// emit done(status);
@@ -187,6 +190,7 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int)
// parent - continue as a widget
- QSocketNotifier* sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this);
+ delete m_sn_r;
+ m_sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this);
delete m_sn_e;
m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this);
- connect(sn_r,SIGNAL(activated(int)),this,SLOT(readPty()));
+ connect(m_sn_r,SIGNAL(activated(int)),this,SLOT(readPty()));
connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error()));
@@ -223,3 +227,3 @@ int MyPty::openPty()
if ( ptyfd < 0 ) {
- qApp->exit(1);
+// qApp->exit(1);
return -1;
@@ -236,2 +240,3 @@ MyPty::MyPty(const Profile&) : m_cpid(0)
m_sn_e = 0l;
+ m_sn_r = 0l;
m_fd = openPty();
@@ -256,2 +261,5 @@ QString MyPty::name()const{
bool MyPty::open() {
+ if (m_fd < 0)
+ m_fd = openPty();
+
start();
@@ -261,2 +269,3 @@ void MyPty::close() {
donePty();
+ m_fd = openPty();
}
@@ -288,3 +297,2 @@ void MyPty::readPty()
donePty();
- delete sender();
return;
@@ -308,2 +316,9 @@ void MyPty::readPty()
}
+QBitArray MyPty::supports()const {
+ QBitArray ar(3);
+ ar[0] = 1;
+ ar[1] = 0;
+ ar[2] = 0;
+ return ar;
+}