minor refactoring after #4351 (#4556)

This commit is contained in:
PastaPastaPasta 2021-11-01 06:30:18 -04:00 committed by GitHub
parent f0d49e4f69
commit ea4bd7193a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 9 deletions

View File

@ -275,8 +275,7 @@ const Proposal* ProposalModel::getProposalAt(const QModelIndex& index) const
GovernanceList::GovernanceList(QWidget* parent) :
QWidget(parent),
ui(new Ui::GovernanceList),
clientModel(nullptr),
ui(std::make_unique<Ui::GovernanceList>()),
proposalModel(new ProposalModel(this)),
proposalModelProxy(new QSortFilterProxyModel(this)),
proposalContextMenu(new QMenu(this)),
@ -321,10 +320,7 @@ GovernanceList::GovernanceList(QWidget* parent) :
GUIUtil::updateFonts();
}
GovernanceList::~GovernanceList()
{
delete ui;
}
GovernanceList::~GovernanceList() = default;
void GovernanceList::setClientModel(ClientModel* model)
{

View File

@ -43,7 +43,7 @@ public:
float paymentAmount() const;
QString url() const;
bool isActive() const;
QString votingStatus(const int nAbsVoteReq) const;
QString votingStatus(int nAbsVoteReq) const;
int GetAbsoluteYesCount() const;
void openUrl() const;
@ -96,9 +96,9 @@ public:
void setClientModel(ClientModel* clientModel);
private:
ClientModel* clientModel;
ClientModel* clientModel{nullptr};
Ui::GovernanceList* ui;
std::unique_ptr<Ui::GovernanceList> ui;
ProposalModel* proposalModel;
QSortFilterProxyModel* proposalModelProxy;