@@ -115,8 +115,9 @@ void QgsProcessingModelComponent::saveCommonProperties( QVariantMap &map ) const
115
115
map.insert ( QStringLiteral ( " parameters_collapsed" ), mTopEdgeLinksCollapsed );
116
116
map.insert ( QStringLiteral ( " outputs_collapsed" ), mBottomEdgeLinksCollapsed );
117
117
map.insert ( QStringLiteral ( " color" ), mColor .isValid () ? QgsSymbolLayerUtils::encodeColor ( mColor ) : QString () );
118
- if ( comment () )
119
- map.insert ( QStringLiteral ( " comment" ), comment ()->toVariant () );
118
+ const QgsProcessingModelComment *thisComment = comment ();
119
+ if ( thisComment )
120
+ map.insert ( QStringLiteral ( " comment" ), thisComment->toVariant () );
120
121
}
121
122
122
123
void QgsProcessingModelComponent::restoreCommonProperties ( const QVariantMap &map )
@@ -131,8 +132,9 @@ void QgsProcessingModelComponent::restoreCommonProperties( const QVariantMap &ma
131
132
mColor = map.value ( QStringLiteral ( " color" ) ).toString ().isEmpty () ? QColor () : QgsSymbolLayerUtils::decodeColor ( map.value ( QStringLiteral ( " color" ) ).toString () );
132
133
mTopEdgeLinksCollapsed = map.value ( QStringLiteral ( " parameters_collapsed" ) ).toBool ();
133
134
mBottomEdgeLinksCollapsed = map.value ( QStringLiteral ( " outputs_collapsed" ) ).toBool ();
134
- if ( comment () )
135
- comment ()->loadVariant ( map.value ( QStringLiteral ( " comment" ) ).toMap () );
135
+ QgsProcessingModelComment *thisComment = comment ();
136
+ if ( thisComment )
137
+ thisComment->loadVariant ( map.value ( QStringLiteral ( " comment" ) ).toMap () );
136
138
}
137
139
138
140
void QgsProcessingModelComponent::copyNonDefinitionProperties ( const QgsProcessingModelComponent &other )
@@ -141,13 +143,15 @@ void QgsProcessingModelComponent::copyNonDefinitionProperties( const QgsProcessi
141
143
setSize ( other.size () );
142
144
setLinksCollapsed ( Qt::TopEdge, other.linksCollapsed ( Qt::TopEdge ) );
143
145
setLinksCollapsed ( Qt::BottomEdge, other.linksCollapsed ( Qt::BottomEdge ) );
144
- if ( comment () && other.comment () )
146
+ QgsProcessingModelComment *thisComment = comment ();
147
+ const QgsProcessingModelComment *otherComment = other.comment ();
148
+ if ( thisComment && otherComment )
145
149
{
146
- if ( !other. comment () ->position ().isNull () )
147
- comment () ->setPosition ( other. comment () ->position () );
150
+ if ( !otherComment ->position ().isNull () )
151
+ thisComment ->setPosition ( otherComment ->position () );
148
152
else
149
- comment () ->setPosition ( other.position () + QPointF ( size ().width (), -1.5 * size ().height () ) );
150
- comment () ->setSize ( other. comment () ->size () );
153
+ thisComment ->setPosition ( other.position () + QPointF ( size ().width (), -1.5 * size ().height () ) );
154
+ thisComment ->setSize ( otherComment ->size () );
151
155
}
152
156
}
153
157
0 commit comments