diff options
author | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-12-18 07:26:45 +0100 |
---|---|---|
committer | Wladimir J. van der Laan <laanwj@gmail.com> | 2013-12-18 07:27:05 +0100 |
commit | 97203994a41fd52cefeecd30cab40bebfb9f3bbd (patch) | |
tree | 7c4e4110f53a563e899386442061109b4cdfafcb | |
parent | c8af33aa7568c450edffe15c4863895c20bac54f (diff) | |
parent | 7df07b3f456958288fe6787be6bee503d5dbb034 (diff) |
Merge pull request #3381
7df07b3 [Qt] fix RecentRequestsTableModel function ambiuguity (Philip Kaufmann)
-rw-r--r-- | src/qt/recentrequeststablemodel.cpp | 14 | ||||
-rw-r--r-- | src/qt/recentrequeststablemodel.h | 6 |
2 files changed, 14 insertions, 6 deletions
diff --git a/src/qt/recentrequeststablemodel.cpp b/src/qt/recentrequeststablemodel.cpp index 06f64af146..86c29dd02b 100644 --- a/src/qt/recentrequeststablemodel.cpp +++ b/src/qt/recentrequeststablemodel.cpp @@ -3,13 +3,16 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include "recentrequeststablemodel.h" -#include "guiutil.h" + #include "bitcoinunits.h" +#include "guiutil.h" #include "optionsmodel.h" -RecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel *parent): +RecentRequestsTableModel::RecentRequestsTableModel(CWallet *wallet, WalletModel *parent) : walletModel(parent) { + Q_UNUSED(wallet); + /* These columns must match the indices in the ColumnIndex enumeration */ columns << tr("Date") << tr("Label") << tr("Message") << tr("Amount"); } @@ -22,12 +25,14 @@ RecentRequestsTableModel::~RecentRequestsTableModel() int RecentRequestsTableModel::rowCount(const QModelIndex &parent) const { Q_UNUSED(parent); + return list.length(); } int RecentRequestsTableModel::columnCount(const QModelIndex &parent) const { Q_UNUSED(parent); + return columns.length(); } @@ -88,12 +93,15 @@ QVariant RecentRequestsTableModel::headerData(int section, Qt::Orientation orien QModelIndex RecentRequestsTableModel::index(int row, int column, const QModelIndex &parent) const { - return createIndex(row, column, 0); + Q_UNUSED(parent); + + return createIndex(row, column); } bool RecentRequestsTableModel::removeRows(int row, int count, const QModelIndex &parent) { Q_UNUSED(parent); + if(count > 0 && row >= 0 && (row+count) <= list.size()) { beginRemoveRows(parent, row, row + count - 1); diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h index d00a2a9055..3aab7b0a48 100644 --- a/src/qt/recentrequeststablemodel.h +++ b/src/qt/recentrequeststablemodel.h @@ -5,12 +5,12 @@ #ifndef RECENTREQUESTSTABLEMODEL_H #define RECENTREQUESTSTABLEMODEL_H +#include "walletmodel.h" + #include <QAbstractTableModel> #include <QStringList> #include <QDateTime> -#include "walletmodel.h" - class CWallet; struct RecentRequestEntry @@ -27,7 +27,7 @@ class RecentRequestsTableModel: public QAbstractTableModel Q_OBJECT public: - explicit RecentRequestsTableModel(CWallet *wallet, WalletModel *parent = 0); + explicit RecentRequestsTableModel(CWallet *wallet, WalletModel *parent); ~RecentRequestsTableModel(); enum ColumnIndex { |