Skip to content

Commit 311942b

Browse files
committed
fix #1253
1 parent f29aa4e commit 311942b

File tree

3 files changed

+7
-14
lines changed

3 files changed

+7
-14
lines changed

src/Layouts/SectionBoard.vala

+4-5
Original file line numberDiff line numberDiff line change
@@ -558,11 +558,11 @@ public class Layouts.SectionBoard : Gtk.FlowBoxChild {
558558
content_box.add_controller (drop_target);
559559
drop_target.drop.connect ((value, x, y) => {
560560
var picked_widget = (Layouts.ItemBoard) value;
561-
var old_section_id = "";
562561

563562
picked_widget.drag_end ();
564563

565-
old_section_id = picked_widget.item.section_id;
564+
string old_section_id = picked_widget.item.section_id;
565+
string old_parent_id = picked_widget.item.parent_id;
566566

567567
picked_widget.item.project_id = section.project_id;
568568
picked_widget.item.section_id = section.id;
@@ -589,9 +589,8 @@ public class Layouts.SectionBoard : Gtk.FlowBoxChild {
589589
source_list.remove (picked_widget);
590590

591591
listbox.append (picked_widget);
592-
Services.EventBus.get_default ().update_inserted_item_map (picked_widget, old_section_id, "");
593-
// update_items_item_order (listbox);
594-
592+
Services.EventBus.get_default ().update_inserted_item_map (picked_widget, old_section_id, old_parent_id);
593+
595594
return true;
596595
});
597596
}

src/Layouts/SectionRow.vala

+3-3
Original file line numberDiff line numberDiff line change
@@ -702,11 +702,11 @@ public class Layouts.SectionRow : Gtk.ListBoxRow {
702702
drop_widget.add_controller (drop_inbox_target);
703703
drop_inbox_target.drop.connect ((target, value, x, y) => {
704704
var picked_widget = (Layouts.ItemRow) value;
705-
var old_section_id = "";
706705

707706
picked_widget.drag_end ();
708707

709-
old_section_id = picked_widget.item.section_id;
708+
string old_section_id = picked_widget.item.section_id;
709+
string old_parent_id = picked_widget.item.parent_id;
710710

711711
picked_widget.item.project_id = section.project_id;
712712
picked_widget.item.section_id = section.id;
@@ -734,7 +734,7 @@ public class Layouts.SectionRow : Gtk.ListBoxRow {
734734
source_list.remove (picked_widget);
735735

736736
listbox.insert (picked_widget, 0);
737-
Services.EventBus.get_default ().update_inserted_item_map (picked_widget, old_section_id, "");
737+
Services.EventBus.get_default ().update_inserted_item_map (picked_widget, old_section_id, old_parent_id);
738738
update_items_item_order (listbox);
739739

740740
return true;

src/Layouts/Sidebar.vala

-6
Original file line numberDiff line numberDiff line change
@@ -386,16 +386,10 @@ public class Layouts.Sidebar : Adw.Bin {
386386
Services.Database.get_default ().project_updated.connect (update_projects_sort);
387387

388388
Services.EventBus.get_default ().project_parent_changed.connect ((project, old_parent_id) => {
389-
print ("project: %s\n".printf (project.name));
390-
print ("project parent id: %s\n".printf (project.parent.name));
391-
print ("old_parent_id: %s\n".printf (old_parent_id));
392-
393389
if (old_parent_id == "") {
394390
if (local_hashmap.has_key (project.id)) {
395391
local_hashmap [project.id].hide_destroy ();
396392
local_hashmap.unset (project.id);
397-
398-
print ("Elimina sub project\n");
399393
}
400394

401395
if (todoist_hashmap.has_key (project.id)) {

0 commit comments

Comments
 (0)