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) : GovernanceList::GovernanceList(QWidget* parent) :
QWidget(parent), QWidget(parent),
ui(new Ui::GovernanceList), ui(std::make_unique<Ui::GovernanceList>()),
clientModel(nullptr),
proposalModel(new ProposalModel(this)), proposalModel(new ProposalModel(this)),
proposalModelProxy(new QSortFilterProxyModel(this)), proposalModelProxy(new QSortFilterProxyModel(this)),
proposalContextMenu(new QMenu(this)), proposalContextMenu(new QMenu(this)),
@ -321,10 +320,7 @@ GovernanceList::GovernanceList(QWidget* parent) :
GUIUtil::updateFonts(); GUIUtil::updateFonts();
} }
GovernanceList::~GovernanceList() GovernanceList::~GovernanceList() = default;
{
delete ui;
}
void GovernanceList::setClientModel(ClientModel* model) void GovernanceList::setClientModel(ClientModel* model)
{ {

View File

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