-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
*/
CORBA::ORB_var SalomeApp_Engine_i::orb()
{
- ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
- // TODO: using QApplication here looks ugly, think how to
- // obtain the ORB reference in a nicer way...
- static CORBA::ORB_var _orb = init( qApp->argc(), qApp->argv() );
+ static CORBA::ORB_var _orb;
+
+ if ( CORBA::is_nil( _orb ) ) {
+ Qtx::CmdLineArgs args;
+ ORB_INIT& init = *SINGLETON_<ORB_INIT>::Instance();
+ _orb = init( args.argc(), args.argv() );
+ }
+
return _orb;
}
\param theComponentName - synthetic "component data type" used to identify a given light module
\return Object reference to the CORBA engine
*/
-CORBA::Object_ptr SalomeApp_Engine_i::engineForComponent( const char* theComponentName,
+CORBA::Object_ptr SalomeApp_Engine_i::EngineForComponent( const char* theComponentName,
bool toCreate )
{
CORBA::Object_var anEngine;
if ( !theComponentName || !strlen( theComponentName ) )
return anEngine._retn();
+ if ( SalomeApp_Application::moduleTitle( theComponentName ).isEmpty() )
+ return anEngine._retn();
+
std::string aPath( "/SalomeAppEngine/" );
aPath += theComponentName;
anEngine = namingService()->Resolve( aPath.c_str() );
bool toCreate )
{
std::string anIOR( "" );
- CORBA::Object_var anEngine = engineForComponent( theComponentName, toCreate );
+ CORBA::Object_var anEngine = EngineForComponent( theComponentName, toCreate );
if ( !CORBA::is_nil( anEngine ) )
{
CORBA::String_var objStr = orb()->object_to_string( anEngine.in() );
bool toCreate )
{
SalomeApp_Engine_i* aServant = 0;
- CORBA::Object_var anEngine = engineForComponent( theComponentName, toCreate );
+ CORBA::Object_var anEngine = EngineForComponent( theComponentName, toCreate );
if ( !CORBA::is_nil( anEngine ) )
{
PortableServer::Servant aServantBase = poa()->reference_to_servant( anEngine.in() );