summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/account.cc16
-rw-r--r--src/entry.cc11
-rw-r--r--src/format.cc2
-rw-r--r--src/session.cc10
4 files changed, 11 insertions, 28 deletions
diff --git a/src/account.cc b/src/account.cc
index f1ac713e..5f131fe1 100644
--- a/src/account.cc
+++ b/src/account.cc
@@ -175,19 +175,13 @@ expr_t::ptr_op_t account_t::lookup(const string& name)
case 'd':
if (name == "depth")
return WRAP_FUNCTOR(get_wrapper<&get_depth>);
+ else if (name == "depth_spacer")
+ return WRAP_FUNCTOR(get_wrapper<&get_depth_spacer>);
break;
- case 'f':
- if (name.find("fmt_") == 0) {
- switch (name[4]) {
- case '_':
- return WRAP_FUNCTOR(get_wrapper<&get_depth_spacer>);
- case 'T':
- return WRAP_FUNCTOR(get_wrapper<&get_total>);
- case 'a':
- return WRAP_FUNCTOR(get_wrapper<&get_partial_name>);
- }
- }
+ case 'p':
+ if (name == "partial_account")
+ return WRAP_FUNCTOR(get_wrapper<&get_partial_name>);
break;
case 't':
diff --git a/src/entry.cc b/src/entry.cc
index fb90dfa9..a66b8852 100644
--- a/src/entry.cc
+++ b/src/entry.cc
@@ -430,17 +430,6 @@ expr_t::ptr_op_t entry_t::lookup(const string& name)
return WRAP_FUNCTOR(get_wrapper<&get_date>);
break;
- case 'f':
- if (name.find("fmt_") == 0) {
- switch (name[4]) {
- case 'D':
- return WRAP_FUNCTOR(get_wrapper<&get_date>);
- case 'P':
- return WRAP_FUNCTOR(get_wrapper<&get_payee>);
- }
- }
- break;
-
case 'p':
if (name[1] == '\0' || name == "payee")
return WRAP_FUNCTOR(get_wrapper<&get_payee>);
diff --git a/src/format.cc b/src/format.cc
index d0037927..e63627f4 100644
--- a/src/format.cc
+++ b/src/format.cc
@@ -237,7 +237,7 @@ format_t::element_t * format_t::parse_elements(const string& fmt)
buf[0] = *p;
buf[1] = '\0';
current->chars = buf;
- current->expr.parse(string("fmt_") + *p);
+ current->expr.parse(buf);
break;
}
}
diff --git a/src/session.cc b/src/session.cc
index 74dd13e6..6bcca89a 100644
--- a/src/session.cc
+++ b/src/session.cc
@@ -71,17 +71,17 @@ void release_session_context()
session_t::session_t()
: register_format
- ("%-.9D %-.20P %-.23A %!12(print_balance(fmt_t, 12, 67)) "
- "%!12(print_balance(fmt_T, 12, 80, true))\n%/"
- "%31|%-.23A %!12(print_balance(fmt_t, 12, 67)) "
- "%!12(print_balance(fmt_T, 12, 80, true))\n"),
+ ("%-.9(date) %-.20(payee) %-.23(account) %!12(print_balance(amount_expr, 12, 67)) "
+ "%!12(print_balance(total_expr, 12, 80, true))\n%/"
+ "%31|%-.23(account) %!12(print_balance(amount_expr, 12, 67)) "
+ "%!12(print_balance(total_expr, 12, 80, true))\n"),
wide_register_format
("%-.9D %-.35P %-.39A %22.108t %!22.132T\n%/"
"%48|%-.38A %22.108t %!22.132T\n"),
print_format
("%(date)%(cleared ? \" *\" : (uncleared ? \"\" : \" !\"))%(code ? \" (\" + code + \")\" : \"\") %(payee)\n %-34(account) %12(amount)\n%/ %-34(account) %12(amount)%(note ? \" ; \" + note : \"\")\n"),
balance_format
- ("%20T %_%-a\n"),
+ ("%20(total_expr) %(depth_spacer)%-(partial_account)\n"),
equity_format
("\n%D %Y%C%P\n%/ %-34W %12t\n"),
plot_amount_format