Commit Graph

20200 Commits

Author SHA1 Message Date
John Ralls
162605f505 Fix Windows binreloc executable finding.
Taking into account the behavior of
g_win32_get_package_installation_directory_of_module when the last
directory element either is or isn't "bin".
2018-09-16 12:36:04 -07:00
John Ralls
06d836e66b Fix cursor handling in the register.
Broken by over-aggressively capturing the selection.
2018-09-16 11:19:26 -07:00
Geert Janssens
5057703d30 Sql backend - show progress similar to how it's done for xml backend
That is let the percentage increase gradually. The current granularity is still
very rough, but at least it gives an indication of getting closer to fully
loading the data. The previous configuration on the other hand only suggested
something was happening but with no indication where in the load process
gnucash was.
2018-09-15 17:48:37 +02:00
Geert Janssens
5775662b52 Raise edit level of all accounts before loading transactions and splits
This prevents calling xaccAccountRecomputeBalanceInCurrency on each split that gets added,
which was exponentially increasing load times. On a huge test book the
load time dropped from 53 minutes to 1m20s.
2018-09-15 17:05:16 +02:00
Geert Janssens
221c46585c Sql backend - load transactions before business objects to reduce individual slot queries 2018-09-15 16:38:55 +02:00
Geert Janssens
5609b704c5 Fix memory leaks in GncQueryView 2018-09-14 16:38:35 +02:00
Geert Janssens
62eb95c05c Fix memory leaks in gncOwnerGetBalanceInCurrency 2018-09-14 11:34:45 +02:00
Geert Janssens
4e71629966 Fix memory leak in xaccTransRetDateDue 2018-09-14 10:47:31 +02:00
Geert Janssens
33fae41aaa Fix 1-byte memory leak on first run 2018-09-14 10:01:38 +02:00
Geert Janssens
ee77f38f40 Fix first run dialog not appearing 2018-09-13 21:13:54 +02:00
John Ralls
10a21cbfac Merge branch 'Bug794526' into maint 2018-09-11 10:46:02 -07:00
Geert Janssens
48b29f5e91 Fix memory leak in char* type KvpValue and fix improper uses
The core issue was that the delete visitor was never called because its parameter
type (char *) didn't match the boost::variant type (const char *).
Fixing the visitor's parameter type also require a const_cast
back to char * because that's what g_free takes as argument.

The rest of this commit is merely fixing KvpValue instantiations that
tried to create a char* KvpValue from a stack based const string instead
of a heap allocated one. That would bomb out on calling the
delete visitor.
2018-09-10 19:49:43 +02:00
Geert Janssens
b866d7d955 Plug memory leak in xaccSplitDestroy
Splits were not marked for deletion if the transaction is read-only
and the account is not marked for deletion yet. The net result is
that split will not be freed later on.
However xaccSplitDestroy is also called from a Transaction's do_destroy.
At that point accounts are not necessarily marked for deletion yet (like
is the case when a datafile is closed). This turned out to be a problem
for invoice post transactions (which are also read only) and hence
would cause memory to leak.
2018-09-10 18:57:39 +02:00
Geert Janssens
196decf649 Merge branch 'maint-fix-test-report-utilities' of https://github.com/christopherlam/gnucash into maint 2018-09-10 14:48:04 +02:00
Christopher Lam
4d57df2293 [test-report-utilities] changes to make tests locale independent
1. LC_ALL should set default-report-currency to USD
2. change test monetary output from list-of-strings '("$25.00") to
monetary pairs '(("USD" . 25)) which should be locale independent.
2018-09-10 20:09:45 +08:00
Geert Janssens
1117027f72 An empty GValue is interpreted as NULL reason, which is still a valid cache
Ignoring this would make caching almost useless as there are typically
only very few read-only transactions.
2018-09-10 10:24:49 +02:00
John Ralls
f219bc45aa Bug 794526 - Python bindings can't find loadable modules.
Always use absolute paths for configured directories (BINDIR etc.)
Abstract out the guts of gnc_gbr_find_foo_dir for foo in lib, bin, and data.
etc requires special handling because of the way it's treated if prefix
begins with /opt.

Always fall back on the configured directory if binreloc is disabled and
no default is passed in.
2018-09-09 16:36:39 -07:00
John Ralls
a19dcc7bd4 Fix crash when there's no TRANS_READ_ONLY_REASON slot.
Unsetting an empty g_value raises a fatal error, causing tests to fail
in some environments.

