From 85a67e4473ebdc32ed82a312208eb7f1fb6d59d2 Mon Sep 17 00:00:00 2001 From: Basile Burg Date: Sat, 14 May 2022 14:51:09 +0200 Subject: [PATCH] project group, fix reg, segv on attempt to add new items --- CHANGELOG.md | 1 + src/u_projgroup.pas | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e48a331..495acecc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Crash to desktop for certain invalid or incomplete D constructs. (#107) - Project configuration index not handled with option "reloadLastDocuments". +- Project groups widget, adding new items was broken. ## Other diff --git a/src/u_projgroup.pas b/src/u_projgroup.pas index 844d091c..6fbd0e56 100644 --- a/src/u_projgroup.pas +++ b/src/u_projgroup.pas @@ -277,7 +277,8 @@ begin fFreeStanding := nil; result.fProj.activate; end; - result.configurationIndex:=result.fProj.getActiveConfigurationIndex; + if assigned(result.fProj) then + result.configurationIndex:=result.fProj.getActiveConfigurationIndex; end; function TProjectGroup.getProject(ix: Integer): ICommonProject; @@ -787,9 +788,9 @@ begin Data:= prj; fmt := prj.project.getFormat; case fmt of - pfDEXED : Caption := prj.fFilename.extractFileName; + pfDEXED : Caption := prj.absoluteFilename().extractFileName(); pfDUB : Caption := TDubProject(prj.project.getProject).packageName; - pfMAKE : Caption := prj.fFilename.extractFileDir.extractFileName; + pfMAKE : Caption := prj.absoluteFilename().extractFileDir().extractFileName(); end; SubItems.Add(typeStr[fmt]); SubItems.Add(asyncStr[prj.fAsyncMode]);