Column visibility fixups.

Move visibility to its own method and call it when we show ourselves and
when we thaw.

Change-Id: I936cd33e5ccabddb32061ea347a465ac12f1be87
Reviewed-on: https://code.wireshark.org/review/2289
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2014-06-16 16:54:57 -07:00
parent 1567820a3a
commit 6c79a718ab
2 changed files with 15 additions and 5 deletions

View File

@ -422,6 +422,7 @@ void PacketList::showEvent (QShowEvent *event) {
}
setColumnWidth(i, col_width);
}
setColumnVisibility();
}
void PacketList::selectionChanged (const QItemSelection & selected, const QItemSelection & deselected) {
@ -564,6 +565,18 @@ void PacketList::setFrameReftime(gboolean set, frame_data *fdata)
updateAll();
}
void PacketList::setColumnVisibility()
{
if (!cap_file_) {
return;
}
for (int i = 0; i < cap_file_->cinfo.num_cols; i++) {
setColumnHidden(i, get_column_visible(i) ? false : true);
}
}
// Redraw the packet list and detail
void PacketList::updateAll() {
update();
@ -579,11 +592,6 @@ void PacketList::updateAll() {
}
packet_list_model_->resetColumns();
for (int i = 0; i < cap_file_->cinfo.num_cols; i++) {
setColumnHidden(i, !get_column_visible(i));
}
}
void PacketList::freeze()
@ -596,6 +604,7 @@ void PacketList::thaw()
{
setModel(packet_list_model_);
setUpdatesEnabled(true);
setColumnVisibility();
}
void PacketList::clear() {

View File

@ -73,6 +73,7 @@ private:
void setFrameMark(gboolean set, frame_data *fdata);
void setFrameIgnore(gboolean set, frame_data *fdata);
void setFrameReftime(gboolean set, frame_data *fdata);
void setColumnVisibility();
signals:
void packetDissectionChanged();