mirror of
https://github.com/feather-wallet/feather.git
synced 2024-12-22 11:39:25 +00:00
refactor: misc cleanup
This commit is contained in:
parent
d68fbce9e1
commit
91ff2bc7f0
12 changed files with 19 additions and 82 deletions
2
monero
2
monero
|
@ -1 +1 @@
|
|||
Subproject commit 4e02392274e1b5f7a038171deee2e445128b2e35
|
||||
Subproject commit 31ced6d76a1aaa1bfb9011c86987937b7042f3ce
|
|
@ -18,8 +18,4 @@ CalcWindow::CalcWindow(QWidget *parent)
|
|||
this->setWindowIcon(icons()->icon("gnome-calc.png"));
|
||||
}
|
||||
|
||||
void CalcWindow::closeEvent(QCloseEvent *foo) {
|
||||
emit closed();
|
||||
}
|
||||
|
||||
CalcWindow::~CalcWindow() = default;
|
|
@ -18,14 +18,9 @@ public:
|
|||
explicit CalcWindow(QWidget *parent = nullptr);
|
||||
~CalcWindow() override;
|
||||
|
||||
signals:
|
||||
void closed();
|
||||
|
||||
private:
|
||||
void closeEvent(QCloseEvent *bar) override;
|
||||
|
||||
private:
|
||||
QScopedPointer<Ui::CalcWindow> ui;
|
||||
};
|
||||
|
||||
#endif // FEATHER_CALCWINDOW_H
|
||||
|
||||
|
|
|
@ -13,17 +13,20 @@ class Transfer : public QObject
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit Transfer(uint64_t _amount, QString _address, QObject *parent = 0)
|
||||
: QObject(parent), m_amount(_amount), m_address(std::move(_address)) {};
|
||||
private:
|
||||
friend class TransactionInfo;
|
||||
friend class ConstructionInfo;
|
||||
quint64 m_amount;
|
||||
QString m_address;
|
||||
public:
|
||||
explicit Transfer(uint64_t amount, QString address, QObject *parent = nullptr)
|
||||
: QObject(parent)
|
||||
, m_amount(amount)
|
||||
, m_address(std::move(address)) {};
|
||||
|
||||
quint64 amount() const { return m_amount; }
|
||||
QString address() const { return m_address; }
|
||||
|
||||
private:
|
||||
friend class TransactionInfo;
|
||||
friend class ConstructionInfo;
|
||||
|
||||
quint64 m_amount;
|
||||
QString m_address;
|
||||
};
|
||||
|
||||
#endif // TRANSACTIONINFO_H
|
||||
#endif // TRANSFER_H
|
||||
|
|
|
@ -3,18 +3,6 @@
|
|||
|
||||
#include "SubaddressRow.h"
|
||||
|
||||
bool SubaddressRow::setHidden(bool hidden) {
|
||||
m_hidden = hidden;
|
||||
}
|
||||
|
||||
bool SubaddressRow::setUsed(bool used) {
|
||||
m_used = used;
|
||||
}
|
||||
|
||||
bool SubaddressRow::setPinned(bool pinned) {
|
||||
m_used = pinned;
|
||||
}
|
||||
|
||||
qsizetype SubaddressRow::getRow() const {
|
||||
return m_row;
|
||||
}
|
||||
|
|
|
@ -19,10 +19,6 @@ public:
|
|||
, m_used(used)
|
||||
, m_hidden(hidden)
|
||||
, m_pinned(pinned) {}
|
||||
|
||||
bool setUsed(bool used);
|
||||
bool setHidden(bool hidden);
|
||||
bool setPinned(bool pinned);
|
||||
|
||||
qsizetype getRow() const;
|
||||
const QString& getAddress() const;
|
||||
|
|
|
@ -145,17 +145,6 @@ QString TransactionRow::paymentId() const
|
|||
return m_paymentId;
|
||||
}
|
||||
|
||||
QString TransactionRow::destinations_formatted() const
|
||||
{
|
||||
QString destinations;
|
||||
for (auto const& t: m_transfers) {
|
||||
if (!destinations.isEmpty())
|
||||
destinations += "<br> ";
|
||||
destinations += WalletManager::displayAmount(t->amount()) + ": " + t->address();
|
||||
}
|
||||
return destinations;
|
||||
}
|
||||
|
||||
QList<QString> TransactionRow::destinations() const
|
||||
{
|
||||
QList<QString> dests;
|
||||
|
|
|
@ -42,24 +42,18 @@ public:
|
|||
quint64 confirmations() const;
|
||||
quint64 confirmationsRequired() const;
|
||||
quint64 unlockTime() const;
|
||||
//! transaction_id
|
||||
QString hash() const;
|
||||
QDateTime timestamp() const;
|
||||
QString date() const;
|
||||
QString time() const;
|
||||
QString paymentId() const;
|
||||
//! only applicable for output transactions
|
||||
//! used in tx details popup
|
||||
QList<QString> destinations() const;
|
||||
QString destinations_formatted() const;
|
||||
QList<Transfer*> transfers() const;
|
||||
QString rings_formatted() const;
|
||||
|
||||
private:
|
||||
explicit TransactionRow();
|
||||
|
||||
// TransactionRow(const Monero::TransactionInfo *pimpl, QObject *parent = nullptr);
|
||||
|
||||
private:
|
||||
friend class TransactionHistory;
|
||||
mutable QList<Transfer*> m_transfers;
|
||||
|
|
|
@ -11,19 +11,11 @@ AddressBookModel::AddressBookModel(QObject *parent, AddressBook *addressBook)
|
|||
, m_addressBook(addressBook)
|
||||
, m_showFullAddresses(false)
|
||||
{
|
||||
connect(m_addressBook, &AddressBook::refreshStarted, this, &AddressBookModel::startReset);
|
||||
connect(m_addressBook, &AddressBook::refreshFinished, this, &AddressBookModel::endReset);
|
||||
connect(m_addressBook, &AddressBook::refreshStarted, this, &AddressBookModel::beginResetModel);
|
||||
connect(m_addressBook, &AddressBook::refreshFinished, this, &AddressBookModel::endResetModel);
|
||||
m_contactIcon = icons()->icon("person.svg");
|
||||
}
|
||||
|
||||
void AddressBookModel::startReset(){
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void AddressBookModel::endReset(){
|
||||
endResetModel();
|
||||
}
|
||||
|
||||
int AddressBookModel::rowCount(const QModelIndex &) const
|
||||
{
|
||||
return m_addressBook->count();
|
||||
|
|
|
@ -30,17 +30,13 @@ public:
|
|||
Qt::ItemFlags flags(const QModelIndex &index) const override;
|
||||
bool setData(const QModelIndex &index, const QVariant &value, int role) override;
|
||||
|
||||
Q_INVOKABLE bool deleteRow(int row);
|
||||
bool deleteRow(int row);
|
||||
|
||||
bool isShowFullAddresses() const;
|
||||
void setShowFullAddresses(bool show);
|
||||
bool writeCSV(const QString &path);
|
||||
QMap<QString, QString> readCSV(const QString &path);
|
||||
|
||||
public slots:
|
||||
void startReset();
|
||||
void endReset();
|
||||
|
||||
private:
|
||||
AddressBook * m_addressBook;
|
||||
QIcon m_contactIcon;
|
||||
|
|
|
@ -17,16 +17,8 @@ SubaddressModel::SubaddressModel(QObject *parent, Subaddress *subaddress)
|
|||
: QAbstractTableModel(parent)
|
||||
, m_subaddress(subaddress)
|
||||
{
|
||||
connect(m_subaddress, &Subaddress::refreshStarted, this, &SubaddressModel::startReset);
|
||||
connect(m_subaddress, &Subaddress::refreshFinished, this, &SubaddressModel::endReset);
|
||||
}
|
||||
|
||||
void SubaddressModel::startReset(){
|
||||
beginResetModel();
|
||||
}
|
||||
|
||||
void SubaddressModel::endReset(){
|
||||
endResetModel();
|
||||
connect(m_subaddress, &Subaddress::refreshStarted, this, &SubaddressModel::beginResetModel);
|
||||
connect(m_subaddress, &Subaddress::refreshFinished, this, &SubaddressModel::endResetModel);
|
||||
}
|
||||
|
||||
int SubaddressModel::rowCount(const QModelIndex &parent) const
|
||||
|
|
|
@ -42,10 +42,6 @@ public:
|
|||
|
||||
void setCurrentSubaddressAccount(quint32 accountIndex);
|
||||
|
||||
public slots:
|
||||
void startReset();
|
||||
void endReset();
|
||||
|
||||
private:
|
||||
Subaddress *m_subaddress;
|
||||
QVariant parseSubaddressRow(const SubaddressRow &subaddress, const QModelIndex &index, int role) const;
|
||||
|
|
Loading…
Reference in a new issue