Allow the CreateEntityAction to set/unset the dirty flags, rather than doing so direc...
authorAndy Allan <gravitystorm@gmail.com>
Fri, 20 Aug 2010 13:32:17 +0000 (13:32 +0000)
committerAndy Allan <gravitystorm@gmail.com>
Fri, 20 Aug 2010 13:32:17 +0000 (13:32 +0000)
This allows undoing the CreateEntityAction an opportunity to mark the connection clean, if the creation was the first action.

net/systemeD/halcyon/connection/Connection.as
net/systemeD/halcyon/connection/actions/CreateEntityAction.as

index f036907..8cbb080 100755 (executable)
@@ -230,21 +230,21 @@ package net.systemeD.halcyon.connection {
         public function createNode(tags:Object, lat:Number, lon:Number, performCreate:Function):Node {
             var node:Node = new Node(nextNegative, 0, tags, true, lat, lon);
             performCreate(new CreateEntityAction(node, setNode));
-                       markDirty();
+                       //markDirty();
             return node;
         }
 
         public function createWay(tags:Object, nodes:Array, performCreate:Function):Way {
             var way:Way = new Way(nextNegative, 0, tags, true, nodes.concat());
             performCreate(new CreateEntityAction(way, setWay));
-                       markDirty();
+                       //markDirty();
             return way;
         }
 
         public function createRelation(tags:Object, members:Array, performCreate:Function):Relation {
             var relation:Relation = new Relation(nextNegative, 0, tags, true, members.concat());
             performCreate(new CreateEntityAction(relation, setRelation));
-                       markDirty();
+                       //markDirty();
             return relation;
         }
 
index da90ada..426a827 100644 (file)
@@ -17,7 +17,7 @@ package net.systemeD.halcyon.connection.actions {
             } else {
                 setCreate(entity, false);
             }
-            
+            markDirty();
             return SUCCESS;
         }
             
@@ -26,7 +26,7 @@ package net.systemeD.halcyon.connection.actions {
                 entity.remove(setAction);
             }
             deleteAction.doAction();
-            
+            markClean();
             return SUCCESS;
         }