Skip to content

Commit ba9a84f

Browse files
committed
Rename name method to nameFromProperty
1 parent e05e920 commit ba9a84f

7 files changed

+9
-15
lines changed

python/core/qgsauxiliarystorage.sip

+1-2
Original file line numberDiff line numberDiff line change
@@ -46,8 +46,7 @@ class QgsAuxiliaryField : QgsField
4646
:rtype: QgsPropertyDefinition
4747
%End
4848

49-
50-
static QString name( const QgsPropertyDefinition &def, bool joined = false );
49+
static QString nameFromProperty( const QgsPropertyDefinition &def, bool joined = false );
5150
%Docstring
5251
Returns the name of the auxiliary field for a property definition.
5352

src/app/qgsdiagramproperties.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1075,7 +1075,7 @@ void QgsDiagramProperties::createAuxiliaryField()
10751075

10761076
// update property with join field name from auxiliary storage
10771077
QgsProperty property = button->toProperty();
1078-
property.setField( QgsAuxiliaryField::name( def, true ) );
1078+
property.setField( QgsAuxiliaryField::nameFromProperty( def, true ) );
10791079
property.setActive( true );
10801080
button->updateFieldLists();
10811081
button->setToProperty( property );

src/app/qgslabelinggui.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -645,7 +645,7 @@ void QgsLabelingGui::createAuxiliaryField()
645645

646646
// update property with join field name from auxiliary storage
647647
QgsProperty property = button->toProperty();
648-
property.setField( QgsAuxiliaryField::name( def, true ) );
648+
property.setField( QgsAuxiliaryField::nameFromProperty( def, true ) );
649649
property.setActive( true );
650650
button->updateFieldLists();
651651
button->setToProperty( property );

src/app/qgsvectorlayerproperties.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1645,7 +1645,7 @@ void QgsVectorLayerProperties::onAuxiliaryLayerDeleteField()
16451645
def.setOrigin( item->text( 0 ) );
16461646
def.setName( item->text( 1 ) );
16471647

1648-
const QString fieldName = QgsAuxiliaryField::name( def );
1648+
const QString fieldName = QgsAuxiliaryField::nameFromProperty( def );
16491649

16501650
const int index = mLayer->auxiliaryLayer()->fields().indexOf( fieldName );
16511651
if ( index < 0 )

src/core/qgsauxiliarystorage.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ void QgsAuxiliaryField::init( const QgsPropertyDefinition &def )
107107
}
108108

109109
setType( type );
110-
setName( name( def ) );
110+
setName( nameFromProperty( def ) );
111111
setTypeName( typeName );
112112
setLength( len );
113113
setPrecision( precision );
@@ -122,7 +122,7 @@ bool QgsAuxiliaryLayer::clear()
122122
return rc;
123123
}
124124

125-
QString QgsAuxiliaryField::name( const QgsPropertyDefinition &def, bool joined )
125+
QString QgsAuxiliaryField::nameFromProperty( const QgsPropertyDefinition &def, bool joined )
126126
{
127127
QString fieldName = QString( "%2_%3" ).arg( def.origin(), def.name().toLower() );
128128

@@ -194,7 +194,7 @@ QgsVectorLayerJoinInfo QgsAuxiliaryLayer::joinInfo() const
194194

195195
bool QgsAuxiliaryLayer::exists( const QgsPropertyDefinition &definition ) const
196196
{
197-
return ( fields().indexOf( QgsAuxiliaryField::name( definition ) ) >= 0 );
197+
return ( fields().indexOf( QgsAuxiliaryField::nameFromProperty( definition ) ) >= 0 );
198198
}
199199

200200
bool QgsAuxiliaryLayer::addAuxiliaryField( const QgsPropertyDefinition &definition )

src/core/qgsauxiliarystorage.h

+1-6
Original file line numberDiff line numberDiff line change
@@ -60,18 +60,13 @@ class CORE_EXPORT QgsAuxiliaryField : public QgsField
6060
*/
6161
QgsPropertyDefinition propertyDefinition() const;
6262

63-
/**
64-
* Returns the name of the field.
65-
*/
66-
using QgsField::name SIP_SKIP;
67-
6863
/**
6964
* Returns the name of the auxiliary field for a property definition.
7065
*
7166
* \returns def The property definition
7267
* \returns joined The join prefix is tok into account if true
7368
*/
74-
static QString name( const QgsPropertyDefinition &def, bool joined = false );
69+
static QString nameFromProperty( const QgsPropertyDefinition &def, bool joined = false );
7570

7671
private:
7772
QgsAuxiliaryField( const QgsField &f ); // only for auxiliary layer

src/gui/qgspropertyoverridebutton.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -342,7 +342,7 @@ void QgsPropertyOverrideButton::aboutToShowMenu()
342342
mActionCreateAuxiliaryField->setChecked( false );
343343
if ( alayer && alayer->exists( mDefinition ) )
344344
{
345-
if ( mProperty.field() == QgsAuxiliaryField::name( mDefinition, true ) )
345+
if ( mProperty.field() == QgsAuxiliaryField::nameFromProperty( mDefinition, true ) )
346346
{
347347
mActionCreateAuxiliaryField->setEnabled( false );
348348
mActionCreateAuxiliaryField->setChecked( true );

0 commit comments

Comments
 (0)