From 1711d8d060ea0c84bfb3bf282651354b5a7fd1d9 Mon Sep 17 00:00:00 2001 From: vsr Date: Tue, 9 Aug 2016 15:48:39 +0300 Subject: [PATCH] 0023313: [CEA 1917] bug_1194_start_log regression --- tools/PyConsole/src/PyConsole_Editor.cxx | 11 ++++++----- tools/PyConsole/src/PyConsole_Editor.h | 2 ++ 2 files changed, 8 insertions(+), 5 deletions(-) diff --git a/tools/PyConsole/src/PyConsole_Editor.cxx b/tools/PyConsole/src/PyConsole_Editor.cxx index 7d540f62f..e177a03ef 100644 --- a/tools/PyConsole/src/PyConsole_Editor.cxx +++ b/tools/PyConsole/src/PyConsole_Editor.cxx @@ -128,18 +128,20 @@ namespace static QString READY_PROMPT = ">>> "; static QString DOTS_PROMPT = "... "; -void staticCallbackStdout( void* data, char* c ) +void PyConsole_CallbackStdout( void* data, char* c ) { if(!((PyConsole_Editor*)data)->isSuppressOutput()) { PyConsole_Editor* e = (PyConsole_Editor*)data; + e->putLog( fromUtf8(c) ); QApplication::postEvent( e, new PyConsole_PrintEvent( fromUtf8(c), false ) ); } } -void staticCallbackStderr( void* data, char* c ) +void PyConsole_CallbackStderr( void* data, char* c ) { if(!((PyConsole_Editor*)data)->isSuppressOutput()) { PyConsole_Editor* e = (PyConsole_Editor*)data; + e->putLog( fromUtf8(c) ); QApplication::postEvent( e, new PyConsole_PrintEvent( fromUtf8(c), true ) ); } } @@ -174,8 +176,8 @@ PyConsole_Editor::PyConsole_Editor( PyConsole_Interp* theInterp, setAcceptRichText( false ); // set callbacks to interpeter - myInterp->setvoutcb( staticCallbackStdout, this ); - myInterp->setverrcb( staticCallbackStderr, this ); + myInterp->setvoutcb( PyConsole_CallbackStdout, this ); + myInterp->setverrcb( PyConsole_CallbackStderr, this ); // print banner if ( isShowBanner() ) addText( banner() ); @@ -1157,7 +1159,6 @@ void PyConsole_Editor::customEvent( QEvent* event ) case PyConsole_PrintEvent::EVENT_ID: { PyConsole_PrintEvent* pe = (PyConsole_PrintEvent*)event; - putLog( pe->text()); addText( pe->text(), false, pe->isError() ); return; } diff --git a/tools/PyConsole/src/PyConsole_Editor.h b/tools/PyConsole/src/PyConsole_Editor.h index 774e101af..a63e8fcd1 100644 --- a/tools/PyConsole/src/PyConsole_Editor.h +++ b/tools/PyConsole/src/PyConsole_Editor.h @@ -132,6 +132,8 @@ private: QString myComplAfterPoint; //!< string on which the results of the dir() are matched int myComplCursorPos; //!< cursor position when is hit + friend void PyConsole_CallbackStdout( void*, char* ); + friend void PyConsole_CallbackStderr( void*, char* ); }; #endif // PYCONSOLE_EDITOR_H -- 2.39.2