Core: Move SystemSettings page closer to current setup

Also align items a bit and use BaseAspect::setEnabler() where
appropriate.

Change-Id: I7497e3ce82f3685582a84b1bf383e65892d76f96
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
This commit is contained in:
hjk
2023-07-26 18:29:20 +02:00
parent bc1ef0f158
commit 7f908d737b
7 changed files with 182 additions and 338 deletions

View File

@@ -22,6 +22,7 @@
#include <coreplugin/editormanager/ieditor.h>
#include <coreplugin/editormanager/ieditorfactory.h>
#include <coreplugin/editormanager/iexternaleditor.h>
#include <coreplugin/systemsettings.h>
#include <extensionsystem/pluginmanager.h>
@@ -1336,7 +1337,8 @@ void DocumentManager::addToRecentFiles(const FilePath &filePath, Id editorId)
Utils::erase(d->m_recentFiles, [fileKey](const RecentFile &file) {
return fileKey == filePathKey(file.first, DocumentManager::KeepLinks);
});
while (d->m_recentFiles.count() >= EditorManagerPrivate::maxRecentFiles())
const int maxRecentFiles = systemSettings().maxRecentFiles();
while (d->m_recentFiles.count() >= maxRecentFiles)
d->m_recentFiles.removeLast();
d->m_recentFiles.prepend(RecentFile(filePath, editorId));
}