From 53a46fee00aa9256144c8cb71bc8e71444f339a8 Mon Sep 17 00:00:00 2001 From: Florian Jung Date: Wed, 28 Sep 2011 15:56:24 +0000 Subject: Undo::empty() also returns empty if the list only contains DoNothings removed unused, unimplemented function --- muse2/muse/undo.cpp | 12 ++++++++++++ muse2/muse/undo.h | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) (limited to 'muse2') diff --git a/muse2/muse/undo.cpp b/muse2/muse/undo.cpp index c0191362..63911fcf 100644 --- a/muse2/muse/undo.cpp +++ b/muse2/muse/undo.cpp @@ -775,6 +775,7 @@ void Song::doRedo2() UndoOp::UndoOp() { + type=UndoOp::DoNothing; } UndoOp::UndoOp(UndoType type_) @@ -1073,3 +1074,14 @@ void Song::doRedo3() dirty = true; } + +bool Undo::empty() const +{ + if (std::list::empty()) return true; + + for (const_iterator it=begin(); it!=end(); it++) + if (it->type!=UndoOp::DoNothing) + return false; + + return true; +} diff --git a/muse2/muse/undo.h b/muse2/muse/undo.h index 5dca82b6..f2a523cc 100644 --- a/muse2/muse/undo.h +++ b/muse2/muse/undo.h @@ -119,7 +119,8 @@ struct UndoOp { }; class Undo : public std::list { - void undoOp(UndoOp::UndoType, int data); + public: + bool empty() const; }; typedef Undo::iterator iUndoOp; -- cgit v1.2.3