Let users configure the number of recent files shown

Fixes: QTCREATORBUG-21898
Change-Id: Ie804e722f9bb88762da57f157833e4dc43d8ccbf
Reviewed-by: hjk <hjk@qt.io>
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
Reviewed-by: Christian Kandeler <christian.kandeler@qt.io>
This commit is contained in:
Christian Kandeler
2019-06-24 15:09:03 +02:00
parent 0715917414
commit bf0d84074f
5 changed files with 180 additions and 131 deletions

View File

@@ -153,7 +153,6 @@ public:
QSet<QString> m_expectedFileNames; // set of file names without normalization
QList<DocumentManager::RecentFile> m_recentFiles;
static const int m_maxRecentFiles = 8;
bool m_postponeAutoReload = false;
bool m_blockActivated = false;
@@ -1278,7 +1277,7 @@ void DocumentManager::addToRecentFiles(const QString &fileName, Id editorId)
if (fileKey == recentFileKey)
it.remove();
}
if (d->m_recentFiles.count() == d->m_maxRecentFiles)
while (d->m_recentFiles.count() >= EditorManagerPrivate::maxRecentFiles())
d->m_recentFiles.removeLast();
d->m_recentFiles.prepend(RecentFile(fileName, editorId));
}