Diffstat (limited to 'noncore/apps/opie-console/MyPty.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/MyPty.cpp | 23 |
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() | |||
119 | delete m_sn_e; | 119 | delete m_sn_e; |
120 | delete m_sn_r; | ||
120 | m_sn_e = 0l; | 121 | m_sn_e = 0l; |
122 | m_sn_r = 0l; | ||
121 | } | 123 | } |
@@ -123,2 +125,3 @@ void MyPty::donePty() | |||
123 | m_cpid = 0; | 125 | m_cpid = 0; |
126 | m_fd = -1; | ||
124 | // emit done(status); | 127 | // emit done(status); |
@@ -187,6 +190,7 @@ int MyPty::run(const char* cmd, QStrList &, const char*, int) | |||
187 | // parent - continue as a widget | 190 | // parent - continue as a widget |
188 | QSocketNotifier* sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); | 191 | delete m_sn_r; |
192 | m_sn_r = new QSocketNotifier(m_fd,QSocketNotifier::Read,this); | ||
189 | delete m_sn_e; | 193 | delete m_sn_e; |
190 | m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); | 194 | m_sn_e = new QSocketNotifier(m_fd,QSocketNotifier::Exception,this); |
191 | connect(sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); | 195 | connect(m_sn_r,SIGNAL(activated(int)),this,SLOT(readPty())); |
192 | connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error())); | 196 | connect(m_sn_e,SIGNAL(activated(int)),this,SLOT(error())); |
@@ -223,3 +227,3 @@ int MyPty::openPty() | |||
223 | if ( ptyfd < 0 ) { | 227 | if ( ptyfd < 0 ) { |
224 | qApp->exit(1); | 228 | //qApp->exit(1); |
225 | return -1; | 229 | return -1; |
@@ -236,2 +240,3 @@ MyPty::MyPty(const Profile&) : m_cpid(0) | |||
236 | m_sn_e = 0l; | 240 | m_sn_e = 0l; |
241 | m_sn_r = 0l; | ||
237 | m_fd = openPty(); | 242 | m_fd = openPty(); |
@@ -256,2 +261,5 @@ QString MyPty::name()const{ | |||
256 | bool MyPty::open() { | 261 | bool MyPty::open() { |
262 | if (m_fd < 0) | ||
263 | m_fd = openPty(); | ||
264 | |||
257 | start(); | 265 | start(); |
@@ -261,2 +269,3 @@ void MyPty::close() { | |||
261 | donePty(); | 269 | donePty(); |
270 | m_fd = openPty(); | ||
262 | } | 271 | } |
@@ -288,3 +297,2 @@ void MyPty::readPty() | |||
288 | donePty(); | 297 | donePty(); |
289 | delete sender(); | ||
290 | return; | 298 | return; |
@@ -308,2 +316,9 @@ void MyPty::readPty() | |||
308 | } | 316 | } |
317 | QBitArray MyPty::supports()const { | ||
318 | QBitArray ar(3); | ||
319 | ar[0] = 1; | ||
320 | ar[1] = 0; | ||
321 | ar[2] = 0; | ||
309 | 322 | ||
323 | return ar; | ||
324 | } | ||