diff --git a/src/model/atom.cpp b/src/model/atom.cpp index 3fb8c6486..07f7f0d2e 100644 --- a/src/model/atom.cpp +++ b/src/model/atom.cpp @@ -253,12 +253,7 @@ Atom** Model::atomArray() void Model::clearAtoms() { Messenger::enter("Model::clearAtoms"); - Atom* i = atoms_.first(); - while (i != NULL) - { - deleteAtom(i, true); - i = atoms_.first(); - } + while (Atom *i = atoms_.last()) deleteAtom(i, true); Messenger::exit("Model::clearAtoms"); } @@ -622,4 +617,4 @@ void Model::swapAtoms(Atom* i, Atom* j) void Model::swapAtoms(int id1, int id2) { swapAtoms(atom(id1), atom(id2)); -} \ No newline at end of file +} diff --git a/src/model/cell.cpp b/src/model/cell.cpp index db956bc61..a4d5ddd5e 100644 --- a/src/model/cell.cpp +++ b/src/model/cell.cpp @@ -506,6 +506,7 @@ void Model::replicateCell(const Vec3& negativeCells, const Vec3& } logChange(Log::Structure); + Messenger::exit("Model::replicateCell"); } diff --git a/src/undo/atom_creation.cpp b/src/undo/atom_creation.cpp index 0d4904876..1accd7ae0 100644 --- a/src/undo/atom_creation.cpp +++ b/src/undo/atom_creation.cpp @@ -56,6 +56,7 @@ void AtomCreationEvent::undo(Model* m) Messenger::enter("AtomCreationEvent::undo"); Atom** modelatoms = m->atomArray(); int id; + // Atom creation (UndoEvent::Redo) and deletion (UndoEvent::Undo) if (direction_ == UndoEvent::Undo) { diff --git a/src/undo/undostate.cpp b/src/undo/undostate.cpp index 3fb88eedd..248e0641e 100644 --- a/src/undo/undostate.cpp +++ b/src/undo/undostate.cpp @@ -118,5 +118,5 @@ bool UndoState::doLogsDiffer() const // Print changes in state void UndoState::print() const { - for (UndoEvent* u = events_.first(); u != NULL; u = u->prev) u->print(); + for (UndoEvent* u = events_.first(); u != NULL; u = u->next) u->print(); }