UI: TrafListModel: Simplify headerData()

This commit is contained in:
Nodir Temirkhodjaev 2023-05-10 13:34:39 +03:00
parent 05b8670e50
commit 96cd249c6f

View File

@ -117,7 +117,9 @@ int TrafListModel::columnCount(const QModelIndex &parent) const
QVariant TrafListModel::headerData(int section, Qt::Orientation orientation, int role) const
{
if (orientation == Qt::Horizontal && (role == Qt::DisplayRole || role == Qt::ToolTipRole)) {
const bool isDisplayRole = (role == Qt::DisplayRole || role == Qt::ToolTipRole);
if (orientation == Qt::Horizontal && isDisplayRole) {
switch (section) {
case 0:
return tr("Date");