From: prascle Date: Mon, 15 Mar 2004 09:30:22 +0000 (+0000) Subject: PR: merge from trunk tag mergeto_KLOSS_br1_13Mar04 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=refs%2Fheads%2FKLOSS_br1;p=modules%2Fkernel.git PR: merge from trunk tag mergeto_KLOSS_br1_13Mar04 --- diff --git a/salome_adm/unix/config_files/check_omniorb.m4 b/salome_adm/unix/config_files/check_omniorb.m4 index 500abac31..c7a9699e3 100644 --- a/salome_adm/unix/config_files/check_omniorb.m4 +++ b/salome_adm/unix/config_files/check_omniorb.m4 @@ -30,19 +30,35 @@ then AC_SUBST(OMNIORB_IDL) OMNIORB_BIN=`echo ${OMNIORB_IDL} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` - OMNIORB_LIB=`echo ${OMNIORB_BIN} | sed -e "s,bin,lib,"` - - OMNIORB_ROOT=`echo ${OMNIORB_BIN} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` - OMNIORB_ROOT=`echo ${OMNIORB_ROOT} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` + OMNIORB_ROOT=${OMNIORB_BIN} + # one-level up + OMNIORB_ROOT=`echo ${OMNIORB_ROOT} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` + # + # + if test -d $OMNIORB_ROOT/include ; then + # if $OMNIORB_ROOT/include exists, there are a lot of chance that + # this is omniORB4.x installed via configure && make && make install + OMNIORB_LIB=`echo ${OMNIORB_BIN} | sed -e "s,bin\$,lib,"` + OMNIORB_VERSION=4 + else + # omniORB has been installed old way + OMNIORB_LIB=`echo ${OMNIORB_BIN} | sed -e "s,bin/,lib/,"` + # one-level up again + OMNIORB_ROOT=`echo ${OMNIORB_ROOT} | sed -e "s,[[^/]]*$,,;s,/$,,;s,^$,.,"` + if test -d $OMNIORB_ROOT/include/omniORB4 ; then + OMNIORB_VERSION=4 + else + OMNIORB_VERSION=3 + fi + fi AC_SUBST(OMNIORB_ROOT) - OMNIORB_INCLUDES="-I$OMNIORB_ROOT/include -I$OMNIORB_ROOT/include/omniORB3 -I$OMNIORB_ROOT/include/COS" -dnl OMNIORB_INCLUDES="-I$OMNIORB_ROOT/include -I$OMNIORB_ROOT/include/omniORB4 -I$OMNIORB_ROOT/include/COS" + OMNIORB_INCLUDES="-I$OMNIORB_ROOT/include -I$OMNIORB_ROOT/include/omniORB${OMNIORB_VERSION} -I$OMNIORB_ROOT/include/COS" AC_SUBST(OMNIORB_INCLUDES) ENABLE_PTHREADS - OMNIORB_CXXFLAGS= + OMNIORB_CXXFLAGS="-DOMNIORB_VERSION=$OMNIORB_VERSION" case $build_cpu in sparc*) AC_DEFINE(__sparc__) @@ -120,16 +136,23 @@ then AC_CHECK_LIB(nsl,gethostbyname, LIBS="-lnsl $LIBS",,) LIBS_old=$LIBS - OMNIORB_LIBS="$OMNIORB_LDFLAGS -lomniORB3 -ltcpwrapGK -lomniDynamic3 -lomnithread -lCOS3 -lCOSDynamic3" -dnl OMNIORB_LIBS="$OMNIORB_LDFLAGS -lomniORB4 -lomniDynamic4 -lomnithread -lCOS4 -lCOSDynamic4" + OMNIORB_LIBS="$OMNIORB_LDFLAGS" + OMNIORB_LIBS="$OMNIORB_LIBS -lomniORB${OMNIORB_VERSION}" + OMNIORB_LIBS="$OMNIORB_LIBS -lomniDynamic${OMNIORB_VERSION}" + OMNIORB_LIBS="$OMNIORB_LIBS -lCOS${OMNIORB_VERSION}" + OMNIORB_LIBS="$OMNIORB_LIBS -lCOSDynamic${OMNIORB_VERSION}" + OMNIORB_LIBS="$OMNIORB_LIBS -lomnithread" + if test $OMNIORB_VERSION = 3 ; then + OMNIORB_LIBS="$OMNIORB_LIBS -ltcpwrapGK" + fi AC_SUBST(OMNIORB_LIBS) LIBS="$OMNIORB_LIBS $LIBS" CXXFLAGS_old=$CXXFLAGS CXXFLAGS="$CXXFLAGS $OMNIORB_CXXFLAGS $OMNIORB_INCLUDES" - AC_MSG_CHECKING(whether we can link with omniORB3) - AC_CACHE_VAL(salome_cv_lib_omniorb3,[ + AC_MSG_CHECKING(whether we can link with omniORB) + AC_CACHE_VAL(salome_cv_lib_omniorb,[ AC_TRY_LINK( #include , CORBA::ORB_var orb, @@ -184,21 +207,22 @@ then CORBA_ORB_INIT_HAVE_3_ARGS=1 AC_DEFINE(CORBA_ORB_INIT_HAVE_3_ARGS) - CORBA_ORB_INIT_THIRD_ARG='"omniORB3"' - AC_DEFINE(CORBA_ORB_INIT_THIRD_ARG, "omniORB3") + CORBA_ORB_INIT_THIRD_ARG='"omniORB"' + AC_DEFINE(CORBA_ORB_INIT_THIRD_ARG, "omniORB") fi omniORBpy_ok=no if test "x$omniORB_ok" = "xyes" then - AC_MSG_CHECKING(omniORBpy (CORBA.py file available)) - if test -f ${OMNIORB_ROOT}/lib/python/CORBA.py - then - omniORBpy_ok=yes - PYTHONPATH=${OMNIORB_ROOT}/lib/python:${OMNIORB_LIB}:${PYTHON_PREFIX}/lib/python${PYTHON_VERSION}:${PYTHONPATH} - AC_SUBST(PYTHONPATH) + AC_MSG_CHECKING(omniORBpy) + $PYTHON -c "import omniORB" &> /dev/null + if test $? = 0 ; then AC_MSG_RESULT(yes) + omniORBpy_ok=yes + else + AC_MSG_RESULT(no, check your installation of omniORBpy) + omniORBpy_ok=no fi fi diff --git a/src/NamingService/SALOME_NamingService.hxx b/src/NamingService/SALOME_NamingService.hxx index e22bf2d16..dde326138 100644 --- a/src/NamingService/SALOME_NamingService.hxx +++ b/src/NamingService/SALOME_NamingService.hxx @@ -31,7 +31,8 @@ #include "utilities.h" //#include -#include +//##include +#include #include #include diff --git a/src/SALOMEDS/SALOMEDS_Client.cxx b/src/SALOMEDS/SALOMEDS_Client.cxx index aa39a9f52..37104eab0 100644 --- a/src/SALOMEDS/SALOMEDS_Client.cxx +++ b/src/SALOMEDS/SALOMEDS_Client.cxx @@ -279,8 +279,13 @@ int main(int argc, char** argv) { try { // Initialise the ORB. +#if OMNIORB_VERSION >= 4 + const char* options[][2] = { { "giopMaxMsgSize", "104857600" }, { 0, 0 } }; + CORBA::ORB_var orb = CORBA::ORB_init( argc , argv , "omniORB4", options) ; +#else CORBA::ORB_var orb = CORBA::ORB_init(argc, argv, "omniORB3"); omniORB::MaxMessageSize(100 * 1024 * 1024); +#endif // Obtain a reference to the root POA. CORBA::Object_var obj = orb->resolve_initial_references("RootPOA"); diff --git a/src/SALOMEDS/SALOMEDS_Server.cxx b/src/SALOMEDS/SALOMEDS_Server.cxx index 11be22065..1ed30a91e 100644 --- a/src/SALOMEDS/SALOMEDS_Server.cxx +++ b/src/SALOMEDS/SALOMEDS_Server.cxx @@ -129,8 +129,7 @@ int main(int argc, char** argv) } } } - - } + } catch( const SALOME_Exception &ex ) { MESSAGE( "Communication Error : " << ex.what() ); diff --git a/src/SALOMEGUI/QAD_ObjectBrowser.cxx b/src/SALOMEGUI/QAD_ObjectBrowser.cxx index d72f4c9d3..eb8435512 100644 --- a/src/SALOMEGUI/QAD_ObjectBrowser.cxx +++ b/src/SALOMEGUI/QAD_ObjectBrowser.cxx @@ -150,6 +150,8 @@ QAD_ObjectBrowser::QAD_ObjectBrowser( SALOMEDS::Study_var study, QWidget* parent myStudy = SALOMEDS::Study::_duplicate( study ); myListViewMap.clear(); myUseCaseMap.clear(); + myListView=0; // must be done before setupListView(): setCornerWidget() provoque call to eventFilter + myUseCaseView=0; // and test myUseCaseView->viewport() before initialisation setupListView(); } @@ -339,6 +341,7 @@ bool QAD_ObjectBrowser::eventFilter( QObject* o, QEvent* e ) return QTabWidget::eventFilter( o, e ); SALOMEDS::UseCaseBuilder_var UCBuilder = myStudy->GetUseCaseBuilder(); + if (! myUseCaseView) return QTabWidget::eventFilter( o, e ); if (o == myUseCaseView->viewport()) { if ( e->type() == QEvent::MouseButtonPress ) { // Test if clicked on selection and start drag if necessary diff --git a/src/Session/SALOME_Session_QThread.cxx b/src/Session/SALOME_Session_QThread.cxx index 8531be10f..8c598f1da 100644 --- a/src/Session/SALOME_Session_QThread.cxx +++ b/src/Session/SALOME_Session_QThread.cxx @@ -48,6 +48,8 @@ using namespace std; #include #include CORBA_SERVER_HEADER(SALOMEDS) +SALOME_Session_QThread* SALOME_Session_QThread::_singleton = 0; + //============================================================================= /*! SALOME_Session_QThread * constructor @@ -56,6 +58,7 @@ using namespace std; SALOME_Session_QThread::SALOME_Session_QThread(int argc, char ** argv) : QThread() { + INFOS("Creation SALOME_Session_QThread"); _qappl = 0 ; _mw = 0 ; _argc = argc ; @@ -63,6 +66,19 @@ SALOME_Session_QThread::SALOME_Session_QThread(int argc, char ** argv) : QThread _NS = 0 ; } ; +//============================================================================= +/*! + * + */ +//============================================================================= + + SALOME_Session_QThread* SALOME_Session_QThread::Instance(int argc, char ** argv) +{ + if (_singleton == 0) _singleton = new SALOME_Session_QThread(argc, argv); + return _singleton; + +} + //============================================================================= /*! run * Creates one QApplication for the all the session life. diff --git a/src/Session/SALOME_Session_QThread.hxx b/src/Session/SALOME_Session_QThread.hxx index 9e9941bd7..eac1da8d6 100644 --- a/src/Session/SALOME_Session_QThread.hxx +++ b/src/Session/SALOME_Session_QThread.hxx @@ -41,7 +41,7 @@ class SALOME_Session_QThread: public QThread { public: - SALOME_Session_QThread(int argc, char ** argv) ; + static SALOME_Session_QThread* Instance(int argc, char ** argv); //! launch the Qt main window of the GUI on a separate thread virtual void run() ; @@ -57,6 +57,10 @@ protected: QApplication *_qappl ; SALOMEGUI_Application* _mw ; + SALOME_Session_QThread(int argc, char ** argv); + +private: + static SALOME_Session_QThread* _singleton; } ; #endif diff --git a/src/Session/SALOME_Session_i.cxx b/src/Session/SALOME_Session_i.cxx index fb2d92a94..154848f21 100644 --- a/src/Session/SALOME_Session_i.cxx +++ b/src/Session/SALOME_Session_i.cxx @@ -52,7 +52,7 @@ SALOME_Session_i::SALOME_Session_i(int argc, char ** argv, CORBA::ORB_ptr orb, P { _argc = argc ; _argv = argv ; - _IAPPThread = new SALOME_Session_QThread(_argc, _argv) ; + _IAPPThread = SALOME_Session_QThread::Instance(_argc, _argv); _isGUI = FALSE ; _runningStudies= 0 ; _orb = CORBA::ORB::_duplicate(orb) ; diff --git a/src/Utils/Utils_ORB_INIT.cxx b/src/Utils/Utils_ORB_INIT.cxx index 0da127b34..0f39159ec 100644 --- a/src/Utils/Utils_ORB_INIT.cxx +++ b/src/Utils/Utils_ORB_INIT.cxx @@ -53,12 +53,15 @@ CORBA::ORB_var &ORB_INIT::operator() ( int argc , char **argv ) throw( CommExcep { try { - // const char* options[][2] = { { "giopMaxMsgSize", "104857600" }, { 0, 0 } }; - // _orb = CORBA::ORB_init( argc , argv , "omniORB4", options) ; +#if OMNIORB_VERSION >= 4 + const char* options[][2] = { { "giopMaxMsgSize", "104857600" }, { 0, 0 } }; + _orb = CORBA::ORB_init( argc , argv , "omniORB4", options) ; +#else _orb = CORBA::ORB_init( argc , argv ) ; //set GIOP message size equal to 50Mb for transferring brep shapes as //sequence of bytes using C++ streams omniORB::MaxMessageSize(100*1024*1024); +#endif } catch( const CORBA::Exception &ex ) {