From: vsr Date: Tue, 9 Aug 2016 12:48:39 +0000 (+0300) Subject: 0023313: [CEA 1917] bug_1194_start_log regression X-Git-Tag: V8_1_0b1~5 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5048f73c785ad028c55725772989a6e3c50aa663;p=modules%2Fgui.git 0023313: [CEA 1917] bug_1194_start_log regression --- 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