浏览代码

UI: Do not allow new undo actions while undo disabled

jp9000 4 年之前
父节点
当前提交
64cd451def
共有 1 个文件被更改,包括 3 次插入0 次删除
  1. 3 0
      UI/undo-stack-obs.cpp

+ 3 - 0
UI/undo-stack-obs.cpp

@@ -34,6 +34,9 @@ void undo_stack::add_action(const QString &name, undo_redo_cb undo,
 			    undo_redo_cb redo, std::string undo_data,
 			    std::string redo_data, bool repeatable)
 {
+	if (!is_enabled())
+		return;
+
 	while (undo_items.size() >= MAX_STACK_SIZE) {
 		undo_redo_t item = undo_items.back();
 		undo_items.pop_back();