diff options
author | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-09-07 22:00:08 -0300 |
---|---|---|
committer | Yuri Kunde Schlesner <yuriks@yuriks.net> | 2015-09-07 22:00:08 -0300 |
commit | 06b3891c66ee42645d760ea56cbde8e2769d26a6 (patch) | |
tree | e64eae7701dbfe26e4b1223351d0bd9cba549b07 /src | |
parent | 0f2005c370c90e7670cb47c3e8e5f62631534617 (diff) |
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.
Diffstat (limited to 'src')
-rw-r--r-- | src/citra_qt/main.cpp | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/citra_qt/main.cpp b/src/citra_qt/main.cpp index 11813a2a8..65b5fc9d6 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(); |