Skip to content

Commit

Permalink
Fix #11456 (canvas not refreshed anymore after adding a new feature)
Browse files Browse the repository at this point in the history
Resorted to a "minimalist" fix - other solutions would potentially break
even more stuff. The handling of non-modal dialogs for add/edit feature
attributes + handling of isModified() should be addressed at some point.
  • Loading branch information
wonder-sk committed Oct 21, 2014
1 parent aa46df2 commit ba8a60f
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/gui/qgsattributeform.cpp
Expand Up @@ -133,6 +133,8 @@ bool QgsAttributeForm::save()

mIsSaving = true;

bool changedLayer = false;

bool success = true;

emit beforeSave( success );
Expand Down Expand Up @@ -194,6 +196,7 @@ bool QgsAttributeForm::save()
{
mFeature.setAttributes( updatedFeature.attributes() );
mLayer->endEditCommand();
changedLayer = true;
}
else
mLayer->destroyEditCommand();
Expand Down Expand Up @@ -226,6 +229,7 @@ bool QgsAttributeForm::save()
{
mLayer->endEditCommand();
mFeature.setAttributes( dst );
changedLayer = true;
}
else
{
Expand All @@ -237,12 +241,13 @@ bool QgsAttributeForm::save()

emit featureSaved( updatedFeature );

// [MD] disabled trigger of repaint as it interferes with other stuff (#11361).
// [MD] Refresh canvas only when absolutely necessary - it interferes with other stuff (#11361).
// This code should be revisited - and the signals should be fired (+ layer repainted)
// only when actually doing any changes. I am unsure if it is actually a good idea
// to call save() whenever some code asks for vector layer's modified status
// (which is the case when attribute table is open)
//mLayer->triggerRepaint();
if ( changedLayer )
mLayer->triggerRepaint();

mIsSaving = false;

Expand Down

0 comments on commit ba8a60f

Please sign in to comment.