From 16f70b9bb1faf48d985e21fcfa92d1934c2b50f5 Mon Sep 17 00:00:00 2001 From: Peter Wu Date: Wed, 21 Jun 2017 15:51:35 -0400 Subject: Qt: fix sorting of custom columns with multiple fields Fields like "dns.time || http.time || smb.time" were sorted by column number before. Recognize when all fields are numeric values and then try to sort by number and otherwise fallback to a value comparison. In theory sorting should now also be a bit faster for custom columns because the columnn type is looked up once. Change-Id: Id40d7cce8080d05823d74459fc493ec6ebf80956 Reported-by: Laura Chappell Reviewed-on: https://code.wireshark.org/review/22317 Petri-Dish: Peter Wu Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman --- ui/qt/packet_list_model.h | 2 ++ 1 file changed, 2 insertions(+) (limited to 'ui/qt/packet_list_model.h') diff --git a/ui/qt/packet_list_model.h b/ui/qt/packet_list_model.h index 3af6c60042..b6236e883a 100644 --- a/ui/qt/packet_list_model.h +++ b/ui/qt/packet_list_model.h @@ -106,6 +106,7 @@ private: int max_line_count_; static int sort_column_; + static int sort_column_is_numeric_; static int text_sort_column_; static Qt::SortOrder sort_order_; static capture_file *sort_cap_file_; @@ -114,6 +115,7 @@ private: QElapsedTimer *idle_dissection_timer_; int idle_dissection_row_; + bool isNumericColumn(int column); private slots: void emitItemHeightChanged(const QModelIndex &ih_index); -- cgit v1.2.3