diff options
author | Stig Bjørlykke <stig@bjorlykke.org> | 2015-11-23 09:22:55 +0100 |
---|---|---|
committer | Stig Bjørlykke <stig@bjorlykke.org> | 2015-11-23 08:26:18 +0000 |
commit | 280f0d1fb915dae09aa1662b37a00b7cd6a60317 (patch) | |
tree | 52da3be9330ab0a7a73020e650f2e3ce59c3344d | |
parent | e82c37ef4b76e818f82f0ad0db4d5518612da4f2 (diff) | |
download | wireshark-280f0d1fb915dae09aa1662b37a00b7cd6a60317.tar.gz |
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>
(cherry picked from commit 815b7fe728eadd15d9708afbc236b6399e4c46a0)
Reviewed-on: https://code.wireshark.org/review/12059
-rw-r--r-- | ui/qt/packet_list_model.cpp | 13 |
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() |