@@ -1426,14 +1426,9 @@ QgisAppStyleSheet* QgisApp::styleSheetBuilder()
1426
1426
return mStyleSheetBuilder ;
1427
1427
}
1428
1428
1429
- // restore any application settings stored in QSettings
1430
- void QgisApp::readSettings ()
1429
+ void QgisApp::readRecentProjects ()
1431
1430
{
1432
1431
QSettings settings;
1433
- QString themename = settings.value ( " UI/UITheme" , " default" ).toString ();
1434
- setTheme ( themename );
1435
-
1436
- // Read legacy settings
1437
1432
mRecentProjects .clear ();
1438
1433
1439
1434
settings.beginGroup ( " /UI" );
@@ -1477,6 +1472,16 @@ void QgisApp::readSettings()
1477
1472
mRecentProjects .append ( data );
1478
1473
}
1479
1474
settings.endGroup ();
1475
+ }
1476
+
1477
+ void QgisApp::readSettings ()
1478
+ {
1479
+ QSettings settings;
1480
+ QString themename = settings.value ( " UI/UITheme" , " default" ).toString ();
1481
+ setTheme ( themename );
1482
+
1483
+ // Read legacy settings
1484
+ readRecentProjects ();
1480
1485
1481
1486
// this is a new session! reset enable macros value to "ask"
1482
1487
// whether set to "just for this session"
@@ -3258,6 +3263,10 @@ void QgisApp::updateRecentProjectPaths()
3258
3263
// add this file to the recently opened/saved projects list
3259
3264
void QgisApp::saveRecentProjectPath ( const QString& projectPath, bool savePreviewImage )
3260
3265
{
3266
+ // first, re-read the recent project paths. This prevents loss of recent
3267
+ // projects when multiple QGIS sessions are open
3268
+ readRecentProjects ();
3269
+
3261
3270
QSettings settings;
3262
3271
3263
3272
// Get canonical absolute path
0 commit comments