X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSalomeApp%2FSalomeApp_StudyPropertiesDlg.cxx;h=5e37e61832de2119a098539203ce109be4731367;hb=3a4b698ac7ed25240f496594293eeab6a839c7d6;hp=043a2e30c1ca8ec91647354a1be46fd3f317a3eb;hpb=26ac7ca874ce9a796ff7ad43685f42afca635df9;p=modules%2Fgui.git diff --git a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx index 043a2e30c..5e37e6183 100644 --- a/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx +++ b/src/SalomeApp/SalomeApp_StudyPropertiesDlg.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2016 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 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 @@ -25,6 +25,7 @@ // Author : Roman NIKOLAEV #include "SalomeApp_StudyPropertiesDlg.h" +#include "SalomeApp_Application.h" #include "SalomeApp_Study.h" #include "SUIT_Session.h" @@ -69,12 +70,6 @@ SalomeApp_StudyPropertiesDlg::SalomeApp_StudyPropertiesDlg(QWidget* parent) setWindowFlags( windowFlags() & ~Qt::WindowContextHelpButtonHint ); - // Display study properties - SalomeApp_Study* study = - dynamic_cast( SUIT_Session::session()->activeApplication()->activeStudy() ); - if (study) - myStudyDoc = study->studyDS(); - //Author QLabel* authorLbl = new QLabel(tr("PRP_AUTHOR"),this); myAuthor = new QLineEdit(this); @@ -173,10 +168,10 @@ SalomeApp_StudyPropertiesDlg::~SalomeApp_StudyPropertiesDlg() */ void SalomeApp_StudyPropertiesDlg::initData() { - bool hasData = (myStudyDoc != NULL); + bool hasData = (SalomeApp_Application::getStudy() != NULL); _PTR(AttributeStudyProperties) propAttr; if (hasData) - propAttr = myStudyDoc->GetProperties(); + propAttr = SalomeApp_Application::getStudy()->GetProperties(); hasData = hasData && propAttr; if (hasData) { @@ -231,7 +226,7 @@ void SalomeApp_StudyPropertiesDlg::initData() std::vector aMins, aHours, aDays, aMonths, aYears; propAttr->GetModificationsList(aUsers, aMins, aHours, aDays, aMonths, aYears, false); int aCnt = aUsers.size(); - for ( int i = 0; i < aCnt; i++ ) { + for ( int i = 0; i < (int)aCnt; i++ ) { QString date; date.sprintf("%2.2d/%2.2d/%2d %2.2d:%2.2d", aDays [i], @@ -248,7 +243,7 @@ void SalomeApp_StudyPropertiesDlg::initData() //Component versions std::vector aComponents = propAttr->GetStoredComponents(); - for ( int i = 0; i < aComponents.size(); i++ ) { + for ( int i = 0; i < (int)aComponents.size(); i++ ) { std::vector aMins, aHours, aDays, aMonths, aYears; std::vector aVersions = propAttr->GetComponentVersions(aComponents[i]); QStringList aData; @@ -268,7 +263,7 @@ void SalomeApp_StudyPropertiesDlg::initData() */ void SalomeApp_StudyPropertiesDlg::clickOnOk() { - _PTR(AttributeStudyProperties) propAttr = myStudyDoc->GetProperties(); + _PTR(AttributeStudyProperties) propAttr = SalomeApp_Application::getStudy()->GetProperties(); //Firstly, store locked flag if(propAttr) { bool bLocked = myLocked->isChecked();