aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStig Bjørlykke <stig@bjorlykke.org>2015-11-23 09:22:55 +0100
committerStig Bjørlykke <stig@bjorlykke.org>2015-11-23 08:26:01 +0000
commit815b7fe728eadd15d9708afbc236b6399e4c46a0 (patch)
tree4042b6d517db1498d806e44cc05b6c404a9bf2c6
parented4e53a0e7702ed259f5590727feb3750a21c45b (diff)
Qt: Revert to more optimized code
Revert some changes in PacketListModel::headerData from c5fb4022 to preserve more optimized code. Change-Id: If708999a6d446d70eca7414670dec0c618190fe0 Reviewed-on: https://code.wireshark.org/review/12058 Reviewed-by: Stig Bjørlykke <stig@bjorlykke.org>
-rw-r--r--ui/qt/packet_list_model.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/ui/qt/packet_list_model.cpp b/ui/qt/packet_list_model.cpp
index 55fdf29494..6bfa98cca8 100644
--- a/ui/qt/packet_list_model.cpp
+++ b/ui/qt/packet_list_model.cpp
@@ -530,28 +530,25 @@ QVariant PacketListModel::data(const QModelIndex &d_index, int role) const
QVariant PacketListModel::headerData(int section, Qt::Orientation orientation,
int role) const
{
- QVariant data;
-
- if (!cap_file_) return data;
+ if (!cap_file_) return QVariant();
if (orientation == Qt::Horizontal && section < prefs.num_cols) {
switch (role) {
case Qt::DisplayRole:
- data = get_column_title(section);
- break;
+ return get_column_title(section);
case Qt::ToolTipRole:
{
gchar *tooltip = get_column_tooltip(section);
- data = tooltip;
+ QVariant data(tooltip);
g_free (tooltip);
- break;
+ return data;
}
default:
break;
}
}
- return data;
+ return QVariant();
}
void PacketListModel::flushVisibleRows()