aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authordec05eba <dec05eba@protonmail.com>2020-11-05 17:56:12 +0100
committerdec05eba <dec05eba@protonmail.com>2020-11-05 17:56:12 +0100
commitc60c32a05c4632682c9e0de77909e897175cc9ac (patch)
treeb4e0de10d3ae4f10a398c9177dd18d9e57b76925 /src
parenta90f4e0b27ead8dc609522d772d6ede250b258dd (diff)
Asdf sorting
Diffstat (limited to 'src')
-rw-r--r--src/QuickMedia.cpp10
-rw-r--r--src/plugins/Matrix.cpp4
2 files changed, 4 insertions, 10 deletions
diff --git a/src/QuickMedia.cpp b/src/QuickMedia.cpp
index 9bb5231..937510c 100644
--- a/src/QuickMedia.cpp
+++ b/src/QuickMedia.cpp
@@ -982,14 +982,8 @@ namespace QuickMedia {
after_submit_handler();
if(tabs[selected_tab].page->clear_search_after_submit() && tabs[selected_tab].search_bar) {
- if(!tabs[selected_tab].search_bar->get_text().empty()) {
- tabs[selected_tab].search_bar->clear();
- tabs[selected_tab].search_bar->onTextUpdateCallback("");
- } else {
- int selected_item_index = tabs[selected_tab].body->get_selected_item();
- tabs[selected_tab].body->select_first_item();
- tabs[selected_tab].body->set_selected_item(selected_item_index, false);
- }
+ tabs[selected_tab].search_bar->clear();
+ tabs[selected_tab].search_bar->onTextUpdateCallback("");
}
if(tabs[selected_tab].page->is_single_page()) {
diff --git a/src/plugins/Matrix.cpp b/src/plugins/Matrix.cpp
index b99aa02..50296a8 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<std::mutex> lock(mutex);
-#if 1
+#if 0
BodyItem *room_body_item = static_cast<BodyItem*>(room->userdata);
int room_body_index = body->get_index_by_body_item(room_body_item);
if(room_body_index != -1) {