Skip to content

Commit

Permalink
Double number of projects kept on welcome page, make configurable
Browse files Browse the repository at this point in the history
Because 10 isn't enough!
  • Loading branch information
nyalldawson committed Aug 10, 2018
1 parent 7127e38 commit a5b0c76
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
3 changes: 3 additions & 0 deletions resources/qgis_global_settings.ini
Expand Up @@ -30,6 +30,9 @@ connections-xyz\OpenStreetMap\zmin=0

[app]

# Maximum number of recent projects to show on the welcome page
maxRecentProjects=20

# Minimum time (in seconds) for a background task to execute in order for a system
# notification to be shown when the task completes.
minTaskLengthForSystemNotification=5
Expand Down
6 changes: 4 additions & 2 deletions src/app/qgisapp.cpp
Expand Up @@ -4144,9 +4144,11 @@ void QgisApp::saveRecentProjectPath( bool savePreviewImage )
// Insert this file to the list
mRecentProjects.insert( projectData.pin ? 0 : nonPinnedPos, projectData );

// Keep the list to 10 items by trimming excess off the bottom
const uint maxProjects = QgsSettings().value( QStringLiteral( "maxRecentProjects" ), 20, QgsSettings::App ).toUInt();

// Keep the list to maxProjects items by trimming excess off the bottom
// And remove the associated image
while ( mRecentProjects.count() > 10 + pinnedCount )
while ( mRecentProjects.count() > maxProjects + pinnedCount )
{
QFile( mRecentProjects.takeLast().previewImagePath ).remove();
}
Expand Down

0 comments on commit a5b0c76

Please sign in to comment.