summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2009-11-06 02:07:56 -0500
committerJohn Wiegley <johnw@newartisans.com>2009-11-06 02:07:56 -0500
commit05d0f1a17f9f4a9d659274d91dfb164055453637 (patch)
treeece58237ae3883aba0153ce32465acde09b2b4b5
parent61f7d1295fb427f75861e37856c3e403f7f98f39 (diff)
downloadfork-ledger-05d0f1a17f9f4a9d659274d91dfb164055453637.tar.gz
fork-ledger-05d0f1a17f9f4a9d659274d91dfb164055453637.tar.bz2
fork-ledger-05d0f1a17f9f4a9d659274d91dfb164055453637.zip
The binary cache is working again
-rw-r--r--src/journal.cc3
-rw-r--r--src/session.cc12
2 files changed, 3 insertions, 12 deletions
diff --git a/src/journal.cc b/src/journal.cc
index 31557635..3a4ada47 100644
--- a/src/journal.cc
+++ b/src/journal.cc
@@ -201,7 +201,8 @@ std::size_t journal_t::read(const path& pathname,
ifstream stream(filename);
std::size_t count = read(stream, filename, master, scope);
- sources.push_back(fileinfo_t(filename));
+ if (count > 0)
+ sources.push_back(fileinfo_t(filename));
return count;
}
diff --git a/src/session.cc b/src/session.cc
index afc092f1..0e03bbb3 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -75,7 +75,6 @@ session_t::session_t()
std::size_t session_t::read_data(const string& master_account)
{
bool populated_data_files = false;
- bool populated_price_db = false;
if (HANDLER(file_).data_files.empty()) {
path file;
@@ -101,15 +100,9 @@ std::size_t session_t::read_data(const string& master_account)
price_db_path = resolve_path(HANDLER(price_db_).str());
optional<archive_t> cache;
- if (HANDLED(cache_) && master_account.empty()) {
+ if (HANDLED(cache_) && master_account.empty())
cache = archive_t(HANDLED(cache_).str());
- if (price_db_path) {
- HANDLER(file_).data_files.push_back(*price_db_path);
- populated_price_db = true;
- }
- }
-
if (! (cache &&
cache->should_load(HANDLER(file_).data_files) &&
cache->load(journal))) {
@@ -118,7 +111,6 @@ std::size_t session_t::read_data(const string& master_account)
if (journal->read(*price_db_path) > 0)
throw_(parse_error, _("Transactions not allowed in price history file"));
}
- HANDLER(file_).data_files.remove(*price_db_path);
}
foreach (const path& pathname, HANDLER(file_).data_files) {
@@ -153,8 +145,6 @@ std::size_t session_t::read_data(const string& master_account)
if (populated_data_files)
HANDLER(file_).data_files.clear();
- else if (populated_price_db)
- HANDLER(file_).data_files.remove(*price_db_path);
VERIFY(journal->valid());