Skip to content

Commit 3bb5f43

Browse files
committedSep 15, 2014
[Releation reference widget] more coherent method names
1 parent 51caaab commit 3bb5f43

File tree

5 files changed

+17
-17
lines changed

5 files changed

+17
-17
lines changed
 

‎python/gui/qgsrelationreferencewidget.sip

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,5 +44,5 @@ class QgsRelationReferenceWidget : QWidget
4444
void init();
4545

4646
signals:
47-
void relatedFeatureChanged( QVariant );
47+
void foreignKeyChanged( QVariant );
4848
};

‎src/gui/editorwidgets/qgsrelationreferencewidget.cpp

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -186,11 +186,11 @@ void QgsRelationReferenceWidget::setRelationEditable( bool editable )
186186
mMapIdentificationButton->setEnabled( editable );
187187
}
188188

189-
void QgsRelationReferenceWidget::setRelatedFeature( const QVariant& value )
189+
void QgsRelationReferenceWidget::setForeignKey( const QVariant& value )
190190
{
191191
if ( !value.isValid() || value.isNull() )
192192
{
193-
removeRelatedFeature();
193+
deleteForeignKey();
194194
return;
195195
}
196196

@@ -210,7 +210,7 @@ void QgsRelationReferenceWidget::setRelatedFeature( const QVariant& value )
210210

211211
if ( !f.isValid() )
212212
{
213-
removeRelatedFeature();
213+
deleteForeignKey();
214214
return;
215215
}
216216

@@ -236,10 +236,10 @@ void QgsRelationReferenceWidget::setRelatedFeature( const QVariant& value )
236236

237237
highlightFeature( f );
238238
updateAttributeEditorFrame( f );
239-
emit relatedFeatureChanged( foreignKey() );
239+
emit foreignKeyChanged( foreignKey() );
240240
}
241241

242-
void QgsRelationReferenceWidget::removeRelatedFeature()
242+
void QgsRelationReferenceWidget::deleteForeignKey()
243243
{
244244
QVariant nullValue = QSettings().value( "qgis/nullValue", "NULL" );
245245
if ( mReadOnlySelector )
@@ -266,7 +266,7 @@ void QgsRelationReferenceWidget::removeRelatedFeature()
266266
}
267267

268268
updateAttributeEditorFrame( QgsFeature() );
269-
emit relatedFeatureChanged( QVariant( QVariant::Int ) );
269+
emit foreignKeyChanged( QVariant( QVariant::Int ) );
270270
}
271271

272272
void QgsRelationReferenceWidget::mapToolDeactivated()
@@ -501,7 +501,7 @@ void QgsRelationReferenceWidget::mapIdentificationTriggered( QAction* action )
501501
{
502502
if ( action == mRemoveFeatureAction )
503503
{
504-
removeRelatedFeature();
504+
deleteForeignKey();
505505
}
506506

507507
else if ( action == mMapIdentificationAction )
@@ -539,7 +539,7 @@ void QgsRelationReferenceWidget::comboReferenceChanged( int index )
539539
mReferencedLayer->getFeatures( QgsFeatureRequest().setFilterFid( fid ) ).nextFeature( feat );
540540
highlightFeature( feat );
541541
updateAttributeEditorFrame( feat );
542-
emit relatedFeatureChanged( mFidFkMap.value( fid ) );
542+
emit foreignKeyChanged( mFidFkMap.value( fid ) );
543543
}
544544

545545
void QgsRelationReferenceWidget::updateAttributeEditorFrame( const QgsFeature feature )
@@ -569,7 +569,7 @@ void QgsRelationReferenceWidget::featureIdentified( const QgsFeature& feature )
569569

570570
highlightFeature( feature );
571571
updateAttributeEditorFrame( feature );
572-
emit relatedFeatureChanged( foreignKey() );
572+
emit foreignKeyChanged( foreignKey() );
573573

574574
// deactivate map tool if activate
575575
if ( mCanvas && mMapTool )

‎src/gui/editorwidgets/qgsrelationreferencewidget.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
5151
void setRelationEditable( bool editable );
5252

5353
//! this sets the related feature using from the foreign key
54-
void setRelatedFeature( const QVariant &value );
54+
void setForeignKey( const QVariant &value );
5555

5656
//! returns the related feature foreign key
5757
QVariant foreignKey();
@@ -73,15 +73,15 @@ class GUI_EXPORT QgsRelationReferenceWidget : public QWidget
7373
void init();
7474

7575
signals:
76-
void relatedFeatureChanged( QVariant );
76+
void foreignKeyChanged( QVariant );
7777

7878
private slots:
7979
void highlightActionTriggered( QAction* action );
8080
void deleteHighlight();
8181
void openForm();
8282
void mapIdentificationTriggered( QAction* action );
8383
void comboReferenceChanged( int index );
84-
void removeRelatedFeature();
84+
void deleteForeignKey();
8585
void featureIdentified( const QgsFeature& feature );
8686
void mapToolDeactivated();
8787

‎src/gui/editorwidgets/qgsrelationreferencewidgetwrapper.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ void QgsRelationReferenceWidgetWrapper::initWidget( QWidget* editor )
7171

7272
mWidget->setRelation( relation, config( "AllowNULL" ).toBool() );
7373

74-
connect( mWidget, SIGNAL( relatedFeatureChanged( QVariant ) ), this, SLOT( relatedFeatureChanged( QVariant ) ) );
74+
connect( mWidget, SIGNAL( foreignKeyChanged( QVariant ) ), this, SLOT( foreignKeyChanged( QVariant ) ) );
7575
}
7676

7777
QVariant QgsRelationReferenceWidgetWrapper::value()
@@ -96,7 +96,7 @@ void QgsRelationReferenceWidgetWrapper::setValue( const QVariant& value )
9696
if ( !mWidget )
9797
return;
9898

99-
mWidget->setRelatedFeature( value );
99+
mWidget->setForeignKey( value );
100100
}
101101

102102
void QgsRelationReferenceWidgetWrapper::setEnabled( bool enabled )
@@ -107,7 +107,7 @@ void QgsRelationReferenceWidgetWrapper::setEnabled( bool enabled )
107107
mWidget->setRelationEditable( enabled );
108108
}
109109

110-
void QgsRelationReferenceWidgetWrapper::relatedFeatureChanged( QVariant value )
110+
void QgsRelationReferenceWidgetWrapper::foreignKeyChanged( QVariant value )
111111
{
112112
if ( !value.isValid() || value.isNull() )
113113
{

‎src/gui/editorwidgets/qgsrelationreferencewidgetwrapper.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ class GUI_EXPORT QgsRelationReferenceWidgetWrapper : public QgsEditorWidgetWrapp
3939
virtual void setEnabled( bool enabled );
4040

4141
private slots:
42-
void relatedFeatureChanged( QVariant value );
42+
void foreignKeyChanged( QVariant value );
4343

4444
private:
4545
QgsRelationReferenceWidget* mWidget;

0 commit comments

Comments
 (0)
Please sign in to comment.