Removed all references to the old binary cache.
This commit is contained in:
parent
066aef6090
commit
3f960be96c
11 changed files with 12 additions and 83 deletions
11
src/entry.cc
11
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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -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 };
|
||||
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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() {
|
||||
|
|
|
|||
|
|
@ -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);
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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());
|
||||
|
|
|
|||
12
src/work.cc
12
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());
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue