summaryrefslogtreecommitdiff
path: root/muse2
diff options
context:
space:
mode:
Diffstat (limited to 'muse2')
-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;