g_free() handles NULLs itself, no need to protect it.
2018-09-09 15:02:53 -07:00
Geert Janssens
b2d99615ab Fix if clause
Spotted by Kevin Hale Boyes
2018-09-09 23:36:41 +02:00
Geert Janssens
d069b67d48 Fix memory leak in xaccTransGetReadOnly
In addition implement a cache for this value as suggested in the comments
as this function is called on every transaction commit.
2018-09-09 22:50:05 +02:00
Geert Janssens
3634e8f59d Fix memory leak using qof_instance_get on a GncGUID
The underlying boxed type will return a copy so we should free this
when no longer needed.
2018-09-09 22:50:05 +02:00
Geert Janssens
3845611f30 Plug memory leak in register code
The table storing cell dimensions was never freed. The size of this table is
directly proportional to the number of cells in the register. So the more
transactions/splits in a register, the more memory was leaked - each time
a register was opened and closed. With my huge test book I saw leaks of
4Mb-10Mb per page that was opened/closed.
2018-09-09 22:50:05 +02:00
Geert Janssens
4cc61463ab Remove unused variable 2018-09-09 22:50:05 +02:00
John Ralls
bfa6cd52e8 Make selection caching uniform across gnucash-sheet functions.
Also make selection variable names consistent.
2018-09-09 12:36:32 -07:00
John Ralls
ef56e7cc76 Merge Bob Fewell's 'Bug796839' into maint. 2018-09-09 11:19:38 -07:00
John Ralls
f8a9be2c7f Merge Chris Lam's cleanup-report-utilities into maint. 2018-09-09 11:10:23 -07:00
John Ralls
f4c0544f1b Merge Chris Lam's 'test-report-utilities' into maint 2018-09-09 11:07:41 -07:00
Christopher Lam
c76ea30f3a [obsolete api] improve deprecation warnings 2018-09-09 22:17:29 +08:00
Christopher Lam
768ed09977 [report-utilities] remove (gnc:value-collector-*) functions
These functions are underused. Remove.
2018-09-09 22:17:29 +08:00
Christopher Lam
cb2fccf416 [report-utilities] remove (gnc-commodity-collector-*) functions
These functions are not actually exported in report-system.scm so they
are not generally available to external reports. It should mean
they're safe to remove.
2018-09-09 22:17:29 +08:00
Christopher Lam
4f90663c9a [report-utilities] rewrite list-set-safe! using named let
This avoids some set! calls
2018-09-09 22:17:29 +08:00
Christopher Lam
7a63fab04a [report-utilities] convert functions to srfi-1 2018-09-09 22:17:29 +08:00
Christopher Lam
0144055c43 [report-utilities] compact functions. no refactoring. 2018-09-09 22:17:29 +08:00
Christopher Lam
512dd7c73c [report-utilities] compact gnc:get-account-period-rolledup-budget-value 2018-09-09 22:17:29 +08:00
Christopher Lam
1808703354 [report-utilities] compact gnc:account-get-total-flow
This commit compacts function while maintaining legibility
2018-09-09 22:17:29 +08:00
Christopher Lam
b85f54a287 [report-utilities] commodity-collector: simplify 2018-09-09 22:17:29 +08:00
Christopher Lam
b21874df0b [obsolete api] gnc-commodity-numeric->string to gnc:monetary->string 2018-09-09 22:17:29 +08:00
Christopher Lam
cb01c93a0f [obsolete api] gnc-commodity-value->string to gnc:monetary->string 2018-09-09 22:17:29 +08:00
Christopher Lam
89f8c8dc12 [commodity|report-utilities] simplify functions, convert to srfi-1
these functions are not used elsewhere and should be inlined. however
they are exported and must be retained for now.
2018-09-09 22:17:29 +08:00
Christopher Lam
eac79bd506 [commodity-utilities] simplify boolean functions
(if a b #f) -> (and a b)
(if a a b)  -> (or a b)
2018-09-09 22:17:29 +08:00
Christopher Lam
353eee58cb [transaction] convert collector map to for-each
collectors are accumulator-type objects, being mutated with each call,
rather than functional objects. (map) is meant for functional
constructs, returning a list to current continuation. We're not using
the (map) output, so, change it to (for-each) to emphasise this.
2018-09-09 22:17:29 +08:00
Christopher Lam
83ad9e4b89 [transaction] convert add-split-row to functional style
This commit removes need for row-contents, building a list of
table-cells directly.
2018-09-09 22:17:29 +08:00
Christopher Lam
f3100ddc0a [transaction] convert add-subheading to functional style
This commit removes need for row-contents, building a list of
subheadings directly.
2018-09-09 22:17:29 +08:00
Christopher Lam
5163541666 [report] remove test-report-system-flag
This flag is not required if we test (gnucash-ui-is-running) instead.
2018-09-09 22:17:29 +08:00
Christopher Lam
3e8acf293d [test-report-utilities] structure must be retrieved dynamically 2018-09-09 22:14:15 +08:00
Christopher Lam
ec1536ad50 [test-report-utilities] encapsulate old test with teardown
Wrap old (test-account-get-trans-type-splits-interval) and clean up
environment with (teardown).
2018-09-09 22:14:15 +08:00
Christopher Lam
0b069900d0 [test-report-utilities] test account balances 2018-09-09 22:14:14 +08:00
Christopher Lam
125dcfb0ec [test-report-utilities] test list, monetary->str, commodity-collector
- list-set-safe
- gnc:monetary->string
- commodity-collector
2018-09-09 22:14:03 +08:00
Christopher Lam
88229370aa [test-report-utilities] convert to srfi-64 and augment tests 2018-09-09 19:22:37 +08:00
John Ralls
7e56a44f66 Remove deleted files from POTFILES.in 2018-09-08 15:08:39 -07:00