Changeset View
Changeset View
Standalone View
Standalone View
src/qt/recentrequeststablemodel.cpp
Show First 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | int RecentRequestsTableModel::columnCount(const QModelIndex &parent) const { | ||||
return columns.length(); | return columns.length(); | ||||
} | } | ||||
QVariant RecentRequestsTableModel::data(const QModelIndex &index, | QVariant RecentRequestsTableModel::data(const QModelIndex &index, | ||||
int role) const { | int role) const { | ||||
if (!index.isValid() || index.row() >= list.length()) return QVariant(); | if (!index.isValid() || index.row() >= list.length()) return QVariant(); | ||||
const RecentRequestEntry *rec = &list[index.row()]; | |||||
if (role == Qt::DisplayRole || role == Qt::EditRole) { | if (role == Qt::DisplayRole || role == Qt::EditRole) { | ||||
const RecentRequestEntry *rec = &list[index.row()]; | |||||
switch (index.column()) { | switch (index.column()) { | ||||
case Date: | case Date: | ||||
return GUIUtil::dateTimeStr(rec->date); | return GUIUtil::dateTimeStr(rec->date); | ||||
case Label: | case Label: | ||||
if (rec->recipient.label.isEmpty() && role == Qt::DisplayRole) { | if (rec->recipient.label.isEmpty() && role == Qt::DisplayRole) { | ||||
return tr("(no label)"); | return tr("(no label)"); | ||||
} else { | } else { | ||||
return rec->recipient.label; | return rec->recipient.label; | ||||
▲ Show 20 Lines • Show All 167 Lines • Show Last 20 Lines |