Increase open recent hardcoded limit to 10

This commit is contained in:
Felix Kauselmann 2015-12-22 12:11:38 +01:00
parent 5fb88482fb
commit c850cc5b55
2 changed files with 7 additions and 5 deletions

View File

@ -63,7 +63,8 @@ void Configuration::updateOpenRecentList (QString path)
QStringList list = openRecentList(); QStringList list = openRecentList();
list.removeAll(path); list.removeAll(path);
list.prepend(path); list.prepend(path);
while (list.length() > 5) //TODO: Make list lenght configurable
while (list.length() > 10)
{ {
list.removeLast(); list.removeLast();
} }

View File

@ -219,7 +219,8 @@ void MainWindowViewer::createActions()
connect(openFolderAction, SIGNAL(triggered()), this, SLOT(openFolder())); connect(openFolderAction, SIGNAL(triggered()), this, SLOT(openFolder()));
QAction* recentFileAction = 0; QAction* recentFileAction = 0;
for (int i = 0; i < 5; i++) //TODO: Replace limit with a configurable value
for (int i = 0; i < 10; i++)
{ {
recentFileAction = new QAction(this); recentFileAction = new QAction(this);
recentFileAction->setVisible(false); recentFileAction->setVisible(false);
@ -665,8 +666,8 @@ void MainWindowViewer::refreshRecentFilesActionList()
{ {
QStringList recentFilePaths = Configuration::getConfiguration().openRecentList(); QStringList recentFilePaths = Configuration::getConfiguration().openRecentList();
//TODO: Replace "5" with something configurable //TODO: Replace limit with something configurable
int iteration = (recentFilePaths.size() < 5) ? recentFilePaths.size() : 5; int iteration = (recentFilePaths.size() < 10) ? recentFilePaths.size() : 10;
for (int i = 0; i < iteration; i++) for (int i = 0; i < iteration; i++)
{ {
@ -676,7 +677,7 @@ void MainWindowViewer::refreshRecentFilesActionList()
recentFilesActionList.at(i)->setVisible(true); recentFilesActionList.at(i)->setVisible(true);
} }
for (int i = iteration; i < 5; i++) for (int i = iteration; i < 10; i++)
{ {
recentFilesActionList.at(i)->setVisible(false); recentFilesActionList.at(i)->setVisible(false);
} }