From 311942b4559a740ca2cf76c87d32eb72d1f964bc Mon Sep 17 00:00:00 2001 From: Alain Date: Tue, 16 Apr 2024 05:40:14 -0500 Subject: [PATCH] fix #1253 --- src/Layouts/SectionBoard.vala | 9 ++++----- src/Layouts/SectionRow.vala | 6 +++--- src/Layouts/Sidebar.vala | 6 ------ 3 files changed, 7 insertions(+), 14 deletions(-) diff --git a/src/Layouts/SectionBoard.vala b/src/Layouts/SectionBoard.vala index df66bfdac..ad4a53757 100644 --- a/src/Layouts/SectionBoard.vala +++ b/src/Layouts/SectionBoard.vala @@ -558,11 +558,11 @@ public class Layouts.SectionBoard : Gtk.FlowBoxChild { content_box.add_controller (drop_target); drop_target.drop.connect ((value, x, y) => { var picked_widget = (Layouts.ItemBoard) value; - var old_section_id = ""; picked_widget.drag_end (); - old_section_id = picked_widget.item.section_id; + string old_section_id = picked_widget.item.section_id; + string old_parent_id = picked_widget.item.parent_id; picked_widget.item.project_id = section.project_id; picked_widget.item.section_id = section.id; @@ -589,9 +589,8 @@ public class Layouts.SectionBoard : Gtk.FlowBoxChild { source_list.remove (picked_widget); listbox.append (picked_widget); - Services.EventBus.get_default ().update_inserted_item_map (picked_widget, old_section_id, ""); - // update_items_item_order (listbox); - + Services.EventBus.get_default ().update_inserted_item_map (picked_widget, old_section_id, old_parent_id); + return true; }); } diff --git a/src/Layouts/SectionRow.vala b/src/Layouts/SectionRow.vala index d68c9047d..d6d8053f6 100644 --- a/src/Layouts/SectionRow.vala +++ b/src/Layouts/SectionRow.vala @@ -702,11 +702,11 @@ public class Layouts.SectionRow : Gtk.ListBoxRow { drop_widget.add_controller (drop_inbox_target); drop_inbox_target.drop.connect ((target, value, x, y) => { var picked_widget = (Layouts.ItemRow) value; - var old_section_id = ""; picked_widget.drag_end (); - old_section_id = picked_widget.item.section_id; + string old_section_id = picked_widget.item.section_id; + string old_parent_id = picked_widget.item.parent_id; picked_widget.item.project_id = section.project_id; picked_widget.item.section_id = section.id; @@ -734,7 +734,7 @@ public class Layouts.SectionRow : Gtk.ListBoxRow { source_list.remove (picked_widget); listbox.insert (picked_widget, 0); - Services.EventBus.get_default ().update_inserted_item_map (picked_widget, old_section_id, ""); + Services.EventBus.get_default ().update_inserted_item_map (picked_widget, old_section_id, old_parent_id); update_items_item_order (listbox); return true; diff --git a/src/Layouts/Sidebar.vala b/src/Layouts/Sidebar.vala index 78a6d1ed1..06c1168fd 100644 --- a/src/Layouts/Sidebar.vala +++ b/src/Layouts/Sidebar.vala @@ -386,16 +386,10 @@ public class Layouts.Sidebar : Adw.Bin { Services.Database.get_default ().project_updated.connect (update_projects_sort); Services.EventBus.get_default ().project_parent_changed.connect ((project, old_parent_id) => { - print ("project: %s\n".printf (project.name)); - print ("project parent id: %s\n".printf (project.parent.name)); - print ("old_parent_id: %s\n".printf (old_parent_id)); - if (old_parent_id == "") { if (local_hashmap.has_key (project.id)) { local_hashmap [project.id].hide_destroy (); local_hashmap.unset (project.id); - - print ("Elimina sub project\n"); } if (todoist_hashmap.has_key (project.id)) {