|
|
@ -1,4 +1,5 @@ |
|
|
|
#include "addresstablemodel.h" |
|
|
|
#include "addresstablemodel.h" |
|
|
|
|
|
|
|
#include "guiutil.h" |
|
|
|
#include "main.h" |
|
|
|
#include "main.h" |
|
|
|
|
|
|
|
|
|
|
|
const QString AddressTableModel::Send = "S"; |
|
|
|
const QString AddressTableModel::Send = "S"; |
|
|
@ -28,10 +29,6 @@ struct AddressTablePriv |
|
|
|
{ |
|
|
|
{ |
|
|
|
cachedAddressTable.clear(); |
|
|
|
cachedAddressTable.clear(); |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void updateAddressTable() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
CRITICAL_BLOCK(cs_mapKeys) |
|
|
|
CRITICAL_BLOCK(cs_mapKeys) |
|
|
|
CRITICAL_BLOCK(cs_mapAddressBook) |
|
|
|
CRITICAL_BLOCK(cs_mapAddressBook) |
|
|
|
{ |
|
|
|
{ |
|
|
@ -48,7 +45,6 @@ struct AddressTablePriv |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int size() |
|
|
|
int size() |
|
|
|
{ |
|
|
|
{ |
|
|
|
return cachedAddressTable.size(); |
|
|
|
return cachedAddressTable.size(); |
|
|
@ -108,6 +104,12 @@ QVariant AddressTableModel::data(const QModelIndex &index, int role) const |
|
|
|
case Address: |
|
|
|
case Address: |
|
|
|
return rec->address; |
|
|
|
return rec->address; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
} else if (role == Qt::FontRole) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if(index.column() == Address) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return bitcoinAddressFont(); |
|
|
|
|
|
|
|
} |
|
|
|
} else if (role == TypeRole) |
|
|
|
} else if (role == TypeRole) |
|
|
|
{ |
|
|
|
{ |
|
|
|
switch(rec->type) |
|
|
|
switch(rec->type) |
|
|
@ -146,3 +148,10 @@ QModelIndex AddressTableModel::index ( int row, int column, const QModelIndex & |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void AddressTableModel::updateList() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
/* Update internal model from Bitcoin core */ |
|
|
|
|
|
|
|
beginResetModel(); |
|
|
|
|
|
|
|
priv->refreshAddressTable(); |
|
|
|
|
|
|
|
endResetModel(); |
|
|
|
|
|
|
|
} |
|
|
|