Skip to content

Commit

Permalink
Only lmms projects allowed in recent file list. Increase recent file …
Browse files Browse the repository at this point in the history
…memmory to 50
  • Loading branch information
zonkmachine committed Feb 11, 2016
1 parent ca8f80d commit 3bbe0e3
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/core/ConfigManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
#include <QDomElement>
#include <QDir>
#include <QFile>
#include <QFileInfo>
#include <QMessageBox>
#include <QApplication>
#include <QtCore/QTextStream>
Expand Down Expand Up @@ -253,16 +254,18 @@ void ConfigManager::createWorkingDir()



void ConfigManager::addRecentlyOpenedProject( const QString & _file )
void ConfigManager::addRecentlyOpenedProject( const QString & file )
{
if( !_file.endsWith( ".mpt", Qt::CaseInsensitive ) )
QFileInfo recentFile( file );
if( recentFile.suffix().toLower() == "mmp" ||
recentFile.suffix().toLower() == "mmpz" )
{
m_recentlyOpenedProjects.removeAll( _file );
if( m_recentlyOpenedProjects.size() > 30 )
m_recentlyOpenedProjects.removeAll( file );
if( m_recentlyOpenedProjects.size() > 50 )
{
m_recentlyOpenedProjects.removeLast();
}
m_recentlyOpenedProjects.push_front( _file );
m_recentlyOpenedProjects.push_front( file );
ConfigManager::inst()->saveConfigFile();
}
}
Expand Down

0 comments on commit 3bbe0e3

Please sign in to comment.