diff options
Diffstat (limited to 'ui/qt/models/packet_list_record.cpp')
-rw-r--r-- | ui/qt/models/packet_list_record.cpp | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/ui/qt/models/packet_list_record.cpp b/ui/qt/models/packet_list_record.cpp index c5bc05b741..9be07c1035 100644 --- a/ui/qt/models/packet_list_record.cpp +++ b/ui/qt/models/packet_list_record.cpp @@ -46,6 +46,26 @@ PacketListRecord::~PacketListRecord() col_text_.clear(); } +void PacketListRecord::ensureColorized(capture_file *cap_file) +{ + // packet_list_store.c:packet_list_get_value + Q_ASSERT(fdata_); + + if (!cap_file) { + return; + } + + // + // XXX - do we need to check whether the data versions match? + // If the record's color is already correct, we shouldn't need + // to redissect it to colorize it. + // + bool dissect_color = !colorized_ || ( color_ver_ != rows_color_ver_ ); + if (data_ver_ != col_data_ver_ || dissect_color) { + dissect(cap_file, dissect_color); + } +} + // We might want to return a const char * instead. This would keep us from // creating excessive QByteArrays, e.g. in PacketListModel::recordLessThan. const QString PacketListRecord::columnString(capture_file *cap_file, int column, bool colorized) @@ -57,6 +77,11 @@ const QString PacketListRecord::columnString(capture_file *cap_file, int column, return QString(); } + // + // XXX - do we still need to check the colorization, given that we now + // have the ensureColorized() method to ensure that the record is + // properly colorized? + // bool dissect_color = ( colorized && !colorized_ ) || ( color_ver_ != rows_color_ver_ ); if (column >= col_text_.count() || col_text_.at(column).isNull() || data_ver_ != col_data_ver_ || dissect_color) { dissect(cap_file, dissect_color); |