diff options
author | Gerald Combs <gerald@wireshark.org> | 2015-09-11 14:20:06 -0700 |
---|---|---|
committer | Gerald Combs <gerald@wireshark.org> | 2015-09-13 18:52:19 +0000 |
commit | 565a953f24a8d9b327fde05549e27a7b0372b0b9 (patch) | |
tree | 3593ed66861b5aee3eb809247c95acd423f0a2ba | |
parent | fccfbf254e8b26a622420813a26b31edece343ca (diff) |
Don't invalidate the column cache when we filter packets.
Limit PacketListModel::recreateVisibleRows to checking for packets that
passed the display filter. Remove the call to resetColumns, which
invalidates the column string cache.
Call PacketListModel::resetColumns from PacketList::columnsChanged.
Along with invalidating the column string cache, this triggers a widget
update which means we shouldn't need to call recreateVisibleRows or
redrawVisiblePackets. Remove them.
Change-Id: Ic25f139e2c2f8cdebb2a868ccda7eb4127a3013c
Ping-Bug: 11324
Ping-Bug: 11514
Reviewed-on: https://code.wireshark.org/review/10491
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot <buildbot-no-reply@wireshark.org>
Reviewed-by: Pascal Quantin <pascal.quantin@gmail.com>
Reviewed-by: Gerald Combs <gerald@wireshark.org>
-rw-r--r-- | ui/qt/packet_list.cpp | 4 | ||||
-rw-r--r-- | ui/qt/packet_list_model.cpp | 5 |
2 files changed, 3 insertions, 6 deletions
diff --git a/ui/qt/packet_list.cpp b/ui/qt/packet_list.cpp index 492f65cffc..4e5bd43b72 100644 --- a/ui/qt/packet_list.cpp +++ b/ui/qt/packet_list.cpp @@ -636,10 +636,9 @@ void PacketList::columnsChanged() prefs.num_cols = g_list_length(prefs.col_list); col_cleanup(&cap_file_->cinfo); build_column_format_array(&cap_file_->cinfo, prefs.num_cols, FALSE); - packet_list_model_->recreateVisibleRows(); // Calls PacketListRecord::resetColumns setColumnVisibility(); create_far_overlay_ = true; - redrawVisiblePackets(); + packet_list_model_->resetColumns(); } // Fields have changed, update custom columns @@ -648,6 +647,7 @@ void PacketList::fieldsChanged(capture_file *cf) prefs.num_cols = g_list_length(prefs.col_list); col_cleanup(&cf->cinfo); build_column_format_array(&cf->cinfo, prefs.num_cols, FALSE); + // call packet_list_model_->resetColumns() ? } // Column widths should diff --git a/ui/qt/packet_list_model.cpp b/ui/qt/packet_list_model.cpp index 5b10900158..404dda58ab 100644 --- a/ui/qt/packet_list_model.cpp +++ b/ui/qt/packet_list_model.cpp @@ -93,11 +93,8 @@ guint PacketListModel::recreateVisibleRows() beginResetModel(); visible_rows_.clear(); number_to_row_.clear(); - if (cap_file_) { - PacketListRecord::resetColumns(&cap_file_->cinfo); - } - endResetModel(); + beginInsertRows(QModelIndex(), pos, pos); foreach (record, physical_rows_) { if (record->frameData()->flags.passed_dfilter || record->frameData()->flags.ref_time) { |