From 1fcc56c5cec2560b430cde8f130413aa8bbf9af6 Mon Sep 17 00:00:00 2001 From: Kris Moore Date: Thu, 10 Mar 2016 07:07:26 -0500 Subject: Push some debugging for pty reading --- desktop-utilities/lumina-terminal/TerminalWidget.cpp | 7 ++++++- desktop-utilities/lumina-terminal/TtyProcess.cpp | 4 ++-- 2 files changed, 8 insertions(+), 3 deletions(-) (limited to 'desktop-utilities') diff --git a/desktop-utilities/lumina-terminal/TerminalWidget.cpp b/desktop-utilities/lumina-terminal/TerminalWidget.cpp index 3ab850bb..de7e47ff 100644 --- a/desktop-utilities/lumina-terminal/TerminalWidget.cpp +++ b/desktop-utilities/lumina-terminal/TerminalWidget.cpp @@ -29,7 +29,7 @@ TerminalWidget::TerminalWidget(QWidget *parent, QString dir) : QTextEdit(parent) upTimer = new QTimer(this); upTimer->setInterval(1000); - // connect(upTimer, SIGNAL(timeout()), this, SLOT(UpdateText()) ); + connect(upTimer, SIGNAL(timeout()), this, SLOT(UpdateText()) ); upTimer->start(); } @@ -48,7 +48,12 @@ void TerminalWidget::aboutToClose(){ // ================== void TerminalWidget::UpdateText(){ //read the data from the process + qDebug() << "UpdateText"; if(!PROC->isOpen()){ return; } + if ( PROC->bytesAvailable() <= 0 ) + return; + + qDebug() << "Reading all data"; QByteArray data = PROC->readAll(); //TTY PORT //QByteArray data = PROC->readAllStandardOutput(); //QProcess if(data.length()<=0){ return; } diff --git a/desktop-utilities/lumina-terminal/TtyProcess.cpp b/desktop-utilities/lumina-terminal/TtyProcess.cpp index 366a157b..757223ed 100644 --- a/desktop-utilities/lumina-terminal/TtyProcess.cpp +++ b/desktop-utilities/lumina-terminal/TtyProcess.cpp @@ -45,8 +45,8 @@ bool TTYProcess::startTTY(QString prog, QStringList args){ else{ childProc = tmp; this->setFileName( ptsname(FD) ); - //qDebug() << " - PTY:" << this->portName(); - return this->open(QIODevice::ReadWrite); + qDebug() << " - PTY:" << ptsname(FD); + return this->open(QIODevice::ReadWrite | QIODevice::Unbuffered); //return true; } } -- cgit