From e15ef04b723c7982338657fb245d5b75564ccb2b Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 27 Oct 2013 13:08:58 -0700 Subject: [PATCH] Limit shift times history to the last 50 shifts --- aegisub/src/dialog_shift_times.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aegisub/src/dialog_shift_times.cpp b/aegisub/src/dialog_shift_times.cpp index 838caa2a4..85ccf3831 100644 --- a/aegisub/src/dialog_shift_times.cpp +++ b/aegisub/src/dialog_shift_times.cpp @@ -234,7 +234,6 @@ void DialogShiftTimes::OnSelectedSetChanged() { } } - void DialogShiftTimes::OnClear(wxCommandEvent &) { agi::fs::Remove(history_filename); history_box->Clear(); @@ -289,6 +288,8 @@ void DialogShiftTimes::SaveHistory(json::Array const& shifted_blocks) { new_entry["selection"] = shifted_blocks; history->push_front(new_entry); + if (history->size() > 50) + history->resize(50); try { json::Writer::Write(*history, agi::io::Save(history_filename).Get());