@@ -370,7 +370,7 @@ void GraphicsView::drawElements(ModelInstance::Model *pModelInstance, bool inher
370370 if (pModelInstanceElement->isComponent () && pModelInstanceElement->getModel ()) {
371371 auto pModelInstanceComponent = dynamic_cast <ModelInstance::Component*>(pModelInstanceElement);
372372 elementIndex++;
373- if (pModelInstanceComponent->getModel ()-> isConnector ()) {
373+ if (pModelInstanceComponent->isConnector ()) {
374374 connectorIndex++;
375375 }
376376 if (modelInfo.mDiagramElementsList .isEmpty () || inherited) {
@@ -386,7 +386,7 @@ void GraphicsView::drawElements(ModelInstance::Model *pModelInstance, bool inher
386386 pDiagramGraphicsView->addElementItem (pDiagramElement);
387387 pDiagramGraphicsView->addElementToList (pDiagramElement);
388388 pDiagramGraphicsView->deleteElementFromOutOfSceneList (pDiagramElement);
389- if (pModelInstanceComponent->getModel ()-> isConnector () && connectorIndex < modelInfo.mIconElementsList .size ()) {
389+ if (pModelInstanceComponent->isConnector () && connectorIndex < modelInfo.mIconElementsList .size ()) {
390390 Element *pIconElement = modelInfo.mIconElementsList .at (connectorIndex);
391391 if (pIconElement) {
392392 pIconElement->setModelComponent (pModelInstanceComponent);
@@ -938,14 +938,14 @@ void GraphicsView::addElementToView(ModelInstance::Component *pComponent, bool i
938938 GraphicsView *pDiagramGraphicsView = mpModelWidget->getDiagramGraphicsView ();
939939
940940 // if element is of connector type.
941- if (pComponent && pComponent->getModel ()-> isConnector ()) {
941+ if (pComponent && pComponent->isConnector ()) {
942942 // Connector type elements exists on icon view as well
943943 pIconElement = new Element (pComponent, inherited, pIconGraphicsView, createTransformation, position, placementAnnotation);
944944 }
945945 pDiagramElement = new Element (pComponent, inherited, pDiagramGraphicsView, createTransformation, position, placementAnnotation);
946946
947947 // if element is of connector type && containing class is Modelica type.
948- if (pIconElement && pComponent->getModel ()-> isConnector ()) {
948+ if (pIconElement && pComponent->isConnector ()) {
949949 // Connector type elements exists on icon view as well
950950 if (pIconElement->mTransformation .isValid () && pIconElement->mTransformation .getVisible ()) {
951951 pIconGraphicsView->addElementItem (pIconElement);
@@ -1120,7 +1120,7 @@ void GraphicsView::deleteElement(Element *pElement)
11201120 if (mpModelWidget->getLibraryTreeItem ()->isSSP ()) {
11211121 OMSProxy::instance ()->omsDelete (pElement->getLibraryTreeItem ()->getNameStructure ());
11221122 } else {
1123- if (pElement->getModel () && pElement-> getModel ()-> isConnector ()) {
1123+ if (pElement->isConnector ()) {
11241124 GraphicsView *pGraphicsView;
11251125 if (isIconView ()) {
11261126 pGraphicsView = mpModelWidget->getDiagramGraphicsView ();
@@ -3113,12 +3113,12 @@ Element* GraphicsView::connectorElementAtPosition(QPoint position)
31133113 return 0 ;
31143114 } else if (pRootElement && !pRootElement->isSelected ()) {
31153115 // Issue #11310. If both root and element are connectors then use the root.
3116- if (pRootElement->getModel () && pRootElement-> getModel ()-> isConnector () && pElement && pElement-> getModel () && pElement-> getModel () ->isConnector ()) {
3116+ if (pRootElement->isConnector () && pElement && pElement->isConnector ()) {
31173117 pElement = pRootElement;
31183118 }
31193119 if (MainWindow::instance ()->getConnectModeAction ()->isChecked () && isDiagramView () &&
31203120 !(mpModelWidget->getLibraryTreeItem ()->isSystemLibrary () || mpModelWidget->isElementMode () || isVisualizationView ()) &&
3121- (( pElement->getModel () && pElement-> getModel ()-> isConnector () ) ||
3121+ (pElement->isConnector () ||
31223122 (mpModelWidget->getLibraryTreeItem ()->isSSP () &&
31233123 (pElement->getLibraryTreeItem ()->getOMSConnector () || pElement->getLibraryTreeItem ()->getOMSBusConnector ()
31243124 || pElement->getLibraryTreeItem ()->getOMSTLMBusConnector () || pElement->isPort ())))) {
@@ -3640,7 +3640,7 @@ void GraphicsView::copyItems(bool cut)
36403640 QJsonObject componentJsonObject;
36413641 componentJsonObject.insert (QLatin1String (" classname" ), pElement->getClassName ());
36423642 componentJsonObject.insert (QLatin1String (" name" ), pElement->getName ());
3643- componentJsonObject.insert (QLatin1String (" connector" ), pElement->getModel () ? pElement-> getModel ()-> isConnector () : false );
3643+ componentJsonObject.insert (QLatin1String (" connector" ), pElement->isConnector ());
36443644 componentJsonObject.insert (QLatin1String (" placement" ), pElement->getOMCPlacementAnnotation (QPointF (0 , 0 )));
36453645 componentsJsonArray.append (componentJsonObject);
36463646 } else if (ShapeAnnotation *pShapeAnnotation = dynamic_cast <ShapeAnnotation*>(itemsList.at (i))) {
@@ -7018,7 +7018,7 @@ void ModelWidget::selectDeselectElement(const QString &name, bool selected)
70187018 pDiagramElement->setIgnoreSelection (true );
70197019 pDiagramElement->setSelected (selected);
70207020 pDiagramElement->setIgnoreSelection (false );
7021- if (mpIconGraphicsView && pDiagramElement->getModel () && pDiagramElement-> getModel ()-> isConnector ()) {
7021+ if (mpIconGraphicsView && pDiagramElement->isConnector ()) {
70227022 Element *pIconElement = mpIconGraphicsView->getElementObjectFromQualifiedName (name);
70237023 pIconElement->setIgnoreSelection (true );
70247024 pIconElement->setSelected (selected);
0 commit comments