RDB browser: mark waived items as unvisited initially

This commit is contained in:
Matthias Koefferlein 2024-04-28 18:50:53 +02:00
parent 9619081f84
commit 9fcd9d7616
1 changed files with 11 additions and 0 deletions

View File

@ -367,6 +367,7 @@ public:
{
mp_database = db;
m_waived_tag_id = mp_database ? mp_database->tags ().tag ("waived").id () : 0;
invalidate ();
}
@ -1888,6 +1889,16 @@ MarkerBrowserPage::set_rdb (rdb::Database *database)
rerun_button->setToolTip (QString ());
}
// mark items visited that carry the waived flag
if (mp_database) {
id_type waived_tag_id = mp_database->tags ().tag ("waived").id ();
for (auto i = mp_database->items ().begin (); i != mp_database->items ().end (); ++i) {
if (i->has_tag (waived_tag_id)) {
mp_database->set_item_visited (i.operator-> (), true);
}
}
}
QAbstractItemModel *tree_model = directory_tree->model ();
MarkerBrowserTreeViewModel *new_model = new MarkerBrowserTreeViewModel ();