MCPcopy Create free account
hub / github.com/ElementsProject/elements / removeRows

Method removeRows

src/qt/recentrequeststablemodel.cpp:144–164  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

142}
143
144bool RecentRequestsTableModel::removeRows(int row, int count, const QModelIndex &parent)
145{
146 Q_UNUSED(parent);
147
148 if(count > 0 && row >= 0 && (row+count) <= list.size())
149 {
150 for (int i = 0; i < count; ++i)
151 {
152 const RecentRequestEntry* rec = &list[row+i];
153 if (!walletModel->wallet().setAddressReceiveRequest(DecodeDestination(rec->recipient.address.toStdString()), ToString(rec->id), ""))
154 return false;
155 }
156
157 beginRemoveRows(parent, row, row + count - 1);
158 list.erase(list.begin() + row, list.begin() + row + count);
159 endRemoveRows();
160 return true;
161 } else {
162 return false;
163 }
164}
165
166Qt::ItemFlags RecentRequestsTableModel::flags(const QModelIndex &index) const
167{

Callers

nothing calls this directly

Calls 7

DecodeDestinationFunction · 0.85
ToStringFunction · 0.50
sizeMethod · 0.45
walletMethod · 0.45
eraseMethod · 0.45
beginMethod · 0.45

Tested by

no test coverage detected