From 882aeef7e7213af0a98930bb49bc8822743b31b8 Mon Sep 17 00:00:00 2001 From: vsr Date: Fri, 18 Jul 2008 03:23:46 +0000 Subject: [PATCH] Fix pb of MRU action: show recently used items correctly in AddLast and MoveLast modes also --- src/Qtx/QtxMRUAction.cxx | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Qtx/QtxMRUAction.cxx b/src/Qtx/QtxMRUAction.cxx index d8f8d1194..5ee95779f 100755 --- a/src/Qtx/QtxMRUAction.cxx +++ b/src/Qtx/QtxMRUAction.cxx @@ -456,12 +456,13 @@ void QtxMRUAction::updateMenu() QStringList links; QMap map; int count = visibleCount() < 0 ? myLinks.count() : visibleCount(); - for ( QStringList::const_iterator it = myLinks.begin(); it != myLinks.end() && count > 0; ++it, count-- ) + int i = insertMode() == AddLast || insertMode() == MoveLast ? qMax( 0, myLinks.count()-count ) : 0; + for ( ; i < myLinks.count() && count > 0; ++i, count-- ) { - links.append( *it ); + links.append( myLinks[i] ); if ( linkType() == LinkAuto ) { - QString shortName = Qtx::file( *it ); + QString shortName = Qtx::file( myLinks[i] ); if ( map.contains( shortName ) ) map[shortName]++; else @@ -469,7 +470,7 @@ void QtxMRUAction::updateMenu() } } - int i = 1; + i = 1; for ( QStringList::const_iterator it = links.begin(); it != links.end(); ++it, i++ ) { QString linkName; -- 2.39.2