Add function to clean recent file that do not exist

This commit is contained in:
jfmcarreira committed 2015-02-21 14:44:04 +00:00
1 parent 75a12a43ff
commit 60bc2953ed
2 files changed
+16

No files matched your search

+15
View File
@@ -846,6 +846,20 @@ Void plaYUVerApp::updateRecentFileActions()
m_arrayMenu[RECENT_MENU]->setEnabled( m_aRecentFileStreamInfo.size() > 0 ? true : false );
}
Void plaYUVerApp::checkRecentFileActions()
{
Int i = 0;
while( i < m_aRecentFileStreamInfo.size() )
{
if( !QFileInfo::exists( m_aRecentFileStreamInfo.at( i ).m_cFilename ) )
{
m_aRecentFileStreamInfo.remove( i );
continue;
}
i++;
}
}
Void plaYUVerApp::readSettings()
{
QSettings appSettings;
@@ -862,6 +876,7 @@ Void plaYUVerApp::readSettings()
QVariant value = appSettings.value( "MainWindow/RecentFileList" );
m_aRecentFileStreamInfo = value.value<PlaYUVerStreamInfoVector>();
checkRecentFileActions();
updateRecentFileActions();
m_appModuleVideo->readSettings();
+1
View File
@@ -124,6 +124,7 @@ private:
Void addStreamInfoToRecentList( PlaYUVerStreamInfo streamInfo );
Void updateRecentFileActions();
Void checkRecentFileActions();
Void readSettings();
Void writeSettings();