From kde-commits Thu Sep 30 22:28:12 2004 From: Michal Rudolf Date: Thu, 30 Sep 2004 22:28:12 +0000 To: kde-commits Subject: kdewebdev/kommander Message-Id: <20040930222812.A78CA9911 () office ! kde ! org> X-MARC-Message: https://marc.info/?l=kde-commits&m=109658330209027 CVS commit by mrudolf: CCMAIL: kommander@mail.kdewebdev.org Fix the problem with output not being sent to stdout by ExecButton. M +5 -0 widget/myprocess.cpp 1.10 M +1 -0 widget/myprocess.h 1.4 M +8 -2 widgets/execbutton.cpp 1.27 --- kdewebdev/kommander/widget/myprocess.cpp #1.9:1.10 @@ -41,4 +41,9 @@ void MyProcess::setBlocking(bool blockin } +QString MyProcess::output() +{ + return m_output; +} + bool MyProcess::isBlocking() { --- kdewebdev/kommander/widget/myprocess.h #1.3:1.4 @@ -36,4 +36,5 @@ public: void setBlocking(bool blocking); bool isBlocking(); + QString output(); signals: void processExited(MyProcess*); --- kdewebdev/kommander/widgets/execbutton.cpp #1.26:1.27 @@ -32,5 +32,7 @@ #include "execbutton.h" #include -#include +#include + +using namespace std; ExecButton::ExecButton(QWidget* a_parent, const char* a_name) @@ -104,9 +106,11 @@ void ExecButton::startProcess() process->setBlocking(m_blockGUI == GUI); connect(process, SIGNAL(processExited(MyProcess*)), SLOT(processExited(MyProcess*))); - m_output = process->run(at); + process->run(at); if (m_blockGUI == GUI) { setEnabled(true); KApplication::restoreOverrideCursor(); + if (writeStdout()) + cout << process->output(); } } @@ -137,4 +141,6 @@ void ExecButton::processExited(MyProcess if (blockGUI() != None) setEnabled(true); + if (writeStdout()) + cout << p->output(); delete p; }