recent files hide missing

This commit is contained in:
Oskar Wallgren
2015-07-06 15:31:06 +02:00
parent a91e7f72db
commit 6888952fec
2 changed files with 16 additions and 3 deletions

View File

@@ -197,7 +197,7 @@ void ConfigManager::addRecentlyOpenedProject( const QString & _file )
if( !_file.endsWith( ".mpt", Qt::CaseInsensitive ) )
{
m_recentlyOpenedProjects.removeAll( _file );
if( m_recentlyOpenedProjects.size() > 15 )
if( m_recentlyOpenedProjects.size() > 30 )
{
m_recentlyOpenedProjects.removeLast();
}

View File

@@ -830,10 +830,23 @@ void MainWindow::updateRecentlyOpenedProjectsMenu()
{
m_recentlyOpenedProjectsMenu->clear();
QStringList rup = ConfigManager::inst()->recentlyOpenedProjects();
// The file history goes 30 deep but we only show the 15
// most recent ones that we can open.
int shownInMenu = 0;
for( QStringList::iterator it = rup.begin(); it != rup.end(); ++it )
{
m_recentlyOpenedProjectsMenu->addAction(
embed::getIconPixmap( "project_file" ), *it );
QFileInfo recentFile( *it );
if ( recentFile.exists() )
{
m_recentlyOpenedProjectsMenu->addAction(
embed::getIconPixmap( "project_file" ), *it );
shownInMenu++;
if( shownInMenu >= 15 )
{
return;
}
}
}
}