Skip to content
Permalink
Browse files

Rename `vl` parameters to `layer`

  • Loading branch information
m-kuhn committed Dec 20, 2016
1 parent 826c440 commit ab0dccf1d5d379a3b5f839d82a80c5de9e9421a7
@@ -21,5 +21,5 @@ class QgsKeyValueFieldKit : QgsFieldKit
public:
QgsKeyValueFieldKit();
QString id() const;
QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
};
@@ -24,5 +24,5 @@ class QgsListFieldKit : QgsFieldKit

QString id() const;

QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
};
@@ -24,7 +24,7 @@ class QgsRelationReferenceFieldKit : QgsFieldKit

QString id() const;

virtual QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;
virtual QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;

virtual QVariant sortValue( QgsVectorLayer *vl, int fieldIdx, const QVariantMap&config, const QVariant& cache, const QVariant& value ) const override;
virtual QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap&config, const QVariant& cache, const QVariant& value ) const override;
};
@@ -23,7 +23,7 @@ class QgsValueMapFieldKit : QgsFieldKit

QString id() const;

QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;

QVariant sortValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
QVariant sortValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
};
@@ -35,11 +35,11 @@ class QgsValueRelationFieldKit : QgsFieldKit
QgsValueRelationFieldKit();

QString id() const;
QString representValue( QgsVectorLayer *layer, int fieldIdx, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;

QVariant sortValue( QgsVectorLayer *vl, int fieldIdx, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;
QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const;

QVariant createCache( QgsVectorLayer *vl, int fieldIdx, const QVariantMap &config ) const;
QVariant createCache( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config ) const;

static ValueRelationCache createCache( const QVariantMap& config );
};
@@ -27,10 +27,10 @@ QString QgsKeyValueFieldKit::id() const
return QStringLiteral( "KeyValue" );
}

QString QgsKeyValueFieldKit::representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
QString QgsKeyValueFieldKit::representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
{
Q_UNUSED( vl );
Q_UNUSED( fieldIdx );
Q_UNUSED( layer );
Q_UNUSED( fieldIndex );
Q_UNUSED( config );
Q_UNUSED( cache );

@@ -24,7 +24,7 @@ class CORE_EXPORT QgsKeyValueFieldKit : public QgsFieldKit
QgsKeyValueFieldKit();

QString id() const override;
QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;
QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;
};

#endif // QGSKEYVALUEFIELDKIT_H
@@ -27,10 +27,10 @@ QString QgsListFieldKit::id() const
return QStringLiteral( "List" );
}

QString QgsListFieldKit::representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
QString QgsListFieldKit::representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
{
Q_UNUSED( vl );
Q_UNUSED( fieldIdx );
Q_UNUSED( layer );
Q_UNUSED( fieldIndex );
Q_UNUSED( config );
Q_UNUSED( cache );

@@ -25,7 +25,7 @@ class CORE_EXPORT QgsListFieldKit : public QgsFieldKit

QString id() const override;

QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;
QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;
};

#endif // QGSLISTFIELDKIT_H
@@ -32,7 +32,7 @@ QString QgsRelationReferenceFieldKit::id() const
return QStringLiteral( "RelationReference" );
}

QString QgsRelationReferenceFieldKit::representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
QString QgsRelationReferenceFieldKit::representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
{
Q_UNUSED( cache );

@@ -49,15 +49,15 @@ QString QgsRelationReferenceFieldKit::representValue( QgsVectorLayer* vl, int fi
return value.toString();
}
QgsVectorLayer* referencingLayer = relation.referencingLayer();
if ( vl != referencingLayer )
if ( layer != referencingLayer )
{
QgsMessageLog::logMessage( "representValue() with inconsistent vl parameter w.r.t relation referencingLayer" );
QgsMessageLog::logMessage( "representValue() with inconsistent layer parameter w.r.t relation referencingLayer" );
return value.toString();
}
int referencingFieldIdx = referencingLayer->fields().lookupField( relation.fieldPairs().at( 0 ).first );
if ( referencingFieldIdx != fieldIdx )
if ( referencingFieldIdx != fieldIndex )
{
QgsMessageLog::logMessage( "representValue() with inconsistent fieldIdx parameter w.r.t relation referencingFieldIdx" );
QgsMessageLog::logMessage( "representValue() with inconsistent fieldIndex parameter w.r.t relation referencingFieldIdx" );
return value.toString();
}
QgsVectorLayer* referencedLayer = relation.referencedLayer();
@@ -68,7 +68,7 @@ QString QgsRelationReferenceFieldKit::representValue( QgsVectorLayer* vl, int fi
}

// Attributes from the referencing layer
QgsAttributes attrs = QgsAttributes( vl->fields().count() );
QgsAttributes attrs = QgsAttributes( layer->fields().count() );
// Set the value on the foreign key field of the referencing record
attrs[ referencingFieldIdx ] = value;

@@ -93,7 +93,7 @@ QString QgsRelationReferenceFieldKit::representValue( QgsVectorLayer* vl, int fi
return title;
}

QVariant QgsRelationReferenceFieldKit::sortValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
QVariant QgsRelationReferenceFieldKit::sortValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
{
return representValue( vl, fieldIdx, config, cache, value );
return representValue( layer, fieldIndex, config, cache, value );
}
@@ -25,9 +25,9 @@ class CORE_EXPORT QgsRelationReferenceFieldKit : public QgsFieldKit

QString id() const override;

virtual QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;
virtual QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;

virtual QVariant sortValue( QgsVectorLayer *vl, int fieldIdx, const QVariantMap&config, const QVariant& cache, const QVariant& value ) const override;
virtual QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap&config, const QVariant& cache, const QVariant& value ) const override;
};

