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>
This commit is contained in:
Stig Bjørlykke 2015-11-23 09:22:55 +01:00
parent ed4e53a0e7
commit 815b7fe728
1 changed files with 5 additions and 8 deletions

View File

@ -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()