diff options
author | John Wiegley <johnw@newartisans.com> | 2009-11-06 15:35:16 -0500 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-11-06 15:35:16 -0500 |
commit | f03d386013f220e5b88a056c514c20319c83e9e7 (patch) | |
tree | 107234c2ca0947fac84be819611ff5c0c610dac6 /src/session.cc | |
parent | 312d4c5f5339c61253e86cd9ce825370eb4be053 (diff) | |
parent | 205639669981f1ab9dc355d07c60c123c4da0ca0 (diff) | |
download | fork-ledger-f03d386013f220e5b88a056c514c20319c83e9e7.tar.gz fork-ledger-f03d386013f220e5b88a056c514c20319c83e9e7.tar.bz2 fork-ledger-f03d386013f220e5b88a056c514c20319c83e9e7.zip |
Merge branch 'next'
Diffstat (limited to 'src/session.cc')
-rw-r--r-- | src/session.cc | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/session.cc b/src/session.cc index afc092f1..378d12c7 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()); @@ -166,8 +156,8 @@ void session_t::read_journal_files() INFO_START(journal, "Read journal file"); string master_account; - if (HANDLED(account_)) - master_account = HANDLER(account_).str(); + if (HANDLED(master_account_)) + master_account = HANDLER(master_account_).str(); std::size_t count = read_data(master_account); if (count == 0) @@ -197,9 +187,6 @@ option_t<session_t> * session_t::lookup_option(const char * p) case 'Z': OPT_CH(price_exp_); break; - case 'a': - OPT_(account_); // -a - break; case 'c': OPT(cache_); break; @@ -218,6 +205,9 @@ option_t<session_t> * session_t::lookup_option(const char * p) case 'l': OPT_ALT(price_exp_, leeway_); break; + case 'm': + OPT(master_account_); + break; case 'p': OPT(price_db_); else OPT(price_exp_); |