From 5f59563a28390ce0de39796a6a18979ef1754915 Mon Sep 17 00:00:00 2001 From: Yuri Kunde Schlesner Date: Mon, 7 Sep 2015 22:00:08 -0300 Subject: [PATCH] citra-qt: Trim recently used files list to size when insterting new item Even though they weren't visible in the UI, old entries would never be removed from the list and would be stored in the config file across sessions. --- src/citra_qt/main.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 11813a2a8a..65b5fc9d69 100644 --- a/src/citra_qt/main.cpp +++ b/src/citra_qt/main.cpp @@ -297,6 +297,10 @@ void GMainWindow::StoreRecentFile(const QString& filename) QStringList recent_files = settings.value("recentFiles").toStringList(); recent_files.prepend(filename); recent_files.removeDuplicates(); + while (recent_files.size() > max_recent_files_item) { + recent_files.removeLast(); + } + settings.setValue("recentFiles", recent_files); UpdateRecentFiles();