summaryrefslogtreecommitdiff
path: root/src/journal.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-12 14:29:08 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-12 14:29:08 -0500
commitbfd9ecf2af079894f95bac365818c9548f561039 (patch)
treedce7e13ec7ad8f18bc628efe511d17e94bc3e16d /src/journal.cc
parenta034435c4287aba7fd32ed63a745e560350c924a (diff)
parent49a356f2d260ed0cc071ca1aa82027bd325b0b8b (diff)
downloadfork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.tar.gz
fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.tar.bz2
fork-ledger-bfd9ecf2af079894f95bac365818c9548f561039.zip
Merge branch 'next'
Diffstat (limited to 'src/journal.cc')
-rw-r--r--src/journal.cc29
1 files changed, 28 insertions, 1 deletions
diff --git a/src/journal.cc b/src/journal.cc
index b7ad9a23..2366ce30 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -126,16 +126,23 @@ bool journal_t::add_xact(xact_t * xact)
{
xact->journal = this;
- if (! xact->finalize() || ! xact_finalize_hooks.run_hooks(*xact)) {
+ if (! xact->finalize()) {
xact->journal = NULL;
return false;
}
+ extend_xact(xact);
xacts.push_back(xact);
return true;
}
+void journal_t::extend_xact(xact_base_t * xact)
+{
+ foreach (auto_xact_t * auto_xact, auto_xacts)
+ auto_xact->extend_xact(*xact);
+}
+
bool journal_t::remove_xact(xact_t * xact)
{
bool found = false;
@@ -204,6 +211,26 @@ std::size_t journal_t::read(const path& pathname,
return count;
}
+bool journal_t::has_xdata()
+{
+ foreach (xact_t * xact, xacts)
+ if (xact->has_xdata())
+ return true;
+
+ foreach (auto_xact_t * xact, auto_xacts)
+ if (xact->has_xdata())
+ return true;
+
+ foreach (period_xact_t * xact, period_xacts)
+ if (xact->has_xdata())
+ return true;
+
+ if (master->has_xdata() || master->children_with_xdata())
+ return true;
+
+ return false;
+}
+
void journal_t::clear_xdata()
{
foreach (xact_t * xact, xacts)