Changeset View
Changeset View
Standalone View
Standalone View
src/qt/recentrequeststablemodel.cpp
Show First 20 Lines • Show All 128 Lines • ▼ Show 20 Lines | QModelIndex RecentRequestsTableModel::index(int row, int column, | ||||
return createIndex(row, column); | return createIndex(row, column); | ||||
} | } | ||||
bool RecentRequestsTableModel::removeRows(int row, int count, | bool RecentRequestsTableModel::removeRows(int row, int count, | ||||
const QModelIndex &parent) { | const QModelIndex &parent) { | ||||
Q_UNUSED(parent); | Q_UNUSED(parent); | ||||
if (count > 0 && row >= 0 && (row + count) <= list.size()) { | if (count > 0 && row >= 0 && (row + count) <= list.size()) { | ||||
const RecentRequestEntry *rec; | |||||
for (int i = 0; i < count; ++i) { | for (int i = 0; i < count; ++i) { | ||||
rec = &list[row + i]; | const RecentRequestEntry *rec = &list[row + i]; | ||||
if (!walletModel->saveReceiveRequest( | if (!walletModel->saveReceiveRequest( | ||||
rec->recipient.address.toStdString(), rec->id, "")) | rec->recipient.address.toStdString(), rec->id, "")) { | ||||
return false; | return false; | ||||
} | } | ||||
} | |||||
beginRemoveRows(parent, row, row + count - 1); | beginRemoveRows(parent, row, row + count - 1); | ||||
list.erase(list.begin() + row, list.begin() + row + count); | list.erase(list.begin() + row, list.begin() + row + count); | ||||
endRemoveRows(); | endRemoveRows(); | ||||
return true; | return true; | ||||
} else { | } else { | ||||
return false; | return false; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 77 Lines • Show Last 20 Lines |