#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)
+SALOME_Session_QThread* SALOME_Session_QThread::_singleton = 0;
+
//=============================================================================
/*! SALOME_Session_QThread
* constructor
SALOME_Session_QThread::SALOME_Session_QThread(int argc, char ** argv) : QThread()
{
+ INFOS("Creation SALOME_Session_QThread");
_qappl = 0 ;
_mw = 0 ;
_argc = argc ;
_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.
{
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() ;
QApplication *_qappl ;
SALOMEGUI_Application* _mw ;
+ SALOME_Session_QThread(int argc, char ** argv);
+
+private:
+ static SALOME_Session_QThread* _singleton;
} ;
#endif
{
_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) ;