From c6ed220b68e09fe498f48618c86f350824be6fb1 Mon Sep 17 00:00:00 2001 From: abd Date: Fri, 30 May 2008 12:10:15 +0000 Subject: [PATCH] Fix crossnaming problem on WIN32 platform To the name of PyInterp execution status added prefix ES_ --- src/PyConsole/PyConsole_Editor.cxx | 14 +++++++------- src/PyInterp/PyInterp_Dispatcher.cxx | 2 +- src/PyInterp/PyInterp_Dispatcher.h | 3 ++- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/PyConsole/PyConsole_Editor.cxx b/src/PyConsole/PyConsole_Editor.cxx index fea5d6804..af69ea1fb 100644 --- a/src/PyConsole/PyConsole_Editor.cxx +++ b/src/PyConsole/PyConsole_Editor.cxx @@ -138,7 +138,7 @@ public: PyConsole_Editor* theListener, bool sync = false ) : PyInterp_LockRequest( theInterp, theListener, sync ), - myCommand( theCommand ), myState( PyInterp_Event::OK ) + myCommand( theCommand ), myState( PyInterp_Event::ES_OK ) {} protected: @@ -152,9 +152,9 @@ protected: { int ret = getInterp()->run( myCommand.toLatin1() ); if ( ret < 0 ) - myState = PyInterp_Event::ERROR; + myState = PyInterp_Event::ES_ERROR; else if ( ret > 0 ) - myState = PyInterp_Event::INCOMPLETE; + myState = PyInterp_Event::ES_INCOMPLETE; } } @@ -906,8 +906,8 @@ void PyConsole_Editor::customEvent( QEvent* event ) addText( pe->text() ); return; } - case PyInterp_Event::OK: - case PyInterp_Event::ERROR: + case PyInterp_Event::ES_OK: + case PyInterp_Event::ES_ERROR: { // clear command buffer myCommandBuffer.truncate( 0 ); @@ -928,7 +928,7 @@ void PyConsole_Editor::customEvent( QEvent* event ) myEventLoop->exit(); break; } - case PyInterp_Event::INCOMPLETE: + case PyInterp_Event::ES_INCOMPLETE: { // extend command buffer (multi-line command) myCommandBuffer.append( "\n" ); @@ -958,7 +958,7 @@ void PyConsole_Editor::customEvent( QEvent* event ) // unset history browsing mode myCmdInHistory = -1; - if ( (int)event->type() == (int)PyInterp_Event::OK && myQueue.count() > 0 ) + if ( (int)event->type() == (int)PyInterp_Event::ES_OK && myQueue.count() > 0 ) { // process the next sheduled command from the queue (if there is any) QString nextcmd = myQueue[0]; diff --git a/src/PyInterp/PyInterp_Dispatcher.cxx b/src/PyInterp/PyInterp_Dispatcher.cxx index e3adb001d..052ccbf19 100755 --- a/src/PyInterp/PyInterp_Dispatcher.cxx +++ b/src/PyInterp/PyInterp_Dispatcher.cxx @@ -62,7 +62,7 @@ void PyInterp_Request::Destroy( PyInterp_Request* request ) QEvent* PyInterp_Request::createEvent() const { - return new PyInterp_Event( PyInterp_Event::NOTIFY, (PyInterp_Request*)this ); + return new PyInterp_Event( PyInterp_Event::ES_NOTIFY, (PyInterp_Request*)this ); } void PyInterp_Request::processEvent( QObject* o ) diff --git a/src/PyInterp/PyInterp_Dispatcher.h b/src/PyInterp/PyInterp_Dispatcher.h index cf46694e4..903fea356 100755 --- a/src/PyInterp/PyInterp_Dispatcher.h +++ b/src/PyInterp/PyInterp_Dispatcher.h @@ -102,7 +102,8 @@ class PYINTERP_EXPORT PyInterp_Event : public QEvent PyInterp_Event( const PyInterp_Event& ); public: - enum { NOTIFY = QEvent::User + 5000, OK, ERROR, INCOMPLETE, LAST }; + //Execution state + enum { ES_NOTIFY = QEvent::User + 5000, ES_OK, ES_ERROR, ES_INCOMPLETE, ES_LAST }; PyInterp_Event( int type, PyInterp_Request* request ) : QEvent( (QEvent::Type)type ), myRequest( request ) {} -- 2.39.2