Add consistency between ptrs and ref

This commit is contained in:
Blottiere Paul 2017-07-02 16:58:54 +02:00
parent 53d70d2a47
commit 3e2d9c5445
5 changed files with 11 additions and 11 deletions

View File

@ -108,7 +108,7 @@ Quick way to test if there is any join at all
:rtype: list of const QgsVectorLayerJoinInfo
%End
QgsFeature joinedFeatureOf( const QgsVectorLayerJoinInfo &info, const QgsFeature &feature ) const;
QgsFeature joinedFeatureOf( const QgsVectorLayerJoinInfo *info, const QgsFeature &feature ) const;
%Docstring
Returns the joined feature corresponding to the feature.
\param info the vector join information

View File

@ -412,14 +412,14 @@ QList<const QgsVectorLayerJoinInfo *> QgsVectorLayerJoinBuffer::joinsWhereFieldI
return infos;
}
QgsFeature QgsVectorLayerJoinBuffer::joinedFeatureOf( const QgsVectorLayerJoinInfo &info, const QgsFeature &feature ) const
QgsFeature QgsVectorLayerJoinBuffer::joinedFeatureOf( const QgsVectorLayerJoinInfo *info, const QgsFeature &feature ) const
{
QgsFeature joinedFeature;
if ( info.joinLayer() )
if ( info->joinLayer() )
{
const QVariant targetValue = feature.attribute( info.targetFieldName() );
QString fieldRef = QgsExpression::quotedColumnRef( info.joinFieldName() );
const QVariant targetValue = feature.attribute( info->targetFieldName() );
QString fieldRef = QgsExpression::quotedColumnRef( info->joinFieldName() );
QString quotedVal = QgsExpression::quotedValue( targetValue.toString() );
const QString filter = QString( "%1 = %2" ).arg( fieldRef, quotedVal );
@ -427,7 +427,7 @@ QgsFeature QgsVectorLayerJoinBuffer::joinedFeatureOf( const QgsVectorLayerJoinIn
request.setFilterExpression( filter );
request.setLimit( 1 );
QgsFeatureIterator it = info.joinLayer()->getFeatures( request );
QgsFeatureIterator it = info->joinLayer()->getFeatures( request );
it.nextFeature( joinedFeature );
}

View File

@ -96,7 +96,7 @@ class CORE_EXPORT QgsVectorLayerJoinBuffer : public QObject
* \param feature the feature of the target layer
* \since QGIS 3.0
*/
QgsFeature joinedFeatureOf( const QgsVectorLayerJoinInfo &info, const QgsFeature &feature ) const;
QgsFeature joinedFeatureOf( const QgsVectorLayerJoinInfo *info, const QgsFeature &feature ) const;
//! Create a copy of the join buffer
//! \since QGIS 2.6

View File

@ -1936,12 +1936,12 @@ void QgsAttributeForm::ContainerInformation::apply( QgsExpressionContext *expres
}
}
QgsFeature QgsAttributeForm::joinedFeature( const QgsVectorLayerJoinInfo &info, const QgsFeature &feature ) const
QgsFeature QgsAttributeForm::joinedFeature( const QgsVectorLayerJoinInfo *info, const QgsFeature &feature ) const
{
QgsFeature joinedFeature = mLayer->joinBuffer()->joinedFeatureOf( info, feature );
if ( !joinedFeature.isValid() )
joinedFeature = QgsVectorLayerUtils::createFeature( info.joinLayer(), QgsGeometry(), QgsAttributeMap() );
joinedFeature = QgsVectorLayerUtils::createFeature( info->joinLayer(), QgsGeometry(), QgsAttributeMap() );
return joinedFeature;
}
@ -1960,7 +1960,7 @@ void QgsAttributeForm::updateJoinedFields( const QgsEditorWidgetWrapper &eww )
if ( !info->isDynamicFormEnabled() )
continue;
QgsFeature joinFeature = joinedFeature( *info, formFeature );
QgsFeature joinFeature = joinedFeature( info, formFeature );
QStringList *subsetFields = info->joinFieldNamesSubset();
if ( subsetFields )

View File

@ -273,7 +273,7 @@ class GUI_EXPORT QgsAttributeForm : public QWidget
void initPython();
QgsFeature joinedFeature( const QgsVectorLayerJoinInfo &info, const QgsFeature &feature ) const;
QgsFeature joinedFeature( const QgsVectorLayerJoinInfo *info, const QgsFeature &feature ) const;
void updateJoinedFields( const QgsEditorWidgetWrapper &eww );