Skip to content
Permalink
Browse files

respect maximum of recent project settings when loading (#8153)

* respect maximum of recent project settings when loading

* fix uint int comparison
  • Loading branch information
3nids committed Oct 11, 2018
1 parent dc08db7 commit 68f4cf2d0fce1e431981138e2a6ccca644d38bc8
Showing with 5 additions and 2 deletions.
  1. +5 −2 src/app/qgisapp.cpp
@@ -1881,10 +1881,11 @@ void QgisApp::readRecentProjects()
std::sort( projectKeys.begin(), projectKeys.end() );

int pinPos = 0;
Q_FOREACH ( int key, projectKeys )
const int maxProjects = QgsSettings().value( QStringLiteral( "maxRecentProjects" ), 20, QgsSettings::App ).toInt();
for ( int i = 0; i < projectKeys.count(); ++i )
{
QgsWelcomePageItemsModel::RecentProjectData data;
settings.beginGroup( QString::number( key ) );
settings.beginGroup( QString::number( projectKeys.at( i ) ) );
data.title = settings.value( QStringLiteral( "title" ) ).toString();
data.path = settings.value( QStringLiteral( "path" ) ).toString();
data.previewImagePath = settings.value( QStringLiteral( "previewImage" ) ).toString();
@@ -1900,6 +1901,8 @@ void QgisApp::readRecentProjects()
{
mRecentProjects.append( data );
}
if ( mRecentProjects.count() >= maxProjects )
break;
}
settings.endGroup();
}

0 comments on commit 68f4cf2

Please sign in to comment.
You can’t perform that action at this time.