Skip to content

Commit 24e06a4

Browse files
committed
Remove unused mAnnotationForm member + getter/setter from QgsVectorLayer
1 parent 33b6fab commit 24e06a4

File tree

5 files changed

+1
-43
lines changed

5 files changed

+1
-43
lines changed

doc/api_break.dox

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2213,6 +2213,7 @@ displayExpression instead. For the map tip use mapTipTemplate() instead.
22132213
- insertSegmentVerticesForSnap() has been removed - use addTopologicalPoints() directly.
22142214
- addFeature() no longer accepts an alsoUpdateExtent boolean - this extra argument has been ignored for some time
22152215
- addFeatures() no longer accepts a makeSelected boolean, and will not automatically select newly added features. If desired, features must be manually selected by calling selectByIds() after addFeatures()
2216+
- annotationForm() and setAnnotationForm() have been removed. Form path is stored in individual QgsFormAnnotation objects.
22162217

22172218

22182219
QgsVectorLayerEditBuffer {#qgis_api_break_3_0_QgsVectorLayerEditBuffer}

python/core/qgsvectorlayer.sip

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1307,17 +1307,6 @@ Delete a feature from the layer (but does not commit it)
13071307
:rtype: bool
13081308
%End
13091309

1310-
QString annotationForm() const;
1311-
%Docstring
1312-
Get annotation form
1313-
:rtype: str
1314-
%End
1315-
1316-
void setAnnotationForm( const QString &ui );
1317-
%Docstring
1318-
Set annotation form for layer
1319-
%End
1320-
13211310
QList<QgsRelation> referencingRelations( int idx ) const;
13221311
%Docstring
13231312
Get relations, where the foreign key is on this layer

src/app/qgsformannotationdialog.cpp

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,6 @@ void QgsFormAnnotationDialog::applySettingsToItem()
6262
{
6363
QgsFormAnnotation *annotation = static_cast< QgsFormAnnotation * >( mItem->annotation() );
6464
annotation->setDesignerForm( mFileLineEdit->text() );
65-
QgsVectorLayer *layer = qobject_cast< QgsVectorLayer * >( annotation->mapLayer() );
66-
if ( layer )
67-
{
68-
//set last used annotation form as default for the layer
69-
layer->setAnnotationForm( mFileLineEdit->text() );
70-
}
7165
mItem->update();
7266
}
7367
}

src/core/qgsvectorlayer.cpp

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1589,13 +1589,6 @@ bool QgsVectorLayer::readSymbology( const QDomNode &layerNode, QString &errorMes
15891589
// process the attribute actions
15901590
mActions->readXml( layerNode );
15911591

1592-
QDomNode annotationFormNode = layerNode.namedItem( QStringLiteral( "annotationform" ) );
1593-
if ( !annotationFormNode.isNull() )
1594-
{
1595-
QDomElement e = annotationFormNode.toElement();
1596-
mAnnotationForm = QgsProject::instance()->readPath( e.text() );
1597-
}
1598-
15991592
mAttributeAliasMap.clear();
16001593
QDomNode aliasesNode = layerNode.namedItem( QStringLiteral( "aliases" ) );
16011594
if ( !aliasesNode.isNull() )
@@ -1927,11 +1920,6 @@ bool QgsVectorLayer::writeSymbology( QDomNode &node, QDomDocument &doc, QString
19271920
++index;
19281921
}
19291922

1930-
QDomElement afField = doc.createElement( QStringLiteral( "annotationform" ) );
1931-
QDomText afText = doc.createTextNode( QgsProject::instance()->writePath( mAnnotationForm ) );
1932-
afField.appendChild( afText );
1933-
node.appendChild( afField );
1934-
19351923
//attribute aliases
19361924
QDomElement aliasElem = doc.createElement( QStringLiteral( "aliases" ) );
19371925
Q_FOREACH ( const QgsField &field, mFields )
@@ -2636,11 +2624,6 @@ bool QgsVectorLayer::isModified() const
26362624
return mEditBuffer && mEditBuffer->isModified();
26372625
}
26382626

2639-
void QgsVectorLayer::setAnnotationForm( const QString &ui )
2640-
{
2641-
mAnnotationForm = ui;
2642-
}
2643-
26442627
void QgsVectorLayer::setRenderer( QgsFeatureRenderer *r )
26452628
{
26462629
if ( !hasGeometryType() )

src/core/qgsvectorlayer.h

Lines changed: 0 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1247,12 +1247,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
12471247
*/
12481248
bool rollBack( bool deleteBuffer = true );
12491249

1250-
//! Get annotation form
1251-
QString annotationForm() const { return mAnnotationForm; }
1252-
1253-
//! Set annotation form for layer
1254-
void setAnnotationForm( const QString &ui );
1255-
12561250
/**
12571251
* Get relations, where the foreign key is on this layer
12581252
*
@@ -1981,9 +1975,6 @@ class CORE_EXPORT QgsVectorLayer : public QgsMapLayer, public QgsExpressionConte
19811975

19821976
QStringList mCommitErrors;
19831977

1984-
//! Annotation form for this layer
1985-
QString mAnnotationForm;
1986-
19871978
//! stores information about uncommitted changes to layer
19881979
QgsVectorLayerEditBuffer *mEditBuffer = nullptr;
19891980
friend class QgsVectorLayerEditBuffer;

0 commit comments

Comments
 (0)