Commit Graph

2052 Commits

Author SHA1 Message Date
John Ralls
7381887bfc Merge Vincent Dawan's 'bug798952-counters' into stable. 2023-06-20 11:02:17 -07:00
Vincent Dawans
b514245c22 Bug 798952 - Unable to set day threshold or counters in properties
Make sure counter values are retrieved as int; allow counter back
to zero; fix voucher default value.
2023-06-19 19:23:04 -07:00
Christopher Lam
b331ec974e [gnc-gsettings.cpp] plug a char* leak
full_name leaks if it's already in schema_hash hash table. It would be
better to convert GHashTable to unordered_map.
2023-06-20 09:21:49 +08:00
John Ralls
241aa1d2eb Merge Richard Cohen's 'remove-unneeded-memcpy' into stable. 2023-06-17 17:58:53 -07:00
John Ralls
aae568eca6 Add comment explaining "option.template get_value<int>()". 2023-06-17 16:58:03 -07:00
John Ralls
4dc8a7ee0d Bug 798952 - Unable to set day threshold or counters in properties
Make counters explicitly integer type and adjust the kvp load and save functions
to recognize that and behave accordingly so that other range options like day
threshold aren't affected.
2023-06-17 16:49:52 -07:00
John Ralls
827bfabd69 Merge Richard Cohen's 'declare-type-gnc-plugin' into stable. 2023-06-16 12:42:42 -07:00
Richard Cohen
3abc9a5558 Refactor: Remove some unnecessary uses of memcpy
- Also, remove unnecessary "static" in gnucash-style.c

The second one in guid.cpp is UB:

libgnucash/engine/guid.cpp:137:5: warning: undefined behavior, source object type 'const gnc::GUID' is not TriviallyCopyable [bugprone-undefined-memory-manipulation]
        memcpy (&target, &source, sizeof (GncGUID));
        ^
2023-06-15 11:10:58 +01:00
Christopher Lam
4a60e01fcd bugfix xaccTransGetTxnType: avoid returning TXN_TYPE_LINK incorrectly
A TXN_TYPE_PAYMENT will have non-APAR splits; a TXN_TYPE_LINK will not
have non-APAR splits. This bug manifests as a regular TXN_TYPE_PAYMENT
transaction being later voided being incorrectly changed to
TXN_TYPE_LINK.
2023-06-14 18:29:00 +08:00
Richard Cohen
1255d61917 Refactor: hide implementation of GncPlugin* (move from .h -> .c) 2023-06-14 11:03:37 +01:00
Richard Cohen
2e59bda951 Refactor: DECLARE_FINAL GncPluginExample < GncPlugin
- Fix the name
2023-06-14 11:03:37 +01:00
John Ralls
0d1ba1ebe7 Merge Richard Cohen's 'y2038-fixes' into stable. 2023-06-12 14:44:11 -07:00
Christopher Lam
8ec6a4cb12 [Scrub.c] 8628ca8715 rewritten to avoid QofQuery
because QofQuery will include the blank transaction which must not be
scrubbed.
2023-06-12 23:59:37 +08:00
Richard Cohen
7d26b8c05f Fail the test if still using 32bit time_t in 2038
gtest-gnc-option.cpp and gtest-gnc-optiondb.cpp need to call
time() for g_date_set_time_t()
2023-06-08 14:30:32 +01:00
Richard Cohen
d63248dad2 Update Y2038 comments 2023-06-08 14:30:28 +01:00
Christopher Lam
3ccb5c4896 Merge branch 'wordsmithing' into stable #1658 2023-06-07 22:00:06 +08:00
John Ralls
dda661cfd2 Merge Richard Cohen's 'more-define-types' into stable. 2023-06-06 21:27:36 -07:00
Christopher Lam
f580a6cf2d [gnc-ui-balances.c] better wording for balance limits 2023-06-07 08:49:01 +08:00
John Ralls
a5ff19b62a Merge Richard Cohen's 'fix-incorrect-logging-after-fallthrough' into stable. 2023-06-06 14:59:05 -07:00
Richard Cohen
6e5c525f77 Use gnc_time() instead of time() 2023-06-06 15:40:36 +01:00
Richard Cohen
fde90c4c99 Restore test-gnc-option
- removed in merge 3e5fcc8709

To get it to compile

