summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/account.cc14
-rw-r--r--src/account.h4
2 files changed, 15 insertions, 3 deletions
diff --git a/src/account.cc b/src/account.cc
index 710cabe1..33b1ebab 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -122,6 +122,20 @@ account_t * account_t::find_account_re(const string& regexp)
return find_account_re_(this, mask_t(regexp));
}
+void account_t::add_post(post_t * post)
+{
+ posts.push_back(post);
+
+ // Adding a new post changes the possible totals that may have been
+ // computed before.
+ if (xdata_) {
+ xdata_->self_details.gathered = false;
+ xdata_->self_details.calculated = false;
+ xdata_->family_details.gathered = false;
+ xdata_->family_details.calculated = false;
+ }
+}
+
bool account_t::remove_post(post_t * post)
{
assert(! posts.empty());
diff --git a/src/account.h b/src/account.h
index d22d2bb3..26ebe261 100644
--- a/src/account.h
+++ b/src/account.h
@@ -119,9 +119,7 @@ public:
(accounts.end(), bind(&accounts_map::value_type::second, _1));
}
- void add_post(post_t * post) {
- posts.push_back(post);
- }
+ void add_post(post_t * post);
bool remove_post(post_t * post);
posts_list::iterator posts_begin() {