X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FMEDCalc%2Fgui%2FDatasourceController.cxx;h=49a2a0720f8df68e45b3e771e5270fec7205a71e;hb=0946beb4bbeefcdea393f97fcb63654e1dca2eab;hp=f0f18b997dff9e65e6e5b982a941d69d7dc5bbcd;hpb=2dde0463274f805894a05551b876475d04dbce2d;p=modules%2Fmed.git diff --git a/src/MEDCalc/gui/DatasourceController.cxx b/src/MEDCalc/gui/DatasourceController.cxx index f0f18b997..49a2a0720 100644 --- a/src/MEDCalc/gui/DatasourceController.cxx +++ b/src/MEDCalc/gui/DatasourceController.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2020 CEA/DEN, EDF R&D +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public @@ -75,7 +75,8 @@ void DatasourceController::createActions() { QString tooltip = tr("TIP_ADD_DATA_SOURCE"); QString icon = tr("ICO_DATASOURCE_ADD"); int actionId; - actionId = _salomeModule->createStandardAction(label,this, SLOT(OnAddDatasource()),icon,tooltip); + actionId = _salomeModule->createStandardAction(label, this, SLOT(OnAddDatasource()), + icon, tooltip, FIELDSOp::OpAddDataSource); _salomeModule->createTool(actionId, toolbarId); // This action has to be placed in the general file menu with the label "Import MED file" @@ -242,11 +243,11 @@ void DatasourceController::OnExpandField() // First retrieve the fieldseries id associated to this study object SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeParameter_var aParam; - if ( soFieldseries->FindAttribute(anAttr,"AttributeParameter") ) { - aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); - if (! aParam->IsSet(FIELD_SERIES_ID, PT_INTEGER)) - return; - } + if ( !soFieldseries->FindAttribute(anAttr,"AttributeParameter") ) + return; + aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); + if (! aParam->IsSet(FIELD_SERIES_ID, PT_INTEGER)) + return; long fieldseriesId = aParam->GetInt(FIELD_SERIES_ID); STDLOG("Expand the field timeseries "<FindAttribute(anAttr,"AttributeParameter") ) { - aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); - if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN)) - return; - } + if ( !soField->FindAttribute(anAttr,"AttributeParameter") ) + return; + aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); + if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN)) + return; bool isInWorkspace = aParam->GetBool(IS_IN_WORKSPACE); if ( isInWorkspace ) { QMessageBox::warning(_salomeModule->getApp()->desktop(), @@ -365,11 +366,11 @@ void DatasourceController::OnUseInWorkspace() { continue; SALOMEDS::GenericAttribute_var anAttr; SALOMEDS::AttributeParameter_var aParam; - if ( soField->FindAttribute(anAttr,"AttributeParameter") ) { - aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); - if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN)) - return; - } + if ( !soField->FindAttribute(anAttr,"AttributeParameter") ) + return; + aParam = SALOMEDS::AttributeParameter::_narrow(anAttr); + if (! aParam->IsSet(IS_IN_WORKSPACE, PT_BOOLEAN)) + return; bool isInWorkspace = aParam->GetBool(IS_IN_WORKSPACE); if ( !isInWorkspace ) { if (! aParam->IsSet(FIELD_ID, PT_INTEGER))