remove num_actions
This commit is contained in:
@@ -87,10 +87,8 @@ void cUndoList::add(action_ptr what){
|
|||||||
UNDO_LOG("Performing " + what->getActionName());
|
UNDO_LOG("Performing " + what->getActionName());
|
||||||
theList.erase(theList.begin(), cur);
|
theList.erase(theList.begin(), cur);
|
||||||
theList.push_front(what);
|
theList.push_front(what);
|
||||||
num_actions++;
|
while(theList.size() > maxUndoSize) {
|
||||||
while(num_actions > maxUndoSize) {
|
|
||||||
theList.pop_back();
|
theList.pop_back();
|
||||||
num_actions--;
|
|
||||||
}
|
}
|
||||||
cur = theList.begin();
|
cur = theList.begin();
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -56,7 +56,6 @@ using action_ptr = std::shared_ptr<cAction>;
|
|||||||
class cUndoList {
|
class cUndoList {
|
||||||
std::list<action_ptr> theList;
|
std::list<action_ptr> theList;
|
||||||
std::list<action_ptr>::iterator cur, lastSave;
|
std::list<action_ptr>::iterator cur, lastSave;
|
||||||
size_t num_actions = 0;
|
|
||||||
public:
|
public:
|
||||||
/// Construct a new undo list.
|
/// Construct a new undo list.
|
||||||
cUndoList();
|
cUndoList();
|
||||||
|
|||||||
Reference in New Issue
Block a user