From 46dcc4fcd07be9db5733a012b8273122a8c8c663 Mon Sep 17 00:00:00 2001 From: Vincent van Ravesteijn Date: Sun, 7 Jun 2009 15:19:41 +0000 Subject: [PATCH] Fix bug #5980: 'Maximum last files' setting doesn't go beyond 9. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@30009 a592a061-630c-0410-9148-cb99ea01b6c8 --- src/frontends/qt4/Menus.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/src/frontends/qt4/Menus.cpp b/src/frontends/qt4/Menus.cpp index 575f47c489..7024bab362 100644 --- a/src/frontends/qt4/Menus.cpp +++ b/src/frontends/qt4/Menus.cpp @@ -42,6 +42,7 @@ #include "LyXAction.h" #include "LyX.h" // for lastfiles #include "LyXFunc.h" +#include "LyXRC.h" #include "Paragraph.h" #include "ParIterator.h" #include "Session.h" @@ -748,12 +749,17 @@ void MenuDefinition::expandLastfiles() LastFilesSection::LastFiles const & lf = theSession().lastFiles().lastFiles(); LastFilesSection::LastFiles::const_iterator lfit = lf.begin(); - int ii = 1; + unsigned int ii = 1; - for (; lfit != lf.end() && ii < 10; ++lfit, ++ii) { + for (; lfit != lf.end() && ii <= lyxrc.num_lastfiles; ++lfit, ++ii) { string const file = lfit->absFilename(); - QString const label = QString("%1. %2|%3").arg(ii) - .arg(toqstr(makeDisplayPath(file, 30))).arg(ii); + QString label; + if (ii < 10) + label = QString("%1. %2|%3").arg(ii) + .arg(toqstr(makeDisplayPath(file, 30))).arg(ii); + else + label = QString("%1. %2").arg(ii) + .arg(toqstr(makeDisplayPath(file, 30))); add(MenuItem(MenuItem::Command, label, FuncRequest(LFUN_FILE_OPEN, file))); } }