Skip to content

Commit

Permalink
Deprecated unused, not-useful QgsVectorDataProvider::palAttributeInde…
Browse files Browse the repository at this point in the history
…xNames
  • Loading branch information
nyalldawson committed Apr 6, 2023
1 parent 0bc7bf5 commit 2e7b0dd
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 13 deletions.
Expand Up @@ -474,9 +474,12 @@ Returns list of indexes to fetch all attributes in :py:func:`~QgsVectorDataProvi
Returns list of indexes of fields that make up the primary key
%End

virtual QgsAttrPalIndexNameHash palAttributeIndexNames() const;
QgsAttrPalIndexNameHash palAttributeIndexNames() const /Deprecated/;
%Docstring
Returns list of indexes to names for :py:class:`QgsPalLabeling` fix

.. deprecated:: QGIS 3.32
this method is unused and will always return an empty hash
%End

bool supportedType( const QgsField &field ) const;
Expand Down
4 changes: 3 additions & 1 deletion src/core/vector/qgsvectordataprovider.h
Expand Up @@ -460,8 +460,10 @@ class CORE_EXPORT QgsVectorDataProvider : public QgsDataProvider, public QgsFeat

/**
* Returns list of indexes to names for QgsPalLabeling fix
*
* \deprecated since QGIS 3.32 this method is unused and will always return an empty hash
*/
virtual QgsAttrPalIndexNameHash palAttributeIndexNames() const;
Q_DECL_DEPRECATED QgsAttrPalIndexNameHash palAttributeIndexNames() const SIP_DEPRECATED;

/**
* check if provider supports type of field
Expand Down
1 change: 0 additions & 1 deletion src/providers/arcgisrest/qgsafsprovider.h
Expand Up @@ -65,7 +65,6 @@ class QgsAfsProvider : public QgsVectorDataProvider
QgsVectorDataProvider::Capabilities capabilities() const override;
QgsAttributeList pkAttributeIndexes() const override;
QString defaultValueClause( int fieldId ) const override;
QgsAttrPalIndexNameHash palAttributeIndexNames() const override { return QgsAttrPalIndexNameHash(); }
bool skipConstraintCheck( int fieldIndex, QgsFieldConstraints::Constraint constraint, const QVariant &value = QVariant() ) const override;

QString subsetString() const override;
Expand Down
6 changes: 0 additions & 6 deletions src/providers/postgres/qgspostgresprovider.cpp
Expand Up @@ -1352,7 +1352,6 @@ bool QgsPostgresProvider::loadFields()
fieldTypeName = originalFormattedFieldType;
}

mAttrPalIndexName.insert( i, fieldName );
// If this is an identity field with constraints and there is no default, let's look for a sequence:
// we might have a default value created by a sequence named <table>_<field>_seq
if ( ! identityMap[tableoid ][ attnum ].isEmpty()
Expand Down Expand Up @@ -5231,11 +5230,6 @@ QList<QgsRelation> QgsPostgresProvider::discoverRelations( const QgsVectorLayer
return result;
}

QgsAttrPalIndexNameHash QgsPostgresProvider::palAttributeIndexNames() const
{
return mAttrPalIndexName;
}

void QgsPostgresProvider::setQuery( const QString &query )
{
mQuery = query;
Expand Down
4 changes: 0 additions & 4 deletions src/providers/postgres/qgspostgresprovider.h
Expand Up @@ -209,7 +209,6 @@ class QgsPostgresProvider final: public QgsVectorDataProvider
static QVariant convertValue( QVariant::Type type, QVariant::Type subType, const QString &value, const QString &typeName, QgsPostgresConn *conn );

QList<QgsRelation> discoverRelations( const QgsVectorLayer *target, const QList<QgsVectorLayer *> &layers ) const override;
QgsAttrPalIndexNameHash palAttributeIndexNames() const override;

/**
* Returns true if the data source has metadata, false otherwise. For
Expand Down Expand Up @@ -338,9 +337,6 @@ class QgsPostgresProvider final: public QgsVectorDataProvider
*/
void reloadProviderData() override;

//! Old-style mapping of index to name for QgsPalLabeling fix
QgsAttrPalIndexNameHash mAttrPalIndexName;

QgsFields mAttributeFields;
QHash<int, char> mIdentityFields;
QString mDataComment;
Expand Down

0 comments on commit 2e7b0dd

Please sign in to comment.