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) (ignore whitespace changes)
-rw-r--r--noncore/apps/opie-console/MyPty.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/noncore/apps/opie-console/MyPty.cpp b/noncore/apps/opie-console/MyPty.cpp
index 16bb5ff..984e347 100644
--- a/noncore/apps/opie-console/MyPty.cpp
+++ b/noncore/apps/opie-console/MyPty.cpp
@@ -89,49 +89,48 @@
#undef VERBOSE_DEBUG
/* -------------------------------------------------------------------------- */
/*!
Informs the client program about the
actual size of the window.
*/
void MyPty::setSize(int lines, int columns)
{
qWarning("setting size");
struct winsize wsize;
wsize.ws_row = (unsigned short)lines;
wsize.ws_col = (unsigned short)columns;
if(m_fd < 0) return;
ioctl(m_fd,TIOCSWINSZ,(char *)&wsize);
}
void MyPty::donePty()
{
// This is code from the Qt DumbTerminal example
- int status = 0;
::close(m_fd);
if (m_cpid) {
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);
}
const char* MyPty::deviceName()
{
return m_ttynam;
}
@@ -236,48 +235,49 @@ int MyPty::openPty()
/*!
Create an instance.
*/
MyPty::MyPty(const Profile& prof) : m_cpid(0)
{
int term = prof.readNumEntry("Terminal", Profile::VT100 );
switch( term ) {
default:
case Profile::VT100:
case Profile::VT102:
m_term = "vt100";
break;
case Profile::Linux:
m_term = "linux";
break;
case Profile::XTerm:
m_term = "xterm";
break;
}
m_sn_e = 0l;
m_sn_r = 0l;
m_fd = openPty();
ProcCtl* ctl = ProcCtl::self();
+ Q_UNUSED(ctl);
}
/*!
Destructor.
Note that the related client program is not killed
(yet) when a instance is deleted.
*/
MyPty::~MyPty()
{
donePty();
}
QString MyPty::identifier()const {
return QString::fromLatin1("term");
}
QString MyPty::name()const{
return identifier();
}
bool MyPty::open() {
if (m_fd < 0)
m_fd = openPty();
start();
return true;
}