mirror of
https://github.com/Lime3DS/Lime3DS
synced 2024-12-27 01:22:37 -06:00
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.
This commit is contained in:
parent
0f2005c370
commit
06b3891c66
1 changed files with 4 additions and 0 deletions
|
@ -297,6 +297,10 @@ void GMainWindow::StoreRecentFile(const QString& filename)
|
||||||
QStringList recent_files = settings.value("recentFiles").toStringList();
|
QStringList recent_files = settings.value("recentFiles").toStringList();
|
||||||
recent_files.prepend(filename);
|
recent_files.prepend(filename);
|
||||||
recent_files.removeDuplicates();
|
recent_files.removeDuplicates();
|
||||||
|
while (recent_files.size() > max_recent_files_item) {
|
||||||
|
recent_files.removeLast();
|
||||||
|
}
|
||||||
|
|
||||||
settings.setValue("recentFiles", recent_files);
|
settings.setValue("recentFiles", recent_files);
|
||||||
|
|
||||||
UpdateRecentFiles();
|
UpdateRecentFiles();
|
||||||
|
|
Loading…
Reference in a new issue