summaryrefslogtreecommitdiff
path: root/noncore/apps/opie-console/MyPty.cpp
authorzecke <zecke>2002-10-15 13:02:56 (UTC)
committer zecke <zecke>2002-10-15 13:02:56 (UTC)
commit09ba4d2c79a41b185902519639032a49c85deadb (patch) (side-by-side diff)
treef1d9676bf3401bb93e527c8608a9307bf4adf244 /noncore/apps/opie-console/MyPty.cpp
parentb555d0c687db83cde89f1a75fccbd59723878621 (diff)
downloadopie-09ba4d2c79a41b185902519639032a49c85deadb.zip
opie-09ba4d2c79a41b185902519639032a49c85deadb.tar.gz
opie-09ba4d2c79a41b185902519639032a49c85deadb.tar.bz2
Add a Feature Support BitArray to the IOLayer
This way we know what an IOLayer supports Adjust IOSerial and MyPty to that change Fix the after close window the previous session window is empty bug in Mainwindow::remove we had a problem first we removed the currentSession from the tab and then deleted the session The problem is that removePage on OTabWidget does signal currentChanged so we did not delete the session intended but the wrong one because m_curSession got adjusted after a removePage... 3rd fix the close and reopen bug in MyPty
Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (ignore 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
@@ -117,10 +117,13 @@ void MyPty::donePty()
kill(m_cpid, SIGHUP);
//waitpid(m_cpid, &status, 0);
delete m_sn_e;
+ delete m_sn_r;
m_sn_e = 0l;
+ m_sn_r = 0l;
}
m_cpid = 0;
+ m_fd = -1;
// emit done(status);
}
@@ -185,10 +188,11 @@ 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()));
return 0;
@@ -221,7 +225,7 @@ int MyPty::openPty()
#endif
if ( ptyfd < 0 ) {
- qApp->exit(1);
+// qApp->exit(1);
return -1;
}
@@ -234,6 +238,7 @@ int MyPty::openPty()
MyPty::MyPty(const Profile&) : m_cpid(0)
{
m_sn_e = 0l;
+ m_sn_r = 0l;
m_fd = openPty();
ProcCtl* ctl = ProcCtl::self();
}
@@ -254,11 +259,15 @@ QString MyPty::name()const{
return identifier();
}
bool MyPty::open() {
+ if (m_fd < 0)
+ m_fd = openPty();
+
start();
return true;
}
void MyPty::close() {
donePty();
+ m_fd = openPty();
}
void MyPty::reload( const Profile& ) {
@@ -286,7 +295,6 @@ void MyPty::readPty()
if (len == -1 || len == 0) {
donePty();
- delete sender();
return;
}
@@ -306,4 +314,11 @@ void MyPty::readPty()
#endif
}
+QBitArray MyPty::supports()const {
+ QBitArray ar(3);
+ ar[0] = 1;
+ ar[1] = 0;
+ ar[2] = 0;
+ return ar;
+}