From 46246fc7cd56407f48b997e67dc9b9c90b86e1b3 Mon Sep 17 00:00:00 2001 From: Alain Date: Sat, 11 May 2024 05:59:40 -0500 Subject: [PATCH] fix #1254 --- core/Objects/Item.vala | 8 ++++++++ core/Services/Database.vala | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/core/Objects/Item.vala b/core/Objects/Item.vala index 55f970593..777a7a3b1 100644 --- a/core/Objects/Item.vala +++ b/core/Objects/Item.vala @@ -1527,4 +1527,12 @@ public class Objects.Item : Objects.BaseObject { return project.is_archived; } + + public bool exists_project (Objects.Project project) { + if (has_parent) { + return parent.exists_project (project); + } + + return project_id == project.id; + } } diff --git a/core/Services/Database.vala b/core/Services/Database.vala index c361af6da..355774913 100644 --- a/core/Services/Database.vala +++ b/core/Services/Database.vala @@ -1389,7 +1389,7 @@ public class Services.Database : GLib.Object { Gee.ArrayList return_value = new Gee.ArrayList (); lock (_items) { foreach (Objects.Item item in items) { - if (item.project_id == project.id) { + if (item.exists_project (project)) { return_value.add (item); } }