- remove unused variables
- remove duplicate operator==(GncGUID)
2023-06-06 15:34:07 +01:00
Richard Cohen
a0fd9af394 Fix incorrect logging after switch fallthrough
oops
2023-06-06 15:16:39 +01:00
Christopher Lam
ccc75cfc88 Merge branch 'scrub-optimize' into stable 2023-06-04 07:58:31 +08:00
Christopher Lam
81902ba8bb [scrub.c] xaccTransScrubSplits calls Begin/Commit only if required 2023-06-02 18:01:08 +08:00
Christopher Lam
872e20c555 move xaccTransScrubSplits to Scrub.c
it's defined in Scrub.h anyway
2023-06-01 20:28:01 +08:00
Richard Cohen
680fe47bac Refactor: Remove unused macros GNC_BASIC_GOBJECT_* 2023-06-01 10:32:02 +01:00
Christopher Lam
9047156017 [Scrub.c] refactor xaccAccountTreeScrubOrphans 2023-05-31 19:34:28 +08:00
Christopher Lam
8628ca8715 [Scrub.c] refactor xaccAccountTreeScrubImbalance
The scrubbing routines are transaction oriented. Instead of
xaccAccountTreeScrubImbalance calling xaccAccountScrubImbalance for
each descendant, refactor so that the transaction list is generated
only once. The scrubbing is faster and progress bar is more accurate.
2023-05-31 09:26:58 +08:00
Christopher Lam
d214b2f05d Merge Vincent Dawans' branch 'bug798879' into stable #1617 2023-05-30 22:41:05 +08:00
Vincent Dawans
1c04e744d3 [trep-engine.scm] Rename "Totals" option to "Grand Total" 2023-05-29 20:01:11 -07:00
John Ralls
dd5be317d8 Merge Richard Cohen's 'define-type' into stable. 2023-05-27 10:09:05 -04:00
John Ralls
6111184c73 Ensure incorrectly coded counter KVP is read correctly.
Bug 798930 caused some counters to be saved as KVP double. If the
correct int64_t value isn't found when reading, or if a double is
encountered when loading the option dialog, get the double value
and cast it to int64_t.
2023-05-26 21:24:06 -04:00
John Ralls
7d5663899c Bug 798930 - invoices wont sequence to the next number
Because KVP can't magically cast between int64_t and double.
2023-05-26 20:41:13 -04:00
Richard Cohen
5d955654bc Refactor: DEFINE_TYPE GncSxInstanceModel < GObject 2023-05-26 13:34:09 +01:00
John Ralls
3d30e5978a Merge Richard Cohen's 'define-boxed' into stable. 2023-05-25 10:50:08 -04:00
Richard Cohen
ae9304efb0 Remove unused boxed type gnc_value_list 2023-05-25 14:42:28 +01:00
Richard Cohen
f9efbf86c6 Remove unused Qofbook::ab-templates property 2023-05-25 14:42:28 +01:00
John Ralls
8a5b3721df Merge Richard Cohen's 'remove-duplicate-define-type-code' into stable. 2023-05-24 11:25:16 -04:00
Mike Alexander
6bdaa161eb Redo 71afa3e0 and 71afa3e0 so powten(max_leg_digits) is 1e18
This is what it was before 71afa3e0.  This is the largest power of
ten that fits in an int64.
2023-05-22 15:24:26 -04:00
Christopher Lam
89f7e8933b gnc_list_all_paths returns std::vector instead of GList of EnvPaths
because its consumers are now cpp there's no need to return a GList.
2023-05-22 09:45:33 +08:00
Richard Cohen
2db5004a22 Remove code that duplicates features of G_DEFINE_TYPE
- declarations of *_init, *_class_init
- implementation of *_parent_class

- also, removed unnecessary NULL checks for destroy, dispose, finalize
2023-05-21 15:21:33 +01:00
Richard Cohen
eb2d5df778 Refactor: DEFINE_BOXED GncGUID 2023-05-21 15:20:18 +01:00
Richard Cohen
c514f61a7a Refactor: DEFINE_BOXED Time64 2023-05-21 15:20:18 +01:00
Richard Cohen
14f2efcfb7 Refactor: DEFINE_BOXED gnc_numeric 2023-05-21 15:20:18 +01:00
John Ralls
bba49a6d09 Fix test-gnc-euro failure.
Fixing the pow[] array required also adjusting the number of
denominator digits when converting doubles to gnc_numerics.
2023-05-19 20:14:58 -05:00
Mike Alexander
71afa3e0fc Make the GncNumeric string constructtor work for long decimal numbers.
It was failing to produce a correct representation for input with more than
14 digits after the decimal poin.  Fixes Bug 798916.  The bug was in
powten so this fix may corect other problems too.  For example conversion
of GncNumeric back to a string also failed in certain circumsances.
2023-05-18 17:42:44 -04:00
Mike Alexander
d61b962954 Fix a typo in some debug output. 2023-05-18 17:34:05 -04:00
John Ralls
8ccc6da87e Merge Richard Cohen's 'fix-test-engine-crash' into stable. 2023-05-17 21:20:44 -05:00
John Ralls
26162da450 Merge Richard Cohen's 'cleanup-build' into stable. 2023-05-17 21:16:09 -05:00
John Ralls
46e9fcf037 Merge Richard Cohen's 'cleanup-ui-files' into stable. 2023-05-17 12:18:54 -05:00