From f6f2b1003f3c2ef2fb8eb077746af7a1c4d5d8ff Mon Sep 17 00:00:00 2001 From: Alain Date: Mon, 4 Mar 2024 17:58:09 -0500 Subject: [PATCH] fix #1171 --- core/Services/Todoist.vala | 2 - ....github.alainm23.planify.appdata.xml.in.in | 9 +++ meson.build | 2 +- src/Layouts/ItemRow.vala | 17 +++-- src/Views/Filter.vala | 49 +++++++------- src/Views/Label/Label.vala | 19 +++--- src/Views/Label/Labels.vala | 4 +- src/Views/Pinboard.vala | 23 +++---- src/Views/Scheduled/ScheduledDay.vala | 40 +++++------ src/Views/Scheduled/ScheduledMonth.vala | 38 ++++++----- src/Views/Scheduled/ScheduledRange.vala | 38 ++++++----- src/Views/Today.vala | 66 ++++++++++--------- 12 files changed, 167 insertions(+), 140 deletions(-) diff --git a/core/Services/Todoist.vala b/core/Services/Todoist.vala index 5a1a8d0c5..6596a4cd8 100644 --- a/core/Services/Todoist.vala +++ b/core/Services/Todoist.vala @@ -1212,7 +1212,6 @@ public class Services.Todoist : GLib.Object { public async HttpResponse move_item (Objects.Item item, string type, string id) { string uuid = Util.get_default ().generate_string (); string json = item.get_move_item (uuid, type, id); - print ("%s\n".printf (json)); var message = new Soup.Message ("POST", TODOIST_SYNC_URL); message.request_headers.append ( @@ -1225,7 +1224,6 @@ public class Services.Todoist : GLib.Object { try { GLib.Bytes stream = yield session.send_and_read_async (message, GLib.Priority.HIGH, null); - print ("%s\n".printf ((string) stream.get_data ())); parser.load_from_data ((string) stream.get_data ()); print_root (parser.get_root ()); diff --git a/data/io.github.alainm23.planify.appdata.xml.in.in b/data/io.github.alainm23.planify.appdata.xml.in.in index 3911276fd..7a855a3cc 100644 --- a/data/io.github.alainm23.planify.appdata.xml.in.in +++ b/data/io.github.alainm23.planify.appdata.xml.in.in @@ -63,6 +63,15 @@ https://www.patreon.com/alainm23 @appid@.desktop + + +
    +
  • Fixed bug that improves CalDAV sync.
  • +
  • Fixed bug when moving tasks.
  • +
