@@ -136,7 +136,7 @@ class AddressTablePriv
136136 const std::string& strName = item.second .name ;
137137
138138 uint creationTime = 0 ;
139- if (item.second .isReceivePurpose ())
139+ if (item.second .isReceivePurpose ())
140140 creationTime = static_cast <uint>(wallet->GetKeyCreationTime (address));
141141
142142 updatePurposeCachedCounted (item.second .purpose , true );
@@ -155,7 +155,8 @@ class AddressTablePriv
155155 std::sort (cachedAddressTable.begin (), cachedAddressTable.end (), AddressTableEntryLessThan ());
156156 }
157157
158- void updatePurposeCachedCounted (std::string purpose, bool add) {
158+ void updatePurposeCachedCounted (std::string purpose, bool add)
159+ {
159160 int *var = nullptr ;
160161 if (purpose == AddressBook::AddressBookPurpose::RECEIVE) {
161162 var = &recvNum;
@@ -242,17 +243,15 @@ class AddressTablePriv
242243 switch (status)
243244 {
244245 case CT_NEW:
245- if (inModel)
246- {
246+ if (inModel) {
247247 qWarning () << " AddressTablePriv_ZC::updateEntry : Warning: Got CT_NEW, but entry is already in model" ;
248248 }
249249 parent->beginInsertRows (QModelIndex (), lowerIndex, lowerIndex);
250250 cachedAddressTable.insert (lowerIndex, AddressTableEntry (newEntryType, isUsed, pubCoin, 0 ));
251251 parent->endInsertRows ();
252252 break ;
253253 case CT_UPDATED:
254- if (!inModel)
255- {
254+ if (!inModel) {
256255 qWarning () << " AddressTablePriv_ZC::updateEntry : Warning: Got CT_UPDATED, but entry is not in model" ;
257256 break ;
258257 }
@@ -261,30 +260,13 @@ class AddressTablePriv
261260 parent->emitDataChanged (lowerIndex);
262261 break ;
263262 }
264-
265- }
266-
267-
268- int size ()
269- {
270- return cachedAddressTable.size ();
271263 }
272264
273- int sizeSend (){
274- return sendNum;
275- }
276-
277- int sizeRecv (){
278- return recvNum;
279- }
280-
281- int sizeDell (){
282- return dellNum;
283- }
284-
285- int SizeColdSend () {
286- return coldSendNum;
287- }
265+ int size () { return cachedAddressTable.size (); }
266+ int sizeSend () { return sendNum; }
267+ int sizeRecv () { return recvNum; }
268+ int sizeDell () { return dellNum; }
269+ int SizeColdSend () { return coldSendNum; }
288270
289271 AddressTableEntry* index (int idx)
290272 {
@@ -320,20 +302,10 @@ int AddressTableModel::columnCount(const QModelIndex& parent) const
320302 return columns.length ();
321303}
322304
323- int AddressTableModel::sizeSend () const {
324- return priv->sizeSend ();
325- }
326- int AddressTableModel::sizeRecv () const {
327- return priv->sizeRecv ();
328- }
329-
330- int AddressTableModel::sizeDell () const {
331- return priv->sizeDell ();
332- }
333-
334- int AddressTableModel::sizeColdSend () const {
335- return priv->SizeColdSend ();
336- }
305+ int AddressTableModel::sizeSend () const { return priv->sizeSend (); }
306+ int AddressTableModel::sizeRecv () const { return priv->sizeRecv (); }
307+ int AddressTableModel::sizeDell () const { return priv->sizeDell (); }
308+ int AddressTableModel::sizeColdSend () const { return priv->SizeColdSend (); }
337309
338310QVariant AddressTableModel::data (const QModelIndex& index, int role) const
339311{
@@ -599,10 +571,11 @@ bool AddressTableModel::isWhitelisted(const std::string& address) const
599571 * Return last created unused address --> TODO: complete "unused" and "last".. basically everything..
600572 * @return
601573 */
602- QString AddressTableModel::getAddressToShow () const {
574+ QString AddressTableModel::getAddressToShow () const
575+ {
603576 QString addressStr;
604577 LOCK (wallet->cs_wallet );
605- if (!wallet->mapAddressBook .empty ()) {
578+ if (!wallet->mapAddressBook .empty ()) {
606579 for (auto it = wallet->mapAddressBook .rbegin (); it != wallet->mapAddressBook .rend (); ++it ) {
607580 if (it->second .purpose == AddressBook::AddressBookPurpose::RECEIVE) {
608581 const CBitcoinAddress &address = it->first ;
@@ -626,7 +599,8 @@ void AddressTableModel::emitDataChanged(int idx)
626599 Q_EMIT dataChanged (index (idx, 0 , QModelIndex ()), index (idx, columns.length () - 1 , QModelIndex ()));
627600}
628601
629- void AddressTableModel::notifyChange (const QModelIndex &_index) {
602+ void AddressTableModel::notifyChange (const QModelIndex &_index)
603+ {
630604 int idx = _index.row ();
631605 emitDataChanged (idx);
632606}
0 commit comments