#endif // QGSRELATIONREFERENCEFIELDKIT_H
@@ -27,7 +27,7 @@ QString QgsValueMapFieldKit::id() const
return QStringLiteral( "ValueMap" );
}

QString QgsValueMapFieldKit::representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
QString QgsValueMapFieldKit::representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
{
Q_UNUSED( cache )

@@ -37,10 +37,10 @@ QString QgsValueMapFieldKit::representValue( QgsVectorLayer* vl, int fieldIdx, c
else
valueInternalText = value.toString();

return config.key( valueInternalText, QVariant( QStringLiteral( "(%1)" ).arg( vl->fields().at( fieldIdx ).displayString( value ) ) ).toString() );
return config.key( valueInternalText, QVariant( QStringLiteral( "(%1)" ).arg( layer->fields().at( fieldIndex ).displayString( value ) ) ).toString() );
}

QVariant QgsValueMapFieldKit::sortValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
QVariant QgsValueMapFieldKit::sortValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
{
return representValue( vl, fieldIdx, config, cache, value );
return representValue( layer, fieldIndex, config, cache, value );
}
@@ -27,9 +27,9 @@ class CORE_EXPORT QgsValueMapFieldKit : public QgsFieldKit

QString id() const override;

QString representValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;
QString representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const override;

QVariant sortValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
QVariant sortValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const;
};

#endif // QGSVALUEMAPFIELDKIT_H
@@ -42,10 +42,10 @@ QString QgsValueRelationFieldKit::id() const
return QStringLiteral( "ValueRelation" );
}

QString QgsValueRelationFieldKit::representValue( QgsVectorLayer* layer, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
QString QgsValueRelationFieldKit::representValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
{
Q_UNUSED( layer )
Q_UNUSED( fieldIdx )
Q_UNUSED( fieldIndex )

QHash<QString, QString> vrCache;

@@ -55,7 +55,7 @@ QString QgsValueRelationFieldKit::representValue( QgsVectorLayer* layer, int fie
}
else
{
vrCache = createCache( layer, fieldIdx, config ).value<QHash<QString, QString>>();
vrCache = createCache( layer, fieldIndex, config ).value<QHash<QString, QString>>();
}

if ( config.value( QStringLiteral( "AllowMulti" ) ).toBool() )
@@ -90,13 +90,15 @@ QString QgsValueRelationFieldKit::representValue( QgsVectorLayer* layer, int fie
return QStringLiteral( "(%1)" ).arg( value.toString() );
}

QVariant QgsValueRelationFieldKit::sortValue( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
QVariant QgsValueRelationFieldKit::sortValue( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config, const QVariant& cache, const QVariant& value ) const
{
return representValue( vl, fieldIdx, config, cache, value );
return representValue( layer, fieldIndex, config, cache, value );
}

QVariant QgsValueRelationFieldKit::createCache( QgsVectorLayer* vl, int fieldIdx, const QVariantMap& config ) const
QVariant QgsValueRelationFieldKit::createCache( QgsVectorLayer* layer, int fieldIndex, const QVariantMap& config ) const
{
Q_UNUSED( layer )
Q_UNUSED( fieldIndex )
return QVariant::fromValue<ValueRelationCache>( createCache( config ) );

}
@@ -43,11 +43,11 @@ class CORE_EXPORT QgsValueRelationFieldKit : public QgsFieldKit
QgsValueRelationFieldKit();

QString id() const override;
QString representValue( QgsVectorLayer *layer, int fieldIdx, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const override;
QString representValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const override;

QVariant sortValue( QgsVectorLayer *vl, int fieldIdx, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const override;
QVariant sortValue( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config, const QVariant &cache, const QVariant &value ) const override;

QVariant createCache( QgsVectorLayer *vl, int fieldIdx, const QVariantMap &config ) const override;
QVariant createCache( QgsVectorLayer *layer, int fieldIndex, const QVariantMap &config ) const override;

static ValueRelationCache createCache( const QVariantMap& config );
};

0 comments on commit ab0dccf

Please sign in to comment.
You can’t perform that action at this time.