Avoid qt warning on project load when thumbnail doesn't exist

This commit is contained in:
Nyall Dawson 2019-09-17 14:20:43 +10:00
parent 676161762a
commit 65ac68bb0b

View File

@ -4508,7 +4508,9 @@ void QgisApp::saveRecentProjectPath( bool savePreviewImage )
// And remove the associated image
while ( static_cast< uint >( mRecentProjects.count() ) > maxProjects + pinnedCount )
{
QFile( mRecentProjects.takeLast().previewImagePath ).remove();
const QString previewImagePath = mRecentProjects.takeLast().previewImagePath;
if ( QFileInfo::exists( previewImagePath ) )
QFile( mRecentProjects.takeLast().previewImagePath ).remove();
}
// Persist the list