File tree Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Expand file tree Collapse file tree 1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -1881,10 +1881,11 @@ void QgisApp::readRecentProjects()
1881
1881
std::sort ( projectKeys.begin (), projectKeys.end () );
1882
1882
1883
1883
int pinPos = 0 ;
1884
- Q_FOREACH ( int key, projectKeys )
1884
+ const int maxProjects = QgsSettings ().value ( QStringLiteral ( " maxRecentProjects" ), 20 , QgsSettings::App ).toInt ();
1885
+ for ( int i = 0 ; i < projectKeys.count (); ++i )
1885
1886
{
1886
1887
QgsWelcomePageItemsModel::RecentProjectData data;
1887
- settings.beginGroup ( QString::number ( key ) );
1888
+ settings.beginGroup ( QString::number ( projectKeys. at ( i ) ) );
1888
1889
data.title = settings.value ( QStringLiteral ( " title" ) ).toString ();
1889
1890
data.path = settings.value ( QStringLiteral ( " path" ) ).toString ();
1890
1891
data.previewImagePath = settings.value ( QStringLiteral ( " previewImage" ) ).toString ();
@@ -1900,6 +1901,8 @@ void QgisApp::readRecentProjects()
1900
1901
{
1901
1902
mRecentProjects .append ( data );
1902
1903
}
1904
+ if ( mRecentProjects .count () >= maxProjects )
1905
+ break ;
1903
1906
}
1904
1907
settings.endGroup ();
1905
1908
}
You can’t perform that action at this time.
0 commit comments