mirror of
https://github.com/qgis/QGIS.git
synced 2025-12-07 00:03:52 -05:00
Rename name method to nameFromProperty
This commit is contained in:
parent
e05e920ec4
commit
ba9a84f343
@ -46,8 +46,7 @@ class QgsAuxiliaryField : QgsField
|
||||
:rtype: QgsPropertyDefinition
|
||||
%End
|
||||
|
||||
|
||||
static QString name( const QgsPropertyDefinition &def, bool joined = false );
|
||||
static QString nameFromProperty( const QgsPropertyDefinition &def, bool joined = false );
|
||||
%Docstring
|
||||
Returns the name of the auxiliary field for a property definition.
|
||||
|
||||
|
||||
@ -1075,7 +1075,7 @@ void QgsDiagramProperties::createAuxiliaryField()
|
||||
|
||||
// update property with join field name from auxiliary storage
|
||||
QgsProperty property = button->toProperty();
|
||||
property.setField( QgsAuxiliaryField::name( def, true ) );
|
||||
property.setField( QgsAuxiliaryField::nameFromProperty( def, true ) );
|
||||
property.setActive( true );
|
||||
button->updateFieldLists();
|
||||
button->setToProperty( property );
|
||||
|
||||
@ -645,7 +645,7 @@ void QgsLabelingGui::createAuxiliaryField()
|
||||
|
||||
// update property with join field name from auxiliary storage
|
||||
QgsProperty property = button->toProperty();
|
||||
property.setField( QgsAuxiliaryField::name( def, true ) );
|
||||
property.setField( QgsAuxiliaryField::nameFromProperty( def, true ) );
|
||||
property.setActive( true );
|
||||
button->updateFieldLists();
|
||||
button->setToProperty( property );
|
||||
|
||||
@ -1645,7 +1645,7 @@ void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
|
||||
def.setOrigin( item->text( 0 ) );
|
||||
def.setName( item->text( 1 ) );
|
||||
|
||||
const QString fieldName = QgsAuxiliaryField::name( def );
|
||||
const QString fieldName = QgsAuxiliaryField::nameFromProperty( def );
|
||||
|
||||
const int index = mLayer->auxiliaryLayer()->fields().indexOf( fieldName );
|
||||
if ( index < 0 )
|
||||
|
||||
@ -107,7 +107,7 @@ void QgsAuxiliaryField::init( const QgsPropertyDefinition &def )
|
||||
}
|
||||
|
||||
setType( type );
|
||||
setName( name( def ) );
|
||||
setName( nameFromProperty( def ) );
|
||||
setTypeName( typeName );
|
||||
setLength( len );
|
||||
setPrecision( precision );
|
||||
@ -122,7 +122,7 @@ bool QgsAuxiliaryLayer::clear()
|
||||
return rc;
|
||||
}
|
||||
|
||||
QString QgsAuxiliaryField::name( const QgsPropertyDefinition &def, bool joined )
|
||||
QString QgsAuxiliaryField::nameFromProperty( const QgsPropertyDefinition &def, bool joined )
|
||||
{
|
||||
QString fieldName = QString( "%2_%3" ).arg( def.origin(), def.name().toLower() );
|
||||
|
||||
@ -194,7 +194,7 @@ QgsVectorLayerJoinInfo QgsAuxiliaryLayer::joinInfo() const
|
||||
|
||||
bool QgsAuxiliaryLayer::exists( const QgsPropertyDefinition &definition ) const
|
||||
{
|
||||
return ( fields().indexOf( QgsAuxiliaryField::name( definition ) ) >= 0 );
|
||||
return ( fields().indexOf( QgsAuxiliaryField::nameFromProperty( definition ) ) >= 0 );
|
||||
}
|
||||
|
||||
bool QgsAuxiliaryLayer::addAuxiliaryField( const QgsPropertyDefinition &definition )
|
||||
|
||||
@ -60,18 +60,13 @@ class CORE_EXPORT QgsAuxiliaryField : public QgsField
|
||||
*/
|
||||
QgsPropertyDefinition propertyDefinition() const;
|
||||
|
||||
/**
|
||||
* Returns the name of the field.
|
||||
*/
|
||||
using QgsField::name SIP_SKIP;
|
||||
|
||||
/**
|
||||
* Returns the name of the auxiliary field for a property definition.
|
||||
*
|
||||
* \returns def The property definition
|
||||
* \returns joined The join prefix is tok into account if true
|
||||
*/
|
||||
static QString name( const QgsPropertyDefinition &def, bool joined = false );
|
||||
static QString nameFromProperty( const QgsPropertyDefinition &def, bool joined = false );
|
||||
|
||||
private:
|
||||
QgsAuxiliaryField( const QgsField &f ); // only for auxiliary layer
|
||||
|
||||
@ -342,7 +342,7 @@ void QgsPropertyOverrideButton::aboutToShowMenu()
|
||||
mActionCreateAuxiliaryField->setChecked( false );
|
||||
if ( alayer && alayer->exists( mDefinition ) )
|
||||
{
|
||||
if ( mProperty.field() == QgsAuxiliaryField::name( mDefinition, true ) )
|
||||
if ( mProperty.field() == QgsAuxiliaryField::nameFromProperty( mDefinition, true ) )
|
||||
{
|
||||
mActionCreateAuxiliaryField->setEnabled( false );
|
||||
mActionCreateAuxiliaryField->setChecked( true );
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user