<commit_before>using namespace std;
//  File      : QAD_Study.cxx
//  Created   : UI team, 05.09.00
//  Descr     : Study for QAD-based application

//  Modified  : Mon Dec 03 14:20:05 2001
//  Author    : <NAME>
//  Project   : SALOME
//  Module    : SALOMEGUI
//  Copyright : Open CASCADE 2001
//  $Header$

/*!
  \class QAD_Study QAD_Study.h
  \brief Study for QAD-based application.
*/

#include "QAD.h"
#include "QAD_Tools.h"
#include "QAD_Desktop.h"
#include "QAD_Study.h"
#include "QAD_RightFrame.h"
#include "QAD_LeftFrame.h"
#include "QAD_MessageBox.h"
#include "QAD_Application.h"
#include "QAD_ObjectBrowser.h"
#include "QAD_PyInterp.h"
#include "QAD_Config.h"
 
#include "utilities.h"

#include "SALOME_Selection.h"
#include "SALOME_TypeFilter.hxx"
#include "SALOME_InteractiveObject.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"

#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)

// OPEN CASCADE Include
#include <Standard_Failure.hxx>

// QT Include
#include <qapplication.h>

#define MAX_UNDO 10
/*!
    Constructor
*/
QAD_Study::QAD_Study(QAD_Application* app,
		     SALOMEDS::Study_var aStudy,
		     const QString& path ) :
myOperationState( Undef ),
myApp( app ),
myActiveStudyFrame( 0 ),
myStudyFrameCount( 0 ),
myPath( path )
{
    myStudy = aStudy;

    myTitle = QAD_Tools::getFileNameFromPath( path, false );

    myIsActive = false;
    myIsSaved = false;
    myIsModified = false;
    myIsReadOnly = false;

    myStudyFrames.clear();
    myOperations.clear();

    myStudyFrames.setAutoDelete( true );
    myOperations.setAutoDelete( true );
    myChildWidgets.setAutoDelete( true );

    /* create python interpreter */
    _interp = new QAD_PyInterp();
    SCRUTE(_interp);

    /* create default selection */
    //NRI    Selection( "Salome" );
    Selection( QAD_Application::getDesktop()->getComponentUserName( "KERNEL" ) );

    /* create study frame */
    myResult = true;
    createStudyFrame( getNextStudyFrameName() );

    /* set default Undo/Redo limit */
    QAD_ASSERT_DEBUG_ONLY( !myStudy->_is_nil() );
    SALOMEDS::StudyBuilder_var SB = myStudy->NewBuilder();
    SB->UndoLimit( MAX_UNDO );
}

/*!
    Destructor
*/
QAD_Study::~QAD_Study ()
{
  close();
}

/*!<commit_msg>NRI : Unload correction.<commit_after>using namespace std;
//  File      : QAD_Study.cxx
//  Created   : UI team, 05.09.00
//  Descr     : Study for QAD-based application

//  Modified  : Mon Dec 03 14:20:05 2001
//  Author    : <NAME>
//  Project   : SALOME
//  Module    : SALOMEGUI
//  Copyright : Open CASCADE 2001
//  $Header$

/*!
  \class QAD_Study QAD_Study.h
  \brief Study for QAD-based application.
*/

#include "QAD.h"
#include "QAD_Tools.h"
#include "QAD_Desktop.h"
#include "QAD_Study.h"
#include "QAD_RightFrame.h"
#include "QAD_LeftFrame.h"
#include "QAD_MessageBox.h"
#include "QAD_Application.h"
#include "QAD_ObjectBrowser.h"
#include "QAD_PyInterp.h"
#include "QAD_Config.h"
 
#include "utilities.h"

#include "SALOME_Selection.h"
#include "SALOME_TypeFilter.hxx"
#include "SALOME_InteractiveObject.hxx"
#include "SALOME_ListIteratorOfListIO.hxx"

#include <SALOMEconfig.h>
#include CORBA_SERVER_HEADER(SALOMEDS)

// OPEN CASCADE Include
#include <Standard_Failure.hxx>

// QT Include
#include <qapplication.h>

#define MAX_UNDO 10
/*!
    Constructor
*/
QAD_Study::QAD_Study(QAD_Application* app,
		     SALOMEDS::Study_var aStudy,
		     const QString& path ) :
myOperationState( Undef ),
myApp( app ),
myActiveStudyFrame( 0 ),
myStudyFrameCount( 0 ),
myPath( path )
{
    myStudy = aStudy;

    myTitle = QAD_Tools::getFileNameFromPath( path, false );

    myIsActive = false;
    myIsSaved = false;
    myIsModified = false;
    myIsReadOnly = false;

    myStudyFrames.clear();
    myOperations.clear();

    myStudyFrames.setAutoDelete( true );
    myOperations.setAutoDelete( true );
    myChildWidgets.setAutoDelete( true );

    /* create python interpreter */
    _interp = new QAD_PyInterp();
    SCRUTE(_interp);

    /* create default selection */
    //NRI    Selection( "Salome" );
    Selection( QAD_Application::getDesktop()->getComponentUserName( "KERNEL" ) );

    /* create study frame */
    myResult = true;
    createStudyFrame( getNextStudyFrameName() );

    /* set default Undo/Redo limit */
    QAD_ASSERT_DEBUG_ONLY( !myStudy->_is_nil() );
    SALOMEDS::StudyBuilder_var SB = myStudy->NewBuilder();
    SB->UndoLimit( MAX_UNDO );
}

/*!
    Destructor
*/
QAD_Study::~QAD_Study ()
{
  close();
  //SRN: added - clear selection in case the study will be loaded again so the title will coincide
  SALOME_Selection::RemoveSelection( QString(myTitle + "_" + mySelection) );

}

/*!
{'fraction_non_alphanumeric': 0.1298283261802575, 'fraction_numerical': 0.011158798283261802, 'mean_word_length': 3.661, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 19, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7192176', 'n_tokens_mistral': 1815, 'n_tokens_neox': 1662, 'n_words': 350}