Skip to content

Commit

Permalink
Debug commit, should be reverted
Browse files Browse the repository at this point in the history
  • Loading branch information
suricactus committed Jan 20, 2021
1 parent 703555a commit ff6e625
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/gui/qgsabstractrelationeditorwidget.cpp
Expand Up @@ -263,7 +263,9 @@ void QgsAbstractRelationEditorWidget::addFeature( const QgsGeometry &geometry )

QgsMessageLog::logMessage( QStringLiteral( "ADDED FEATURES1 %1 %2" ).arg( mRelation.referencingLayer()->name() ).arg( mRelation.referencingLayer()->featureCount() ) );

Q_ASSERT( vlTools->addFeature( mRelation.referencingLayer(), keyAttrs, geometry ) );
bool success = vlTools->addFeature( mRelation.referencingLayer(), keyAttrs, geometry );
Q_ASSERT( success );
QgsMessageLog::logMessage( QStringLiteral( "SUCESS??? %1" ).arg( success ) );

QgsMessageLog::logMessage( QStringLiteral( "ADDED FEATURES2 %1 %2" ).arg( mRelation.referencingLayer()->name() ).arg( mRelation.referencingLayer()->featureCount() ) );
mRelation.referencingLayer()->dataProvider()->reloadData();
Expand Down
11 changes: 11 additions & 0 deletions tests/src/python/test_qgsrelationeditwidget.py
Expand Up @@ -330,6 +330,9 @@ def addFeature(self, layer, defaultValues, defaultGeometry):
table_view = widget.findChild(QTableView)
self.assertEqual(table_view.model().rowCount(), 1)

vl_leaks.raiseError.connect(TestQgsRelationEditWidget.error_raised)
vl_leaks.featureAdded.connect(TestQgsRelationEditWidget.feature_added)

btn = widget.findChild(QToolButton, 'mAddFeatureGeometryButton')
self.assertTrue(btn.isVisible())
self.assertTrue(btn.isEnabled())
Expand All @@ -354,6 +357,14 @@ def addFeature(self, layer, defaultValues, defaultGeometry):

vl_leaks.rollBack()

@classmethod
def error_raised(cls, msg):
print("LAYER ERROR RAISED: ", len(msg), msg)

@classmethod
def feature_added(cls, fid):
print("LAYER FEATURE ADDDED: ", fid)

def startTransaction(self):
"""
Start a new transaction and set all layers into transaction mode.
Expand Down

0 comments on commit ff6e625

Please sign in to comment.