diff --git a/src/qt/addressbookpage.h b/src/qt/addressbookpage.h --- a/src/qt/addressbookpage.h +++ b/src/qt/addressbookpage.h @@ -58,12 +58,15 @@ private Q_SLOTS: /** Delete currently selected address entry */ void on_deleteAddress_clicked(); - /** Create a new address for receiving coins and / or add a new address book - * entry */ + /** + * Create a new address for receiving coins and / or add a new address book + * entry. + */ void on_newAddress_clicked(); /** Copy address of currently selected address entry to clipboard */ void on_copyAddress_clicked(); - /** Copy label of currently selected address entry to clipboard (no button) + /** + * Copy label of currently selected address entry to clipboard (no button) */ void onCopyLabelAction(); /** Edit currently selected address entry (no button) */ diff --git a/src/qt/addressbookpage.cpp b/src/qt/addressbookpage.cpp --- a/src/qt/addressbookpage.cpp +++ b/src/qt/addressbookpage.cpp @@ -99,7 +99,9 @@ contextMenu->addAction(copyAddressAction); contextMenu->addAction(copyLabelAction); contextMenu->addAction(editAction); - if (tab == SendingTab) contextMenu->addAction(deleteAction); + if (tab == SendingTab) { + contextMenu->addAction(deleteAction); + } contextMenu->addSeparator(); // Connect signals for context menu actions @@ -123,7 +125,9 @@ void AddressBookPage::setModel(AddressTableModel *_model) { this->model = _model; - if (!_model) return; + if (!_model) { + return; + } proxyModel = new QSortFilterProxyModel(this); proxyModel->setSourceModel(_model); @@ -171,11 +175,17 @@ } void AddressBookPage::onEditAction() { - if (!model) return; + if (!model) { + return; + } - if (!ui->tableView->selectionModel()) return; + if (!ui->tableView->selectionModel()) { + return; + } QModelIndexList indexes = ui->tableView->selectionModel()->selectedRows(); - if (indexes.isEmpty()) return; + if (indexes.isEmpty()) { + return; + } EditAddressDialog dlg(tab == SendingTab ? EditAddressDialog::EditSendingAddress @@ -188,7 +198,9 @@ } void AddressBookPage::on_newAddress_clicked() { - if (!model) return; + if (!model) { + return; + } EditAddressDialog dlg(tab == SendingTab ? EditAddressDialog::NewSendingAddress @@ -202,7 +214,9 @@ void AddressBookPage::on_deleteAddress_clicked() { QTableView *table = ui->tableView; - if (!table->selectionModel()) return; + if (!table->selectionModel()) { + return; + } QModelIndexList indexes = table->selectionModel()->selectedRows(); if (!indexes.isEmpty()) { @@ -213,7 +227,9 @@ void AddressBookPage::selectionChanged() { // Set button states based on selected tab and selection QTableView *table = ui->tableView; - if (!table->selectionModel()) return; + if (!table->selectionModel()) { + return; + } if (table->selectionModel()->hasSelection()) { switch (tab) { @@ -239,7 +255,9 @@ void AddressBookPage::done(int retval) { QTableView *table = ui->tableView; - if (!table->selectionModel() || !table->model()) return; + if (!table->selectionModel() || !table->model()) { + return; + } // Figure out which address was selected, and return it QModelIndexList indexes = @@ -264,7 +282,9 @@ GUIUtil::getSaveFileName(this, tr("Export Address List"), QString(), tr("Comma separated file (*.csv)"), nullptr); - if (filename.isNull()) return; + if (filename.isNull()) { + return; + } CSVModelWriter writer(filename); diff --git a/src/qt/addresstablemodel.cpp b/src/qt/addresstablemodel.cpp --- a/src/qt/addresstablemodel.cpp +++ b/src/qt/addresstablemodel.cpp @@ -53,11 +53,11 @@ AddressTableEntry::Type addressType = AddressTableEntry::Hidden; // "refund" addresses aren't shown, and change addresses aren't in // mapAddressBook at all. - if (strPurpose == "send") + if (strPurpose == "send") { addressType = AddressTableEntry::Sending; - else if (strPurpose == "receive") + } else if (strPurpose == "receive") { addressType = AddressTableEntry::Receiving; - else if (strPurpose == "unknown" || strPurpose == "") { + } else if (strPurpose == "unknown" || strPurpose == "") { // if purpose not set, guess addressType = (isMine ? AddressTableEntry::Receiving : AddressTableEntry::Sending); @@ -175,7 +175,9 @@ } QVariant AddressTableModel::data(const QModelIndex &index, int role) const { - if (!index.isValid()) return QVariant(); + if (!index.isValid()) { + return QVariant(); + } AddressTableEntry *rec = static_cast(index.internalPointer()); @@ -212,7 +214,9 @@ bool AddressTableModel::setData(const QModelIndex &index, const QVariant &value, int role) { - if (!index.isValid()) return false; + if (!index.isValid()) { + return false; + } AddressTableEntry *rec = static_cast(index.internalPointer()); std::string strPurpose = @@ -275,7 +279,9 @@ } Qt::ItemFlags AddressTableModel::flags(const QModelIndex &index) const { - if (!index.isValid()) return 0; + if (!index.isValid()) { + return 0; + } AddressTableEntry *rec = static_cast(index.internalPointer()); diff --git a/src/qt/editaddressdialog.h b/src/qt/editaddressdialog.h --- a/src/qt/editaddressdialog.h +++ b/src/qt/editaddressdialog.h @@ -17,7 +17,8 @@ class QDataWidgetMapper; QT_END_NAMESPACE -/** Dialog for editing an address and associated information. +/** + * Dialog for editing an address and associated information. */ class EditAddressDialog : public QDialog { Q_OBJECT diff --git a/src/qt/editaddressdialog.cpp b/src/qt/editaddressdialog.cpp --- a/src/qt/editaddressdialog.cpp +++ b/src/qt/editaddressdialog.cpp @@ -45,7 +45,9 @@ void EditAddressDialog::setModel(AddressTableModel *_model) { this->model = _model; - if (!_model) return; + if (!_model) { + return; + } mapper->setModel(_model); mapper->addMapping(ui->labelEdit, AddressTableModel::Label); @@ -57,7 +59,9 @@ } bool EditAddressDialog::saveCurrentRow() { - if (!model) return false; + if (!model) { + return false; + } switch (mode) { case NewReceivingAddress: @@ -78,7 +82,9 @@ } void EditAddressDialog::accept() { - if (!model) return; + if (!model) { + return; + } if (!saveCurrentRow()) { switch (model->getEditStatus()) {