diff options
author | John Wiegley <johnw@newartisans.com> | 2009-02-04 20:55:40 -0400 |
---|---|---|
committer | John Wiegley <johnw@newartisans.com> | 2009-02-04 20:57:14 -0400 |
commit | 3f960be96c47cc976ed3a4d9e477325b6a3fcfb7 (patch) | |
tree | 2d0b5a844bc47ff3bb90797114f89531b933c982 | |
parent | 066aef6090d5801e9e8452692c2478320dad48d3 (diff) | |
download | fork-ledger-3f960be96c47cc976ed3a4d9e477325b6a3fcfb7.tar.gz fork-ledger-3f960be96c47cc976ed3a4d9e477325b6a3fcfb7.tar.bz2 fork-ledger-3f960be96c47cc976ed3a4d9e477325b6a3fcfb7.zip |
Removed all references to the old binary cache.
-rw-r--r-- | src/entry.cc | 11 | ||||
-rw-r--r-- | src/help.cc | 4 | ||||
-rw-r--r-- | src/item.h | 5 | ||||
-rw-r--r-- | src/journal.cc | 15 | ||||
-rw-r--r-- | src/ledger.h | 2 | ||||
-rw-r--r-- | src/quotes.cc | 1 | ||||
-rw-r--r-- | src/quotes.h | 7 | ||||
-rw-r--r-- | src/report.h | 8 | ||||
-rw-r--r-- | src/session.cc | 26 | ||||
-rw-r--r-- | src/session.h | 4 | ||||
-rw-r--r-- | src/work.cc | 12 |
11 files changed, 12 insertions, 83 deletions
diff --git a/src/entry.cc b/src/entry.cc index 815186f0..4309f9d9 100644 --- a/src/entry.cc +++ b/src/entry.cc @@ -52,14 +52,9 @@ entry_base_t::~entry_base_t() foreach (xact_t * xact, xacts) { // If the transaction is a temporary, it will be destructed when the - // temporary is. If it's from a binary cache, we can safely destruct it - // but its memory will be deallocated with the cache. - if (! xact->has_flags(ITEM_TEMP)) { - if (! xact->has_flags(ITEM_IN_CACHE)) - checked_delete(xact); - else - xact->~xact_t(); - } + // temporary is. + if (! xact->has_flags(ITEM_TEMP)) + checked_delete(xact); } } diff --git a/src/help.cc b/src/help.cc index 567f2562..060f5c3b 100644 --- a/src/help.cc +++ b/src/help.cc @@ -46,8 +46,6 @@ Basic options:\n\ -f, --file FILE read ledger data from FILE\n\ -o, --output FILE write output to FILE\n\ -i, --init-file FILE initialize ledger using FILE (default: ~/.ledgerrc)\n\ - --cache FILE use FILE as a binary cache when --file is not used\n\ - --no-cache don't use a cache, even if it would be appropriate\n\ -a, --account NAME use NAME for the default account (useful with QIF)\n\n\ Commands:\n\ balance [REGEXP]... show balance totals for matching accounts\n\ @@ -135,8 +133,6 @@ Basic options:\n\ -f, --file FILE read ledger data from FILE\n\ -o, --output FILE write output to FILE\n\ -i, --init-file FILE initialize ledger using FILE (default: ~/.ledgerrc)\n\ - --cache FILE use FILE as a binary cache when --file is not used\n\ - --no-cache don't use a cache, even if it would be appropriate\n\ -a, --account NAME use NAME for the default account (useful with QIF)\n\n\ Report filtering:\n\ -c, --current show only current and past entries (not future)\n\ @@ -60,9 +60,8 @@ class item_t : public supports_flags<>, public scope_t { public: #define ITEM_NORMAL 0x00 // no flags at all, a basic transaction -#define ITEM_IN_CACHE 0x01 // transaction allocated by the binary cache -#define ITEM_GENERATED 0x02 // transaction was not found in a journal -#define ITEM_TEMP 0x04 // transaction is a temporary object +#define ITEM_GENERATED 0x01 // transaction was not found in a journal +#define ITEM_TEMP 0x02 // transaction is a temporary object enum state_t { UNCLEARED = 0, CLEARED, PENDING }; diff --git a/src/journal.cc b/src/journal.cc index 403e7c81..37414fd5 100644 --- a/src/journal.cc +++ b/src/journal.cc @@ -44,22 +44,13 @@ journal_t::~journal_t() // accounts they refer to, because all accounts are about to // be deleted. foreach (entry_t * entry, entries) - if (! entry->has_flags(ITEM_IN_CACHE)) - checked_delete(entry); - else - entry->~entry_t(); + checked_delete(entry); foreach (auto_entry_t * entry, auto_entries) - if (! entry->has_flags(ITEM_IN_CACHE)) - checked_delete(entry); - else - entry->~auto_entry_t(); + checked_delete(entry); foreach (period_entry_t * entry, period_entries) - if (! entry->has_flags(ITEM_IN_CACHE)) - checked_delete(entry); - else - entry->~period_entry_t(); + checked_delete(entry); } void journal_t::add_account(account_t * acct) diff --git a/src/ledger.h b/src/ledger.h index 1d7bd512..6d0f2b4e 100644 --- a/src/ledger.h +++ b/src/ledger.h @@ -62,8 +62,6 @@ * * \section invoke_cmd Invoke the command object * - * \section write_cache Write out binary cache file, if necessary - * * \section shutdown Wrap up, closing everything and releasing memory */ #ifndef _LEDGER_H diff --git a/src/quotes.cc b/src/quotes.cc index ba885677..294d2093 100644 --- a/src/quotes.cc +++ b/src/quotes.cc @@ -87,7 +87,6 @@ void quotes_by_script::operator()(commodity_base_t& commodity, commodity.add_price(current_moment, price); commodity.history->last_lookup = current_moment; - cache_dirty = true; if (price && ! price_db.empty()) { #if defined(__GNUG__) && __GNUG__ < 3 diff --git a/src/quotes.h b/src/quotes.h index a18836f4..caf159ce 100644 --- a/src/quotes.h +++ b/src/quotes.h @@ -60,16 +60,13 @@ class quotes_by_script : public noncopyable, public commodity_t::base_t::updater { string price_db; std::size_t pricing_leeway; - bool& cache_dirty; quotes_by_script(); public: quotes_by_script(path _price_db, - std::size_t _pricing_leeway, - bool& _cache_dirty) - : price_db(_price_db), pricing_leeway(_pricing_leeway), - cache_dirty(_cache_dirty) { + std::size_t _pricing_leeway) + : price_db(_price_db), pricing_leeway(_pricing_leeway) { TRACE_CTOR(quotes_by_script, "path, std::size_t, bool&"); } ~quotes_by_script() throw() { diff --git a/src/report.h b/src/report.h index ff7d1343..f2e6626a 100644 --- a/src/report.h +++ b/src/report.h @@ -250,14 +250,6 @@ public: "The init file '" << path << "' does not exist or is not readable"); } - value_t option_cache(call_scope_t& args) { // : - config->cache_file = resolve_path(optarg); - } - - value_t option_no_cache(call_scope_t& args) { - config->cache_file = "<none>"; - } - value_t option_output(call_scope_t& args) { // o: if (std::string(optarg) != "-") { std::string path = resolve_path(optarg); diff --git a/src/session.cc b/src/session.cc index cbca106f..c646eab4 100644 --- a/src/session.cc +++ b/src/session.cc @@ -103,8 +103,6 @@ session_t::session_t() current_year(CURRENT_DATE().year()), download_quotes(false), - use_cache(true), - cache_dirty(false), #if 0 elision_style(ABBREVIATE), @@ -123,9 +121,8 @@ session_t::session_t() if (const char * home_var = std::getenv("HOME")) home = home_var; - init_file = home ? *home / ".ledgerrc" : "./.ledgerrc"; - price_db = home ? *home / ".pricedb" : "./.pricedb"; - cache_file = home ? *home / ".ledger-cache" : "./.ledger-cache"; + init_file = home ? *home / ".ledgerrc" : "./.ledgerrc"; + price_db = home ? *home / ".pricedb" : "./.pricedb"; register_parser(new textual_parser_t); @@ -205,21 +202,6 @@ std::size_t session_t::read_data(journal_t& journal, std::size_t entry_count = 0; - DEBUG("ledger.cache", "3. use_cache = " << use_cache); - - if (use_cache && cache_file) { - DEBUG("ledger.cache", "using_cache " << cache_file->string()); - cache_dirty = true; - if (exists(*cache_file)) { - push_variable<optional<path> > - save_price_db(journal.price_db, price_db); - - entry_count += read_journal(journal, *cache_file); - if (entry_count > 0) - cache_dirty = false; - } - } - if (entry_count == 0) { account_t * acct = journal.master; if (! master_account.empty()) @@ -230,17 +212,13 @@ std::size_t session_t::read_data(journal_t& journal, if (read_journal(journal, *journal.price_db)) { throw_(parse_error, "Entries not allowed in price history file"); } else { - DEBUG("ledger.cache", - "read price database " << journal.price_db->string()); journal.sources.pop_back(); } } foreach (const path& pathname, data_files) { - DEBUG("ledger.cache", "rejected cache, parsing " << pathname.string()); if (pathname == "-") { - use_cache = false; journal.sources.push_back("/dev/stdin"); // To avoid problems with stdin and pipes, etc., we read the entire diff --git a/src/session.h b/src/session.h index c7633a88..07b07dee 100644 --- a/src/session.h +++ b/src/session.h @@ -69,7 +69,6 @@ public: bool next_data_file_from_command_line; bool saw_data_file_from_command_line; optional<path> init_file; - optional<path> cache_file; optional<path> price_db; optional<path> pager_path; bool next_price_db_from_command_line; @@ -91,8 +90,6 @@ public: int current_year; bool download_quotes; - bool use_cache; - bool cache_dirty; format_t::elision_style_t elision_style; int abbrev_length; @@ -229,7 +226,6 @@ See LICENSE file included with the distribution for details and disclaimer."; if (next_data_file_from_command_line && ! saw_data_file_from_command_line) { data_files.clear(); - use_cache = false; saw_data_file_from_command_line = true; } data_files.push_back(args[0].as_string()); diff --git a/src/work.cc b/src/work.cc index 06dae001..e52618d7 100644 --- a/src/work.cc +++ b/src/work.cc @@ -110,18 +110,6 @@ strings_list read_command_arguments(report_t& report, strings_list args) void normalize_session_options(session_t& session) { - if (! session.cache_file) - session.use_cache = false; - - DEBUG("ledger.session.cache", "1. use_cache = " << session.use_cache); - - if (std::find(session.data_files.begin(), - session.data_files.end(), *session.cache_file) != - session.data_files.end()) - session.use_cache = false; - - DEBUG("ledger.session.cache", "2. use_cache = " << session.use_cache); - INFO("Initialization file is " << session.init_file->string()); INFO("Price database is " << session.price_db->string()); |