Skip to content

Commit 58d5895

Browse files
authored
Merge pull request #1662 from byquanton/fix/fix-pinboard
Fix: Pinboard not updating correctly
2 parents 51598b5 + 5f043cc commit 58d5895

File tree

2 files changed

+18
-11
lines changed

2 files changed

+18
-11
lines changed

core/Objects/Filters/Pinboard.vala

Lines changed: 15 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,12 @@ public class Objects.Filters.Pinboard : Objects.BaseObject {
4444
}
4545
}
4646

47-
public signal void pinboard_count_updated ();
47+
public signal void pinboard_count_updated (); // This is used in FilterPaneRow.vala:157 for updating the count label
48+
49+
private void update_pinboard_count () {
50+
_pinboard_count = Services.Store.instance ().get_items_pinned (false).size;
51+
pinboard_count_updated ();
52+
}
4853

4954
construct {
5055
name = ("Pinboard");
@@ -53,28 +58,27 @@ public class Objects.Filters.Pinboard : Objects.BaseObject {
5358
view_id = FilterType.PINBOARD.to_string ();
5459

5560
Services.Store.instance ().item_added.connect (() => {
56-
_pinboard_count = Services.Store.instance ().get_items_pinned (false).size;
57-
pinboard_count_updated ();
61+
update_pinboard_count ();
5862
});
5963

6064
Services.Store.instance ().item_deleted.connect (() => {
61-
_pinboard_count = Services.Store.instance ().get_items_pinned (false).size;
62-
pinboard_count_updated ();
65+
update_pinboard_count ();
6366
});
6467

6568
Services.Store.instance ().item_updated.connect (() => {
66-
_pinboard_count = Services.Store.instance ().get_items_pinned (false).size;
67-
pinboard_count_updated ();
69+
update_pinboard_count ();
6870
});
6971

7072
Services.Store.instance ().item_archived.connect (() => {
71-
_pinboard_count = Services.Store.instance ().get_items_pinned (false).size;
72-
pinboard_count_updated ();
73+
update_pinboard_count ();
7374
});
7475

7576
Services.Store.instance ().item_unarchived.connect (() => {
76-
_pinboard_count = Services.Store.instance ().get_items_pinned (false).size;
77-
pinboard_count_updated ();
77+
update_pinboard_count ();
78+
});
79+
80+
Services.Store.instance ().item_pin_change.connect (() => {
81+
update_pinboard_count ();
7882
});
7983
}
8084
}

core/Services/Store.vala

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -546,6 +546,9 @@ public class Services.Store : GLib.Object {
546546
if (Services.Database.get_default ().update_item (item)) {
547547
item_pin_change (item);
548548
item.pin_updated ();
549+
550+
item.updated ();
551+
item_updated (item, "");
549552
}
550553
}
551554

0 commit comments

Comments
 (0)