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
  • Loading branch information
nyalldawson committed Jun 3, 2021
1 parent cebb1f8 commit c57d7ad6aa63505ce52ce2b50f0a4cfab925c89f
@@ -31,6 +31,8 @@ setDataSource {#qgis_api_break_3_20_setdatasource}

- QgsMapLayer::setDataSource is no longer virtual. It has been replaced with QgsMapLayer::setDataSourcePrivate. This is only relevant for subclassing QgsMapLayer, for code that only uses the subclasses (QgsVectorLayer, QgsRasterLayer, ...) this has no effect.

- 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;


@@ -710,9 +710,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
@@ -153,36 +151,31 @@ class CORE_EXPORT QgsVectorLayerFeatureIterator : public QgsAbstractFeatureItera
QMap<int, int> attributesSourceToDestLayerMap SIP_SKIP; //!< Mapping from original attribute index to the joined layer index
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 c57d7ad

Please sign in to comment.