aboutsummaryrefslogtreecommitdiff
path: root/src/qt/recentrequeststablemodel.h
diff options
context:
space:
mode:
authorCozz Lovan <cozzlovan@yahoo.com>2014-01-14 05:05:43 +0100
committerCozz Lovan <cozzlovan@yahoo.com>2014-01-19 18:21:54 +0100
commit8476d5d407645229faf3017b390f041ce0666247 (patch)
tree3bd9c035a61b8f066b81662b0b77743eee995dfe /src/qt/recentrequeststablemodel.h
parentb10e147096b0e27fdff8c22029bc8b7a1a14f042 (diff)
downloadbitcoin-8476d5d407645229faf3017b390f041ce0666247.tar.xz
[Qt] Permanently store requested payments in wallet
Diffstat (limited to 'src/qt/recentrequeststablemodel.h')
-rw-r--r--src/qt/recentrequeststablemodel.h27
1 files changed, 26 insertions, 1 deletions
diff --git a/src/qt/recentrequeststablemodel.h b/src/qt/recentrequeststablemodel.h
index 3aab7b0a48..f939c76666 100644
--- a/src/qt/recentrequeststablemodel.h
+++ b/src/qt/recentrequeststablemodel.h
@@ -13,10 +13,32 @@
class CWallet;
-struct RecentRequestEntry
+class RecentRequestEntry
{
+public:
+ RecentRequestEntry() : nVersion(RecentRequestEntry::CURRENT_VERSION), id(0) { }
+
+ static const int CURRENT_VERSION=1;
+ int nVersion;
+ int64_t id;
QDateTime date;
SendCoinsRecipient recipient;
+
+ IMPLEMENT_SERIALIZE
+ (
+ RecentRequestEntry* pthis = const_cast<RecentRequestEntry*>(this);
+
+ unsigned int nDate = date.toTime_t();
+
+ READWRITE(pthis->nVersion);
+ nVersion = pthis->nVersion;
+ READWRITE(id);
+ READWRITE(nDate);
+ READWRITE(recipient);
+
+ if (fRead)
+ pthis->date = QDateTime::fromTime_t(nDate);
+ )
};
/** Model for list of recently generated payment requests / bitcoin URIs.
@@ -51,11 +73,14 @@ public:
const RecentRequestEntry &entry(int row) const { return list[row]; }
void addNewRequest(const SendCoinsRecipient &recipient);
+ void addNewRequest(const std::string &recipient);
+ void addNewRequest(RecentRequestEntry &recipient);
private:
WalletModel *walletModel;
QStringList columns;
QList<RecentRequestEntry> list;
+ int64_t nReceiveRequestsMaxId;
};
#endif