ProjectGroups: show only existing project groups in recent menus

This commit is contained in:
Ondrej Pokorny 2024-08-23 12:58:37 +02:00
parent 4afb03e646
commit 5d74e0475d
2 changed files with 14 additions and 6 deletions

View File

@ -625,13 +625,17 @@ end;
procedure TIDEProjectGroupManager.UpdateRecentProjectGroupMenu;
var
i: Integer;
i, l: Integer;
Item: TIDEMenuItem;
aFilename: String;
begin
i:=0;
while i<Options.RecentProjectGroups.Count do begin
aFilename:=Options.RecentProjectGroups[i];
l:=0;
while l<Options.RecentProjectGroups.Count do begin
aFilename:=Options.RecentProjectGroups[l];
inc(l);
if not FileExists(aFilename) then
continue;
if i<PGOpenRecentSubMenu.Count then begin
Item:=PGOpenRecentSubMenu[i];
Item.Caption:=aFilename;

View File

@ -1746,13 +1746,17 @@ end;
procedure TProjectGroupEditorForm.UpdateRecentProjectGroupMenu;
var
i: Integer;
i, l: Integer;
Item: TMenuItem;
aFilename: String;
begin
i:=0;
while i<IDEProjectGroupManager.Options.RecentProjectGroups.Count do begin
aFilename:=IDEProjectGroupManager.Options.RecentProjectGroups[i];
l:=0;
while l<IDEProjectGroupManager.Options.RecentProjectGroups.Count do begin
aFilename:=IDEProjectGroupManager.Options.RecentProjectGroups[l];
inc(l);
if not FileExists(aFilename) then
continue;
if i<PopupMenuOpen.Items.Count then begin
Item:=PopupMenuOpen.Items[i];
end