+
+
+
    diff --git a/meson.build b/meson.build index b3fd1fa27..f9fc9fd4e 100644 --- a/meson.build +++ b/meson.build @@ -1,7 +1,7 @@ project( 'io.github.alainm23.planify', 'vala', 'c', - version: '4.5.1' + version: '4.5.2' ) gnome = import('gnome') diff --git a/src/Layouts/ItemRow.vala b/src/Layouts/ItemRow.vala index be298d1eb..a1a106455 100644 --- a/src/Layouts/ItemRow.vala +++ b/src/Layouts/ItemRow.vala @@ -108,7 +108,7 @@ public class Layouts.ItemRow : Layouts.ItemBase { content_label.remove_css_class ("dim-label"); } - disable_drag_and_drop (); + _disable_drag_and_drop (); } else { itemrow_box.remove_css_class ("card-selected"); itemrow_box.remove_css_class ("card"); @@ -124,7 +124,10 @@ public class Layouts.ItemRow : Layouts.ItemBase { labels_summary.check_revealer (); update_request (); - build_drag_and_drop (); + + if (drag_enabled) { + build_drag_and_drop (); + } } } get { @@ -176,6 +179,7 @@ public class Layouts.ItemRow : Layouts.ItemBase { public uint destroy_timeout { get; set; default = 0; } public uint complete_timeout { get; set; default = 0; } public bool on_drag = false; + public bool drag_enabled { get; set; default = true; } public signal void item_added (); public signal void widget_destroyed (); @@ -1306,7 +1310,7 @@ public class Layouts.ItemRow : Layouts.ItemBase { item.move (project, section_id); } } - private void build_drag_and_drop () { + public void build_drag_and_drop () { // Drop Motion build_drop_motion (); @@ -1543,7 +1547,12 @@ public class Layouts.ItemRow : Layouts.ItemBase { })] = drop_order_target; } - private void disable_drag_and_drop () { + public void disable_drag_and_drop () { + drag_enabled = false; + _disable_drag_and_drop (); + } + + private void _disable_drag_and_drop () { remove_controller (drop_motion_ctrl); itemrow_box.remove_controller (drag_source); itemrow_box.remove_controller (drop_target); diff --git a/src/Views/Filter.vala b/src/Views/Filter.vala index 76fc5074f..25d669139 100644 --- a/src/Views/Filter.vala +++ b/src/Views/Filter.vala @@ -129,8 +129,8 @@ public class Views.Filter : Adw.Bin { Services.EventBus.get_default ().checked_toggled.connect (valid_checked_item); Services.EventBus.get_default ().item_moved.connect ((item) => { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } }); @@ -190,21 +190,22 @@ public class Views.Filter : Adw.Bin { } private void add_item (Objects.Item item) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } private void valid_add_item (Objects.Item item, bool insert = true) { if (filter is Objects.Priority) { Objects.Priority priority = ((Objects.Priority) filter); - if (!items.has_key (item.id_string) && item.priority == priority.priority && insert) { + if (!items.has_key (item.id) && item.priority == priority.priority && insert) { add_item (item); } } else if (filter is Objects.Completed) { - if (!items.has_key (item.id_string) && item.checked && insert) { + if (!items.has_key (item.id) && item.checked && insert) { add_item (item); } } @@ -213,9 +214,9 @@ public class Views.Filter : Adw.Bin { } private void valid_delete_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id)) { + items[item.id].hide_destroy (); + items.unset (item.id); } validate_placeholder (); @@ -225,21 +226,21 @@ public class Views.Filter : Adw.Bin { if (filter is Objects.Priority) { Objects.Priority priority = ((Objects.Priority) filter); - if (items.has_key (item.id_string) && item.priority != priority.priority) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && item.priority != priority.priority) { + items[item.id].hide_destroy (); + items.unset (item.id); } - if (items.has_key (item.id_string) && !item.checked) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && !item.checked) { + items[item.id].hide_destroy (); + items.unset (item.id); } valid_add_item (item); } else if (filter is Objects.Completed) { - if (items.has_key (item.id_string) && item.checked) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && item.checked) { + items[item.id].hide_destroy (); + items.unset (item.id); } valid_add_item (item); @@ -251,9 +252,9 @@ public class Views.Filter : Adw.Bin { private void valid_checked_item (Objects.Item item, bool old_checked) { if (filter is Objects.Priority) { if (!old_checked) { - if (items.has_key (item.id_string) && item.completed) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && item.completed) { + items[item.id].hide_destroy (); + items.unset (item.id); } } else { valid_update_item (item); @@ -262,9 +263,9 @@ public class Views.Filter : Adw.Bin { if (!old_checked) { valid_update_item (item); } else { - if (items.has_key (item.id_string) && !item.completed) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && !item.completed) { + items[item.id].hide_destroy (); + items.unset (item.id); } } } diff --git a/src/Views/Label/Label.vala b/src/Views/Label/Label.vala index ea0c241a3..17123bcc8 100644 --- a/src/Views/Label/Label.vala +++ b/src/Views/Label/Label.vala @@ -138,7 +138,7 @@ public class Views.Label : Adw.Bin { } private void valid_add_item (Objects.Item item, bool insert = true) { - // if (!items.has_key (item.id_string) && item.labels.has_key (label.id_string) + // if (!items.has_key (item.id) && item.labels.has_key (label.id) // && insert) { // add_item (item); // } @@ -147,18 +147,18 @@ public class Views.Label : Adw.Bin { } private void valid_delete_item (Objects.Item item) { - // if (items.has_key (item.id_string)) { - // items[item.id_string].hide_destroy (); - // items.unset (item.id_string); + // if (items.has_key (item.id)) { + // items[item.id].hide_destroy (); + // items.unset (item.id); // } // validate_placeholder (); } private void valid_update_item (Objects.Item item) { - // if (items.has_key (item.id_string) && !item.labels.has_key (label.id_string)) { - // items[item.id_string].hide_destroy (); - // items.unset (item.id_string); + // if (items.has_key (item.id) && !item.labels.has_key (label.id)) { + // items[item.id].hide_destroy (); + // items.unset (item.id); // } // valid_add_item (item); @@ -179,10 +179,11 @@ public class Views.Label : Adw.Bin { } private void add_item (Objects.Item item) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } public void update_request () { diff --git a/src/Views/Label/Labels.vala b/src/Views/Label/Labels.vala index 527fa1f9a..c35427f9a 100644 --- a/src/Views/Label/Labels.vala +++ b/src/Views/Label/Labels.vala @@ -144,11 +144,11 @@ public class Views.Labels : Adw.Bin { }); labels_local_header.row_activated.connect ((row) => { - Services.EventBus.get_default ().pane_selected (PaneType.LABEL, ((Layouts.LabelRow) row).label.id_string); + Services.EventBus.get_default ().pane_selected (PaneType.LABEL, ((Layouts.LabelRow) row).label.id); }); labels_todoist_header.row_activated.connect ((row) => { - Services.EventBus.get_default ().pane_selected (PaneType.LABEL, ((Layouts.LabelRow) row).label.id_string); + Services.EventBus.get_default ().pane_selected (PaneType.LABEL, ((Layouts.LabelRow) row).label.id); }); Services.Database.get_default ().label_added.connect ((label) => { diff --git a/src/Views/Pinboard.vala b/src/Views/Pinboard.vala index b4b8f11a2..e9a4c9184 100644 --- a/src/Views/Pinboard.vala +++ b/src/Views/Pinboard.vala @@ -117,8 +117,8 @@ public class Views.Pinboard : Adw.Bin { Services.Database.get_default ().item_updated.connect (valid_update_item); Services.EventBus.get_default ().item_moved.connect ((item) => { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } }); @@ -144,7 +144,7 @@ public class Views.Pinboard : Adw.Bin { } private void valid_add_item (Objects.Item item, bool insert = true) { - if (!items.has_key (item.id_string) && item.pinned && !item.checked) { + if (!items.has_key (item.id) && item.pinned && !item.checked) { add_item (item); } @@ -152,18 +152,18 @@ public class Views.Pinboard : Adw.Bin { } private void valid_delete_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id)) { + items[item.id].hide_destroy (); + items.unset (item.id); } validate_placeholder (); } private void valid_update_item (Objects.Item item) { - if (items.has_key (item.id_string) && (!item.pinned || item.checked)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && (!item.pinned || item.checked)) { + items[item.id].hide_destroy (); + items.unset (item.id); } valid_add_item (item); @@ -176,9 +176,10 @@ public class Views.Pinboard : Adw.Bin { } private void add_item (Objects.Item item) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } } diff --git a/src/Views/Scheduled/ScheduledDay.vala b/src/Views/Scheduled/ScheduledDay.vala index 92bd6902c..5fd5efb74 100644 --- a/src/Views/Scheduled/ScheduledDay.vala +++ b/src/Views/Scheduled/ScheduledDay.vala @@ -136,8 +136,8 @@ public class Views.Scheduled.ScheduledDay : Gtk.ListBoxRow { Services.Database.get_default ().item_updated.connect (valid_update_item); Services.EventBus.get_default ().item_moved.connect ((item) => { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } }); } @@ -149,50 +149,52 @@ public class Views.Scheduled.ScheduledDay : Gtk.ListBoxRow { } private void add_item (Objects.Item item) { - if (!items.has_key (item.id_string)) { - items [item.id_string] = new Layouts.ItemRow (item) { + if (!items.has_key (item.id)) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } } private void valid_add_item (Objects.Item item) { - if (!items.has_key (item.id_string) && + if (!items.has_key (item.id) && Services.Database.get_default ().valid_item_by_date (item, date, false)) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } listbox_revealer.reveal_child = has_items; } private void valid_delete_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id)) { + items[item.id].hide_destroy (); + items.unset (item.id); } listbox_revealer.reveal_child = has_items; } private void valid_update_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } - if (items.has_key (item.id_string) && !item.has_due) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && !item.has_due) { + items[item.id].hide_destroy (); + items.unset (item.id); } - if (items.has_key (item.id_string) && item.has_due) { + if (items.has_key (item.id) && item.has_due) { if (!Services.Database.get_default ().valid_item_by_date (item, date, false)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + items[item.id].hide_destroy (); + items.unset (item.id); } } diff --git a/src/Views/Scheduled/ScheduledMonth.vala b/src/Views/Scheduled/ScheduledMonth.vala index c19ecaa2b..f3f0ee097 100644 --- a/src/Views/Scheduled/ScheduledMonth.vala +++ b/src/Views/Scheduled/ScheduledMonth.vala @@ -127,8 +127,8 @@ public class Views.Scheduled.ScheduledMonth : Gtk.ListBoxRow { Services.Database.get_default ().item_updated.connect (valid_update_item); Services.EventBus.get_default ().item_moved.connect ((item) => { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } }); } @@ -140,48 +140,50 @@ public class Views.Scheduled.ScheduledMonth : Gtk.ListBoxRow { } private void add_item (Objects.Item item) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } private void valid_add_item (Objects.Item item) { - if (!items.has_key (item.id_string) && + if (!items.has_key (item.id) && Services.Database.get_default ().valid_item_by_month (item, date, false)) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } listbox_revealer.reveal_child = has_items; } private void valid_delete_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id)) { + items[item.id].hide_destroy (); + items.unset (item.id); } listbox_revealer.reveal_child = has_items; } private void valid_update_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } - if (items.has_key (item.id_string) && !item.has_due) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && !item.has_due) { + items[item.id].hide_destroy (); + items.unset (item.id); } - if (items.has_key (item.id_string) && item.has_due) { + if (items.has_key (item.id) && item.has_due) { if (!Services.Database.get_default ().valid_item_by_date (item, date, false)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + items[item.id].hide_destroy (); + items.unset (item.id); } } diff --git a/src/Views/Scheduled/ScheduledRange.vala b/src/Views/Scheduled/ScheduledRange.vala index ed85988d3..e2909aca2 100644 --- a/src/Views/Scheduled/ScheduledRange.vala +++ b/src/Views/Scheduled/ScheduledRange.vala @@ -139,8 +139,8 @@ public class Views.Scheduled.ScheduledRange : Gtk.ListBoxRow { Services.Database.get_default ().item_updated.connect (valid_update_item); Services.EventBus.get_default ().item_moved.connect ((item) => { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } }); } @@ -152,48 +152,50 @@ public class Views.Scheduled.ScheduledRange : Gtk.ListBoxRow { } private void add_item (Objects.Item item) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } private void valid_add_item (Objects.Item item) { - if (!items.has_key (item.id_string) && + if (!items.has_key (item.id) && Services.Database.get_default ().valid_item_by_date_range (item, start_date, end_date, false)) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); } listbox_revealer.reveal_child = has_items; } private void valid_delete_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id)) { + items[item.id].hide_destroy (); + items.unset (item.id); } listbox_revealer.reveal_child = has_items; } private void valid_update_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } - if (items.has_key (item.id_string) && !item.has_due) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && !item.has_due) { + items[item.id].hide_destroy (); + items.unset (item.id); } - if (items.has_key (item.id_string) && item.has_due) { + if (items.has_key (item.id) && item.has_due) { if (!Services.Database.get_default ().valid_item_by_date_range (item, start_date, end_date, false)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + items[item.id].hide_destroy (); + items.unset (item.id); } } diff --git a/src/Views/Today.vala b/src/Views/Today.vala index e0df85b00..05f56df73 100644 --- a/src/Views/Today.vala +++ b/src/Views/Today.vala @@ -249,12 +249,12 @@ public class Views.Today : Adw.Bin { Services.Database.get_default ().item_updated.connect (valid_update_item); Services.EventBus.get_default ().item_moved.connect ((item) => { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } - if (overdue_items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (overdue_items.has_key (item.id)) { + items[item.id].update_request (); } }); @@ -296,30 +296,32 @@ public class Views.Today : Adw.Bin { } private void add_item (Objects.Item item) { - items [item.id_string] = new Layouts.ItemRow (item) { + items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - listbox.append (items [item.id_string]); + items [item.id].disable_drag_and_drop (); + listbox.append (items [item.id]); update_headers (); check_placeholder (); } private void add_overdue_item (Objects.Item item) { - overdue_items [item.id_string] = new Layouts.ItemRow (item) { + overdue_items [item.id] = new Layouts.ItemRow (item) { show_project_label = true }; - overdue_listbox.append (overdue_items [item.id_string]); + overdue_items [item.id].disable_drag_and_drop (); + overdue_listbox.append (overdue_items [item.id]); update_headers (); check_placeholder (); } private void valid_add_item (Objects.Item item, bool insert = true) { - if (!items.has_key (item.id_string) && + if (!items.has_key (item.id) && Services.Database.get_default ().valid_item_by_date (item, date, false)) { add_item (item); } - if (!overdue_items.has_key (item.id_string) && + if (!overdue_items.has_key (item.id) && Services.Database.get_default ().valid_item_by_overdue (item, date, false)) { add_overdue_item (item); } @@ -329,14 +331,14 @@ public class Views.Today : Adw.Bin { } private void valid_delete_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id)) { + items[item.id].hide_destroy (); + items.unset (item.id); } - if (overdue_items.has_key (item.id_string)) { - overdue_items[item.id_string].hide_destroy (); - overdue_items.unset (item.id_string); + if (overdue_items.has_key (item.id)) { + overdue_items[item.id].hide_destroy (); + overdue_items.unset (item.id); } update_headers (); @@ -344,35 +346,35 @@ public class Views.Today : Adw.Bin { } private void valid_update_item (Objects.Item item) { - if (items.has_key (item.id_string)) { - items[item.id_string].update_request (); + if (items.has_key (item.id)) { + items[item.id].update_request (); } - if (overdue_items.has_key (item.id_string)) { - overdue_items[item.id_string].update_request (); + if (overdue_items.has_key (item.id)) { + overdue_items[item.id].update_request (); } - if (items.has_key (item.id_string) && !item.has_due) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + if (items.has_key (item.id) && !item.has_due) { + items[item.id].hide_destroy (); + items.unset (item.id); } - if (overdue_items.has_key (item.id_string) && !item.has_due) { - overdue_items[item.id_string].hide_destroy (); - overdue_items.unset (item.id_string); + if (overdue_items.has_key (item.id) && !item.has_due) { + overdue_items[item.id].hide_destroy (); + overdue_items.unset (item.id); } - if (items.has_key (item.id_string) && item.has_due) { + if (items.has_key (item.id) && item.has_due) { if (!Services.Database.get_default ().valid_item_by_date (item, date, false)) { - items[item.id_string].hide_destroy (); - items.unset (item.id_string); + items[item.id].hide_destroy (); + items.unset (item.id); } } - if (overdue_items.has_key (item.id_string) && item.has_due) { + if (overdue_items.has_key (item.id) && item.has_due) { if (!Services.Database.get_default ().valid_item_by_overdue (item, date, false)) { - overdue_items[item.id_string].hide_destroy (); - overdue_items.unset (item.id_string); + overdue_items[item.id].hide_destroy (); + overdue_items.unset (item.id); } }