Skip to content
Permalink
Browse files
Completely remove QgsVectorLayerFeatureIterator::FetchJoinInfo::joinL…
…ayer and note in api_break.dox

There's no point in keeping such a dangerous member in the api

(cherry picked from commit b1ddf5f)
  • Loading branch information
nyalldawson committed Jun 3, 2021
1 parent f24ef78 commit 79f096c959e9ce0f54151c569efd1c81e9602468
@@ -18,6 +18,8 @@ This page tries to maintain a list with incompatible changes that happened in pr



- QgsVectorLayerFeatureIterator::FetchJoinInfo::joinLayer was removed. This layer pointer was dangerous and not safe to access in any situation.

QGIS 3.4 {#qgis_api_break_3_4}
========

@@ -104,17 +104,12 @@ end of iterating: free the resources / lock
%End



struct FetchJoinInfo
{
const QgsVectorLayerJoinInfo *joinInfo;//!< Canonical source of information about the join
QgsAttributeList attributes; //!< Attributes to fetch
int indexOffset; //!< At what position the joined fields start

QgsVectorLayer *joinLayer /Deprecated/;


QgsFields joinLayerFields;

int targetField; //!< Index of field (of this layer) that drives the join
int joinField; //!< Index of field (of the joined layer) must have equal value
@@ -123,7 +118,6 @@ end of iterating: free the resources / lock
void addJoinedAttributesDirect( QgsFeature &f, const QVariant &joinValue ) const;
};


virtual bool isValid() const;


@@ -703,9 +703,6 @@ void QgsVectorLayerFeatureIterator::prepareJoin( int fieldIdx )
{
FetchJoinInfo info;
info.joinInfo = joinInfo;
Q_NOWARN_DEPRECATED_PUSH
info.joinLayer = joinLayer;
Q_NOWARN_DEPRECATED_POP
info.joinSource = std::make_shared< QgsVectorLayerFeatureSource >( joinLayer );
info.indexOffset = mSource->mJoinBuffer->joinedFieldsOffset( joinInfo, mSource->mFields );
info.targetField = mSource->mFields.indexFromName( joinInfo->targetFieldName() );
@@ -140,8 +140,6 @@ class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeatureItera

void setInterruptionChecker( QgsFeedback *interruptionChecker ) override SIP_SKIP;

Q_NOWARN_DEPRECATED_PUSH

/**
* Join information prepared for fast attribute id mapping in QgsVectorLayerJoinBuffer::updateFeatureAttributes().
* Created in the select() method of QgsVectorLayerJoinBuffer for the joins that contain fetched attributes
@@ -152,36 +150,31 @@ class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeatureItera
QgsAttributeList attributes; //!< Attributes to fetch
int indexOffset; //!< At what position the joined fields start

/**
* Resolved pointer to the joined layer
* \deprecated Do NOT use. This is not thread safe, and should never be accessed from a background thread.
*/
#ifndef SIP_RUN
Q_DECL_DEPRECATED QgsVectorLayer *joinLayer = nullptr;
#else
QgsVectorLayer *joinLayer SIP_DEPRECATED;
#endif

/**
* Feature source for join
*
* \note Not available in Python bindings
* \since QGIS 3.20
*/
std::shared_ptr< QgsVectorLayerFeatureSource > joinSource SIP_SKIP;
std::shared_ptr< QgsVectorLayerFeatureSource > joinSource;

/**
* Fields from joined layer.
*
* \note Not available in Python bindings
* \since QGIS 3.20
*/
QgsFields joinLayerFields;
#endif

int targetField; //!< Index of field (of this layer) that drives the join
int joinField; //!< Index of field (of the joined layer) must have equal value

void addJoinedAttributesCached( QgsFeature &f, const QVariant &joinValue ) const;
void addJoinedAttributesDirect( QgsFeature &f, const QVariant &joinValue ) const;
};
Q_NOWARN_DEPRECATED_POP


bool isValid() const override;

0 comments on commit 79f096c

Please sign in to comment.