--- a/straw/model/__init__.py +++ b/straw/model/__init__.py @@ -202,6 +202,10 @@ class Category(Node): def on_unread_count_changed(self, obj, old_value, delta): self.props.unread_count += delta + def mark_items_as_read(self): + for child in self.children: + child.mark_items_as_read() + class Feed(Node): """ Represents a feed - a node that can contain items. Feeds cannot have @@ -269,6 +273,11 @@ class Feed(Node): else: self.props.unread_count += 1 + def mark_items_as_read(self): + debug(self.items) + for item in self.items: + item.props.is_read = True + class Item(GObject): persistent_properties = [ "id", "title", "feed_id", "is_read", "link", "pub_date", "description" ] persistent_table = "items"