X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOME_PYQT%2FSalomePyQt%2FSalomePyQt.cxx;h=eb1d87e5210b4cbb6ff49ec5f437324631ea7ce6;hb=8d986a56d8745aba15e2241a252c02bf30b53999;hp=d69a60b1b2284c06db0b87c5db6c99496327c8f8;hpb=5fa53d2d54fa2648c497af16e24f3afbad193866;p=modules%2Fgui.git diff --git a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx index d69a60b1b..eb1d87e52 100644 --- a/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx +++ b/src/SALOME_PYQT/SalomePyQt/SalomePyQt.cxx @@ -601,30 +601,6 @@ QTreeView* SalomePyQt::getObjectBrowser() return ProcessEvent( new TGetObjectBrowserEvent() ); } -/*! - \fn int SalomePyQt::getStudyId(); - \brief Get active study's identifier. - \return active study ID or 0 if there is no active study -*/ - -class TGetStudyIdEvent: public SALOME_Event -{ -public: - typedef int TResult; - TResult myResult; - TGetStudyIdEvent() : myResult( 0 ) {} - virtual void Execute() - { - if ( LightApp_Study* aStudy = getActiveStudy() ) { - myResult = aStudy->id(); - } - } -}; -int SalomePyQt::getStudyId() -{ - return ProcessEvent( new TGetStudyIdEvent() ); -} - /*! \fn SALOME_Selection* SalomePyQt::getSelection(); \brief Get the selection object for the current study. @@ -914,37 +890,23 @@ bool SalomePyQt::activateModule( const QString& modName ) } /*! - \brief Update an Object Browser of the specified (by identifier) study. - - If \a studyId <= 0 the active study's object browser is updated. - The \a updateSelection parameter is obsolete and currently is not used. - This parameter will be removed in future, so try to avoid its usage in - your code. - - \brief studyId study identifier - \brief updateSelection update selection flag (not used) - \sa getActiveStudy() + \brief Update an Object Browser of the study. */ -void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection ) +void SalomePyQt::updateObjBrowser() { class TEvent: public SALOME_Event { - int myStudyId; - bool myUpdateSelection; public: - TEvent( const int studyId, bool updateSelection ) - : myStudyId( studyId ), myUpdateSelection( updateSelection ) {} + TEvent() {} virtual void Execute() { if ( SUIT_Session::session() ) { - if ( getActiveStudy() && myStudyId <= 0 ) - myStudyId = getActiveStudy()->id(); - if ( myStudyId > 0 ) { + if ( getActiveStudy() ) { QList apps = SUIT_Session::session()->applications(); QList::Iterator it; for( it = apps.begin(); it != apps.end(); ++it ) { LightApp_Application* anApp = dynamic_cast( *it ); - if ( anApp && anApp->activeStudy() && anApp->activeStudy()->id() == myStudyId ) { + if ( anApp && anApp->activeStudy() ) { anApp->updateObjectBrowser(); return; } @@ -953,7 +915,7 @@ void SalomePyQt::updateObjBrowser( const int studyId, bool updateSelection ) } } }; - ProcessVoidEvent( new TEvent( studyId, updateSelection ) ); + ProcessVoidEvent( new TEvent() ); }