Skip to content

Commit a5b0c76

Browse files
committedAug 10, 2018
Double number of projects kept on welcome page, make configurable
Because 10 isn't enough!
1 parent 7127e38 commit a5b0c76

File tree

2 files changed

+7
-2
lines changed

2 files changed

+7
-2
lines changed
 

‎resources/qgis_global_settings.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,9 @@ connections-xyz\OpenStreetMap\zmin=0
3030

3131
[app]
3232

33+
# Maximum number of recent projects to show on the welcome page
34+
maxRecentProjects=20
35+
3336
# Minimum time (in seconds) for a background task to execute in order for a system
3437
# notification to be shown when the task completes.
3538
minTaskLengthForSystemNotification=5

‎src/app/qgisapp.cpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4144,9 +4144,11 @@ void QgisApp::saveRecentProjectPath( bool savePreviewImage )
41444144
// Insert this file to the list
41454145
mRecentProjects.insert( projectData.pin ? 0 : nonPinnedPos, projectData );
41464146

4147-
// Keep the list to 10 items by trimming excess off the bottom
4147+
const uint maxProjects = QgsSettings().value( QStringLiteral( "maxRecentProjects" ), 20, QgsSettings::App ).toUInt();
4148+
4149+
// Keep the list to maxProjects items by trimming excess off the bottom
41484150
// And remove the associated image
4149-
while ( mRecentProjects.count() > 10 + pinnedCount )
4151+
while ( mRecentProjects.count() > maxProjects + pinnedCount )
41504152
{
41514153
QFile( mRecentProjects.takeLast().previewImagePath ).remove();
41524154
}

0 commit comments

Comments
 (0)