Skip to content

Commit 3fd32b4

Browse files
committedNov 16, 2017
Update recent project menu upon pin/unpin/remove actions
1 parent cfb78a1 commit 3fd32b4

File tree

1 file changed

+13
-4
lines changed

1 file changed

+13
-4
lines changed
 

‎src/app/qgisapp.cpp

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -736,16 +736,19 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
736736
{
737737
mRecentProjects.removeAt( row );
738738
saveRecentProjects();
739+
updateRecentProjectPaths();
739740
} );
740741
connect( mWelcomePage, &QgsWelcomePage::projectPinned, this, [ this ]( int row )
741742
{
742743
mRecentProjects.at( row ).pin = true;
743744
saveRecentProjects();
745+
updateRecentProjectPaths();
744746
} );
745747
connect( mWelcomePage, &QgsWelcomePage::projectUnpinned, this, [ this ]( int row )
746748
{
747749
mRecentProjects.at( row ).pin = false;
748750
saveRecentProjects();
751+
updateRecentProjectPaths();
749752
} );
750753
endProfile();
751754

@@ -831,7 +834,6 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
831834
functionProfile( &QgisApp::createMapTips, this, QStringLiteral( "Create map tips" ) );
832835
functionProfile( &QgisApp::createDecorations, this, QStringLiteral( "Create decorations" ) );
833836
functionProfile( &QgisApp::readSettings, this, QStringLiteral( "Read settings" ) );
834-
functionProfile( &QgisApp::updateRecentProjectPaths, this, QStringLiteral( "Update recent project paths" ) );
835837
functionProfile( &QgisApp::updateProjectFromTemplates, this, QStringLiteral( "Update project from templates" ) );
836838
functionProfile( &QgisApp::legendLayerSelectionChanged, this, QStringLiteral( "Legend layer selection changed" ) );
837839
functionProfile( &QgisApp::init3D, this, QStringLiteral( "Initialize 3D support" ) );
@@ -858,6 +860,12 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
858860
connect( projectsTemplateWatcher, &QFileSystemWatcher::directoryChanged, this, [this] { updateProjectFromTemplates(); } );
859861
}
860862

863+
// Update welcome page list
864+
startProfile( QStringLiteral( "Update recent project paths" ) );
865+
updateRecentProjectPaths();
866+
mWelcomePage->setRecentProjects( mRecentProjects );
867+
endProfile();
868+
861869
// initialize the plugin manager
862870
startProfile( QStringLiteral( "Plugin manager" ) );
863871
mPluginManager = new QgsPluginManager( this, restorePlugins );
@@ -3819,9 +3827,6 @@ void QgisApp::updateRecentProjectPaths()
38193827
}
38203828
}
38213829

3822-
if ( mWelcomePage )
3823-
mWelcomePage->setRecentProjects( mRecentProjects );
3824-
38253830
#if defined(Q_OS_WIN)
38263831
QWinJumpList jumplist;
38273832
jumplist.recent()->clear();
@@ -3912,6 +3917,10 @@ void QgisApp::saveRecentProjectPath( const QString &projectPath, bool savePrevie
39123917
// Update menu list of paths
39133918
updateRecentProjectPaths();
39143919

3920+
// Update welcome page list
3921+
if ( mWelcomePage )
3922+
mWelcomePage->setRecentProjects( mRecentProjects );
3923+
39153924
} // QgisApp::saveRecentProjectPath
39163925

39173926
// Save recent projects list to settings

0 commit comments

Comments
 (0)
Please sign in to comment.