@@ -293,7 +293,7 @@ void QgsIdentifyResults::show()
293
293
// (saves the current window size/position)
294
294
void QgsIdentifyResults::close ()
295
295
{
296
- clear ();
296
+ clear ();
297
297
298
298
delete mActionPopup ;
299
299
mActionPopup = 0 ;
@@ -761,7 +761,9 @@ void QgsIdentifyResults::featureForm()
761
761
762
762
QgsAttributeMap src = f.attributeMap ();
763
763
764
- vlayer->beginEditCommand ( tr ( " Attribute changed" ) );
764
+ if ( vlayer->isEditable () )
765
+ vlayer->beginEditCommand ( tr ( " Attribute changed" ) );
766
+
765
767
QgsAttributeDialog *ad = new QgsAttributeDialog ( vlayer, &f );
766
768
767
769
if ( !vlayer->isEditable () && vlayer->actions ()->size () > 0 )
@@ -789,25 +791,33 @@ void QgsIdentifyResults::featureForm()
789
791
}
790
792
}
791
793
792
- if ( ad-> exec () )
794
+ if ( vlayer-> isEditable () )
793
795
{
794
- const QgsAttributeMap &dst = f.attributeMap ();
795
- for ( QgsAttributeMap::const_iterator it = dst.begin (); it != dst.end (); it++ )
796
+ if ( ad->exec () )
796
797
{
797
- if ( !src.contains ( it.key () ) || it.value () != src[it.key ()] )
798
+ const QgsAttributeMap &dst = f.attributeMap ();
799
+ for ( QgsAttributeMap::const_iterator it = dst.begin (); it != dst.end (); it++ )
798
800
{
799
- vlayer->changeAttributeValue ( f.id (), it.key (), it.value () );
801
+ if ( !src.contains ( it.key () ) || it.value () != src[it.key ()] )
802
+ {
803
+ vlayer->changeAttributeValue ( f.id (), it.key (), it.value () );
804
+ }
800
805
}
806
+ vlayer->endEditCommand ();
807
+ }
808
+ else
809
+ {
810
+ vlayer->destroyEditCommand ();
801
811
}
802
- vlayer->endEditCommand ();
812
+
813
+ delete ad;
814
+
815
+ mCanvas ->refresh ();
803
816
}
804
817
else
805
818
{
806
- vlayer-> destroyEditCommand ();
819
+ ad-> show ();
807
820
}
808
-
809
- delete ad;
810
- mCanvas ->refresh ();
811
821
}
812
822
813
823
void QgsIdentifyResults::highlightAll ()
0 commit comments