summaryrefslogtreecommitdiff
path: root/muse2/muse
diff options
context:
space:
mode:
authorFlorian Jung <flo@windfisch.org>2011-09-28 15:56:24 +0000
committerFlorian Jung <flo@windfisch.org>2011-09-28 15:56:24 +0000
commit53a46fee00aa9256144c8cb71bc8e71444f339a8 (patch)
tree34a3bb00525784b1d9e93b572174e3a507ac586c /muse2/muse
parent56417f8e86e19d459a86f31a41a494f4a9e813a1 (diff)
Undo::empty() also returns empty if the list only contains DoNothings
removed unused, unimplemented function
Diffstat (limited to 'muse2/muse')
-rw-r--r--muse2/muse/undo.cpp12
-rw-r--r--muse2/muse/undo.h3
2 files changed, 14 insertions, 1 deletions
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<UndoOp>::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<UndoOp> {
- void undoOp(UndoOp::UndoType, int data);
+ public:
+ bool empty() const;
};
typedef Undo::iterator iUndoOp;