Commit Graph

20183 Commits

Author SHA1 Message Date
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
John Ralls
b05082a09d Merge Chris Lam's consolidated invoice report into maint. 2018-09-08 14:43:33 -07:00
John Ralls
1a7c5b9a32 Merge Christoff Holterman's Bug 796137 repair into maint. 2018-09-08 13:20:51 -07:00
Christoph Holtermann
3ab66623cd Bug 796137 - implement search_for as method of Python Query
The last three commits fix the main part of Bug 796137. An inconvenience
with GSList remains as for the moment qof_query_add_boolean_match only
accepts bytes as parameter and no strings. This still needs to be fixed.
2018-09-08 09:31:45 +02:00
Christoph Holtermann
6384854319 Bug 796137 - Fix QofIdType and QofIdTypeConst to work with python3
Patch by David Osguthorpe to provide typemaps so that SWIG doesn't
free buffers mem when buffer is saved as part of query struct leading
to garbage content. See https://bugs.gnucash.org/show_bug.cgi?id=796137
2018-09-08 09:31:45 +02:00
Christoph Holtermann
0551ee36e8 add option to exclude specified methods
an exclude option is being added to add_constructor_and_methods_with_prefix and
add_methods_with_prefix
2018-09-08 09:26:23 +02:00
Robert Fewell
6e023755dd Reduce the number of times the register loads - Update
In the previous update the changes to 'double_line mode' and 'register
style' were not catered for so this commit fixes that by using a stored
value 'enable_refresh' in the GncPluginPageRegister. This value is used
to enable/disable the triggering of gnc_ledger_display_refresh command
instead of passing a parameter as these settings are triggered by call
backs. The value is set to FALSE in ...recreate_page before restoring
all settings and subsequently set to TRUE after so normal refreshing
can occur. This reduces the potential number of refreshes on load from
7 to 2.
2018-09-07 20:05:16 +01:00
Robert Fewell
74f285d78c Bug 796839 - Find transaction won't filter on Date Posted
The results of the find are displayed in a search_ledger but with reset
filter settings. As part of the initial setup of the filter, the
SPLIT_RECONCILE and TRANS_DATE_POSTED parameters are purged from the
query and so if 'Date Posted' was used, all transactions were displayed
so this commit tests for a search_ledger and stops the purge along with
saving the query for subsequent use in the filter dialogue.
2018-09-07 19:32:43 +01:00
John Ralls
148f24135b Merge Bob Fewell's 'fixes9' into maint. 2018-09-06 15:30:47 -07:00
John Ralls
75ccd57dbf Bug 796734 - Auto-complete entry not highlighting to allow...
for incremental entry.

Because the Quartz Input Method module (imquartz.c) messes with the
selected text, so we cache it in the gnucash_sheet object and restore it
after the input module is done with the keypress.
2018-09-04 14:53:20 -07:00
Geert Janssens
f6d873dc27 Bug 796833 - Excel csv Format misprocessed
Convert all line ending styles to the one expected by the C++ standard
library before starting to parse a csv file.
2018-09-04 11:28:22 +02:00
Geert Janssens
e47b460acb Set toolbar buttons to show both icon and text
And make the icon small to recover some vertical screen estate.
The motivation for this is that Gtk has dropped the ability for users
to change a toolbar's appearance. And as our icons are often less
than descriptive many users benefit from having textual descriptions
as well. This is the best compromise we can make until the gui
gets an in-depth redesign.
2018-09-03 19:39:16 +02:00
Geert Janssens
705e866472 Bug 796054 follow up
Now that a separate wiki section has been written for the side effects of this bug
make the memo field of affected splits point to this wiki section.
2018-09-01 16:22:42 +02:00
Geert Janssens
d07f759ca3 Use alignment-safe buffer handling
Casting a char* to a struct containing a uint32_t is not universally safe
due to alignment constraints on reads on some platforms. Copy our possibly
unaligned source data into an aligned area of memory to avoid SIGBUS on
armhf.
Reported by vorlonofportland in PR#403. This commit the John's optimized
version of Vorlon's proposed fix.
2018-09-01 12:07:42 +02:00
Geert Janssens
4c87dd05ec Fix compiler warning issues
- add -Wno-deprecated-declarations to CXX_FLAGS as well. This was
  reported by vorlonofportland in PR#401 to become necessary for glib 2.58
  as that has deprecated g_type_class_add_private which appears in our
  c++ code.
- change -Wno-deprecated-register into -Wregister. The former appeared to
  be a clang dialect and alias for the latter (see
  https://github.com/Barro/compiler-warnings for an overview of clang
  and gcc warnings). It was moved to global CXX_FLAGS as it can only be
  added for g++.
2018-09-01 12:07:38 +02:00
Geert Janssens
bf00330eed Merge branch 'Bug796725' of https://github.com/Bob-IT/gnucash into maint 2018-08-31 23:55:01 +02:00
Geert Janssens
131df82135 Merge branch 'date-bugs' of https://github.com/Bob-IT/gnucash into maint 2018-08-31 22:01:45 +02:00
Geert Janssens
caaf9edc45 Use one single function to determine if an invoice is posted to ensure consistent behaviour
While debugging for bug 796054 I found cases where an invoice was unposted, but the toolbar
buttons and menu items were configured for a posted invoice. This should now be solved.
2018-08-31 20:58:36 +02:00