Skip to content

Commit 05b1360

Browse files
committed
[Trivial] Styling: spaces and brackets
1 parent 0b0c826 commit 05b1360

16 files changed

+579
-449
lines changed

src/qt/addresstablemodel.cpp

Lines changed: 19 additions & 45 deletions
Original file line numberDiff line numberDiff line change
@@ -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

338310
QVariant 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
}

src/qt/guiutil.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -120,11 +120,13 @@ CAmount parseValue(const QString& text, int displayUnit, bool* valid_out)
120120
return valid ? val : 0;
121121
}
122122

123-
QString formatBalance(CAmount amount, int nDisplayUnit, bool isZpiv){
123+
QString formatBalance(CAmount amount, int nDisplayUnit, bool isZpiv)
124+
{
124125
return (amount == 0) ? ("0.00 " + BitcoinUnits::name(nDisplayUnit, isZpiv)) : BitcoinUnits::floorHtmlWithUnit(nDisplayUnit, amount, false, BitcoinUnits::separatorAlways, true, isZpiv);
125126
}
126127

127-
bool requestUnlock(WalletModel* walletModel, AskPassphraseDialog::Context context, bool relock){
128+
bool requestUnlock(WalletModel* walletModel, AskPassphraseDialog::Context context, bool relock)
129+
{
128130
// Request unlock if wallet was locked or unlocked for mixing:
129131
WalletModel::EncryptionStatus encStatus = walletModel->getEncryptionStatus();
130132
if (encStatus == walletModel->Locked) {
@@ -284,11 +286,11 @@ void copyEntryData(QAbstractItemView* view, int column, int role)
284286

285287
QString getEntryData(QAbstractItemView *view, int column, int role)
286288
{
287-
if(!view || !view->selectionModel())
289+
if (!view || !view->selectionModel())
288290
return QString();
289291
QModelIndexList selection = view->selectionModel()->selectedRows(column);
290292

291-
if(!selection.isEmpty()) {
293+
if (!selection.isEmpty()) {
292294
// Return first item
293295
return (selection.at(0).data(role).toString());
294296
}
@@ -765,7 +767,7 @@ LSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef
765767
CFURLRef currentItemURL = NULL;
766768

767769
#if defined(MAC_OS_X_VERSION_MAX_ALLOWED) && MAC_OS_X_VERSION_MAX_ALLOWED >= 10100
768-
if(&LSSharedFileListItemCopyResolvedURL)
770+
if (&LSSharedFileListItemCopyResolvedURL)
769771
currentItemURL = LSSharedFileListItemCopyResolvedURL(item, resolutionFlags, NULL);
770772
#if defined(MAC_OS_X_VERSION_MIN_REQUIRED) && MAC_OS_X_VERSION_MIN_REQUIRED < 10100
771773
else
@@ -775,7 +777,7 @@ LSSharedFileListItemRef findStartupItemInList(LSSharedFileListRef list, CFURLRef
775777
LSSharedFileListItemResolve(item, resolutionFlags, &currentItemURL, NULL);
776778
#endif
777779

778-
if(currentItemURL && CFEqual(currentItemURL, findUrl)) {
780+
if (currentItemURL && CFEqual(currentItemURL, findUrl)) {
779781
// found
780782
CFRelease(currentItemURL);
781783
return item;

0 commit comments

Comments
 (0)