Skip to content

Commit

Permalink
citra-qt: Trim recently used files list to size when insterting new item
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
yuriks committed Sep 8, 2015
1 parent 0f2005c commit 06b3891
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/citra_qt/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit 06b3891

Please sign in to comment.