diff --git a/ide/environmentopts.pp b/ide/environmentopts.pp index 7bdec94020..db7a8b1b88 100644 --- a/ide/environmentopts.pp +++ b/ide/environmentopts.pp @@ -335,6 +335,9 @@ type FNewUnitTemplate: string; FFileDialogFilter: string; + // Prevent repopulating Recent project files menu with example projects if it was already cleared up. + FAlreadyPopulatedRecentFiles : Boolean; + function GetCompilerFilename: string; function GetCompilerMessagesFilename: string; function GetDebuggerEventLogColors(AIndex: TDBGEventType): TDebuggerEventLogColor; @@ -1268,13 +1271,16 @@ begin LoadRecentList(XMLConfig,FRecentPackageFiles, Path+'Recent/PackageFiles/',rltFile); + FAlreadyPopulatedRecentFiles := XMLConfig.GetValue(Path+'Recent/AlreadyPopulated', false); + // Add example projects to an empty project list if examples have write access - if FRecentProjectFiles.count=0 then begin + if (FRecentProjectFiles.count=0) and (not FAlreadyPopulatedRecentFiles) then begin AddRecentProjectInitial('examples/jpeg/', 'jpegexample.lpi'); AddRecentProjectInitial('examples/sprites/', 'spriteexample.lpi'); AddRecentProjectInitial('examples/openglcontrol/', 'openglcontrol_demo.lpi'); AddRecentProjectInitial('examples/barchart/', 'chartdemo.lpi'); AddRecentProjectInitial('examples/', 'hello.lpi'); + FAlreadyPopulatedRecentFiles := True; end; // external tools @@ -1609,6 +1615,8 @@ begin SaveRecentList(XMLConfig,FRecentPackageFiles, Path+'Recent/PackageFiles/'); + XMLConfig.SetValue(Path+'Recent/AlreadyPopulated', FAlreadyPopulatedRecentFiles); + // external tools fExternalTools.Save(FConfigStore,Path+'ExternalTools/');