MCPcopy Create free account
hub / github.com/bitcoin/bitcoin / removeRows

Method removeRows

src/qt/recentrequeststablemodel.cpp:145–165  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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

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