[Qt] polish ban table

This commit is contained in:
Philip Kaufmann
2015-06-23 21:10:42 +02:00
committed by Jonas Schnelli
parent 607809f037
commit 9e521c1735
3 changed files with 17 additions and 21 deletions

View File

@@ -56,11 +56,10 @@ public:
CCombinedBan *index(int idx)
{
if(idx >= 0 && idx < cachedBanlist.size()) {
if (idx >= 0 && idx < cachedBanlist.size())
return &cachedBanlist[idx];
} else {
return 0;
}
return 0;
}
};
@@ -124,7 +123,7 @@ QVariant BanTableModel::data(const QModelIndex &index, int role) const
}
} else if (role == Qt::TextAlignmentRole) {
if (index.column() == Bantime)
return (int)(Qt::AlignRight | Qt::AlignVCenter);
return (QVariant)(Qt::AlignRight | Qt::AlignVCenter);
}
return QVariant();
@@ -157,13 +156,8 @@ QModelIndex BanTableModel::index(int row, int column, const QModelIndex &parent)
CCombinedBan *data = priv->index(row);
if (data)
{
return createIndex(row, column, data);
}
else
{
return QModelIndex();
}
return QModelIndex();
}
void BanTableModel::refresh()