From a90f4e0b27ead8dc609522d772d6ede250b258dd Mon Sep 17 00:00:00 2001 From: dec05eba Date: Thu, 5 Nov 2020 16:46:06 +0100 Subject: Do not sort rooms after navigating back --- src/plugins/Matrix.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/plugins') diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp index e085912..b99aa02 100644 --- a/src/plugins/Matrix.cpp +++ b/src/plugins/Matrix.cpp @@ -469,7 +469,7 @@ namespace QuickMedia { void MatrixRoomsPage::on_navigate_to_page(Body *body) { if(search_bar) body->filter_search_fuzzy(search_bar->get_text()); - sort_room_body_items(body->items); + //sort_room_body_items(body->items); } void MatrixRoomsPage::update() { @@ -521,7 +521,7 @@ namespace QuickMedia { // Swap order of rooms in body list to put rooms with mentions at the top and then unread messages and then all the other rooms // TODO: Optimize with hash map instead of linear search? or cache the index std::lock_guard lock(mutex); -#if 0 +#if 1 BodyItem *room_body_item = static_cast(room->userdata); int room_body_index = body->get_index_by_body_item(room_body_item); if(room_body_index != -1) { @@ -574,7 +574,7 @@ namespace QuickMedia { Body *body_ptr = body.get(); TagData &tag_data = tag_body_items_by_name[url]; body->items = tag_data.room_body_items; - //sort_room_body_items(body->items); + sort_room_body_items(body->items); auto search_bar = create_search_bar("Search...", SEARCH_DELAY_FILTER); auto rooms_page = std::make_unique(program, body_ptr, tag_data.tag_item->get_title(), this, search_bar.get()); rooms_page->matrix_delegate = matrix_delegate; -- cgit v1.2.3