Commit Graph

27775 Commits

Author SHA1 Message Date
John Ralls
08d083e8e1 Merge Richard Cohen's 'fix-memory-errors' into stable. 2023-06-20 12:13:45 -07:00
John Ralls
7381887bfc Merge Vincent Dawan's 'bug798952-counters' into stable. 2023-06-20 11:02:17 -07:00
Richard Cohen
3c0b051ab0 Valgrind: fix "Mismatched free/delete" for gnc_print_time64, qof_print_date
... when called from guile e.g. test-transaction and lots of other tests

- gchar will also get the char* typemap, by typedef reduction

==119964== Mismatched free() / delete / delete []
==119964==    at 0x4847A1F: operator delete[](void*) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==119964==    by 0x669F3E4: _wrap_gnc_print_time64(scm_unused_struct*, scm_unused_struct*) (swig-engine.cpp:38533)
...

==119948== Mismatched free() / delete / delete []
==119948==    at 0x4847A1F: operator delete[](void*) (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==119948==    by 0x6F6B431: _wrap_qof_print_date(scm_unused_struct*) (swig-engine.cpp:39124)
...
2023-06-20 10:20:44 +01:00
Richard Cohen
958e9a4d6f Valgrind: fix "Invalid read" in test-exp-parser
The pointer passed to the gfec exception handler is
not valid after the exception handler ends

==382525== Invalid read of size 1
==382525==    at 0x484B050: memcpy@GLIBC_2.2.5 (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==382525==    by 0x531AB67: __printf_buffer_write (Xprintf_buffer_write.c:39)
==382525==    by 0x5322CD4: __printf_buffer (vfprintf-process-arg.c:501)
==382525==    by 0x53465F3: __vasprintf_internal (vasprintf.c:102)
==382525==    by 0x499C8C1: g_vasprintf (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==382525==    by 0x4969BE0: g_strdup_vprintf (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==382525==    by 0x494B2F6: g_logv (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==382525==    by 0x494B7A2: g_log (in /usr/lib/x86_64-linux-gnu/libglib-2.0.so.0.7600.1)
==382525==    by 0x4862862: func_op (gnc-exp-parser.c:342)
==382525==    by 0x485D381: primary_exp (expression_parser.c:1222)
==382525==    by 0x485CE0F: multiply_divide_op (expression_parser.c:1028)
==382525==    by 0x485CC33: add_sub_op (expression_parser.c:968)
==382525==  Address 0xad387ec is 764 bytes inside a block of size 766 free'd
==382525==    at 0x484620F: free (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==382525==    by 0x4861D9B: gfec_apply (gfec.c:145)
==382525==    by 0x4862813: func_op (gnc-exp-parser.c:339)
==382525==    by 0x485D381: primary_exp (expression_parser.c:1222)
==382525==    by 0x485CE0F: multiply_divide_op (expression_parser.c:1028)
==382525==    by 0x485CC33: add_sub_op (expression_parser.c:968)
==382525==    by 0x485C9DE: assignment_op (expression_parser.c:886)
==382525==    by 0x485C101: parse_string (expression_parser.c:605)
==382525==    by 0x4862F07: gnc_exp_parser_parse_separate_vars (gnc-exp-parser.c:535)
==382525==    by 0x4862D60: gnc_exp_parser_parse (gnc-exp-parser.c:475)
==382525==    by 0x10A963: run_parser_test (test-exp-parser.c:94)
==382525==    by 0x10AB99: run_parser_tests (test-exp-parser.c:144)
==382525==  Block was alloc'd at
==382525==    at 0x4843738: malloc (in /usr/libexec/valgrind/vgpreload_memcheck-amd64-linux.so)
==382525==    by 0x4A81473: scm_realloc (in /usr/lib/x86_64-linux-gnu/libguile-3.0.so.1.5.0)
==382525==    by 0x4AEEF70: scm_to_utf8_stringn (in /usr/lib/x86_64-linux-gnu/libguile-3.0.so.1.5.0)
==382525==    by 0x55AA71F: gnc_scm_to_utf8_string (gnc-guile-utils.c:42)
==382525==    by 0x4861D4E: gfec_apply (gfec.c:136)
==382525==    by 0x4862813: func_op (gnc-exp-parser.c:339)
==382525==    by 0x485D381: primary_exp (expression_parser.c:1222)
==382525==    by 0x485CE0F: multiply_divide_op (expression_parser.c:1028)
==382525==    by 0x485CC33: add_sub_op (expression_parser.c:968)
==382525==    by 0x485C9DE: assignment_op (expression_parser.c:886)
==382525==    by 0x485C101: parse_string (expression_parser.c:605)
==382525==    by 0x4862F07: gnc_exp_parser_parse_separate_vars (gnc-exp-parser.c:535)
2023-06-20 10:20:44 +01: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
16640be62f Reapply most norwegian-bokmal translations from Rune Osnes.
Removing the ones that only removed an accelerator mark ('_').
2023-06-19 11:45:47 -07:00
John Ralls
72c907bc9a Msgmerge updated potfile for GnuCash 5.2. 2023-06-18 13:46:08 -07:00
John Ralls
67e42af370 Merge latest translations from Weblate. 2023-06-18 13:26:11 -07:00
gallegonovato
4066e30a19
Translation update by gallegonovato <fran-carro@hotmail.es> using Weblate
po/es.po: 100.0% (5499 of 5499 strings; 0 fuzzy)
3 failing checks (0.1%)
Translation: GnuCash/Program (Spanish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/es/

Co-authored-by: gallegonovato <fran-carro@hotmail.es>
2023-06-18 03:26:27 +02:00
Andrea Andre
99778c85b4
Translation update by Andrea Andre <andrea.tsg19@slmail.me> using Weblate
po/ro.po: 47.7% (2627 of 5499 strings; 1937 fuzzy)
766 failing checks (13.9%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Translation update  by Andrea Andre <andrea.tsg19@slmail.me> using Weblate

po/ro.po: 47.6% (2619 of 5499 strings; 1942 fuzzy)
769 failing checks (13.9%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Translation update  by Andrea Andre <andrea.tsg19@slmail.me> using Weblate

po/ro.po: 47.6% (2618 of 5499 strings; 1943 fuzzy)
769 failing checks (13.9%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Co-authored-by: Andrea Andre <andrea.tsg19@slmail.me>
2023-06-18 03:26:27 +02:00
John Ralls
69682c68ad Merge Simon Arlott's 'authors' into stable. 2023-06-17 18:26:05 -07: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
39ed069f52 Fix crash in report options reported on IRC.
Commit 5ea2e4e7 removed the init of info.priv without substituting one for
info.view.
2023-06-17 15:30:42 -07:00
Simon Arlott
24c09b4be8
Add myself to AUTHORS 2023-06-17 21:21:01 +01:00
John Ralls
8a4b4f6c7f Revert "Translation update by Rune Osnes <osnes.rune@gmail.com> using Weblate"
This reverts commit 661855e3e3.
2023-06-16 14:55:28 -07:00
John Ralls
2c4a096b9c Revert "Translation update by Rune Osnes <osnes.rune@gmail.com> using Weblate"
This reverts commit 8e18cde7f0 because a
substantial number of the changes were only removing accelerator marks.
2023-06-16 14:47:32 -07:00
John Ralls
0c6ae19c16 Merge Richard Cohen's 'remove-gnc-define-type' into stable. 2023-06-16 12:55:10 -07:00
John Ralls
827bfabd69 Merge Richard Cohen's 'declare-type-gnc-plugin' into stable. 2023-06-16 12:42:42 -07:00
John Ralls
915e95e553 Merge Richard Cohwn's 'declare-type-gnc-tree-view' into stable. 2023-06-16 12:41:26 -07:00
John Ralls
eee5f674c4 Merge Richard Cohen's 'declare-type-gnc-tree-model' into stable. 2023-06-16 12:40:29 -07:00
John Ralls
48cf3a9a32 Merge Richard Cohen's 'declare-type-gncsearch' into stable. 2023-06-16 12:39:20 -07:00
John Ralls
2e58dd83b7 Merge latest translations from Weblate. 2023-06-16 12:13:02 -07:00
Francisco Serrador
d5a28e5170
Translation update by Francisco Serrador <fserrador@gmail.com> using Weblate
po/glossary/es.po: 100.0% (222 of 222 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Spanish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/es/

Translation update  by Francisco Serrador <fserrador@gmail.com> using Weblate

po/es.po: 99.9% (5498 of 5499 strings; 1 fuzzy)
3 failing checks (0.1%)
Translation: GnuCash/Program (Spanish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/es/

Translation update  by Francisco Serrador <fserrador@gmail.com> using Weblate

po/es.po: 100.0% (5499 of 5499 strings; 0 fuzzy)
2 failing checks (0.1%)
Translation: GnuCash/Program (Spanish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/es/

Co-authored-by: Francisco Serrador <fserrador@gmail.com>
2023-06-16 19:50:40 +02:00
Jaime Marquínez Ferrándiz
0394abfb8b
Translation update by Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net> using Weblate
po/es.po: 100.0% (5499 of 5499 strings; 0 fuzzy)
2 failing checks (0.1%)
Translation: GnuCash/Program (Spanish)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/es/

Co-authored-by: Jaime Marquínez Ferrándiz <jaime.marquinez.ferrandiz@fastmail.net>
2023-06-16 19:50:39 +02:00
Gaël CATLLA
3d1c7fb2fa
Translation update by Gaël CATLLA <gcatlla@free.fr> using Weblate
po/fr.po: 95.0% (5227 of 5499 strings; 165 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Translation update  by Gaël CATLLA <gcatlla@free.fr> using Weblate

po/fr.po: 95.0% (5227 of 5499 strings; 147 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Translation update  by Gaël CATLLA <gcatlla@free.fr> using Weblate

po/fr.po: 94.6% (5203 of 5499 strings; 170 fuzzy)
34 failing checks (0.6%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Co-authored-by: Gaël CATLLA <gcatlla@free.fr>
2023-06-16 19:50:39 +02:00
Andrea Andre
ff988b5567
Translation update by Andrea Andre <andrea.tsg19@slmail.me> using Weblate
po/ro.po: 47.4% (2611 of 5499 strings; 1949 fuzzy)
774 failing checks (14.0%)
Translation: GnuCash/Program (Romanian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/ro/

Co-authored-by: Andrea Andre <andrea.tsg19@slmail.me>
2023-06-16 19:50:38 +02:00
Geza Kiss
0823202ee9
Translation update by Geza Kiss <geza.openstreetmap@reallymymail.com> using Weblate
po/hu.po: 69.7% (3833 of 5499 strings; 614 fuzzy)
1 failing checks (0.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Co-authored-by: Geza Kiss <geza.openstreetmap@reallymymail.com>
2023-06-16 19:50:37 +02:00
Rauno Ots
33eab18343
Translation update by Rauno Ots <rots00@gmail.com> using Weblate
po/et.po: 10.7% (590 of 5499 strings; 105 fuzzy)
20 failing checks (0.3%)
Translation: GnuCash/Program (Estonian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/et/

Translation update  by Rauno Ots <rots00@gmail.com> using Weblate

po/et.po: 10.4% (575 of 5499 strings; 105 fuzzy)
20 failing checks (0.3%)
Translation: GnuCash/Program (Estonian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/et/

Co-authored-by: Rauno Ots <rots00@gmail.com>
2023-06-16 19:50:36 +02:00
Vincent Dawans
e69b89a106
Translation update by Vincent Dawans <dawansv@gmail.com> using Weblate
po/fr.po: 94.6% (5204 of 5499 strings; 169 fuzzy)
33 failing checks (0.6%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Translation update  by Vincent Dawans <dawansv@gmail.com> using Weblate

po/fr.po: 94.2% (5181 of 5499 strings; 189 fuzzy)
34 failing checks (0.6%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Translation update  by Vincent Dawans <dawansv@gmail.com> using Weblate

po/fr.po: 94.0% (5171 of 5499 strings; 199 fuzzy)
34 failing checks (0.6%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Translation update  by Vincent Dawans <dawansv@gmail.com> using Weblate

po/glossary/fr.po: 100.0% (216 of 216 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/fr/

Translation update  by Vincent Dawans <dawansv@gmail.com> using Weblate

po/fr.po: 93.7% (5158 of 5499 strings; 212 fuzzy)
36 failing checks (0.6%)
Translation: GnuCash/Program (French)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/fr/

Co-authored-by: Vincent Dawans <dawansv@gmail.com>
2023-06-16 19:50:36 +02:00
Christian Wehling
7387800841
Translation update by Christian Wehling <christian.wehling@web.de> using Weblate
po/de.po: 100.0% (5499 of 5499 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (German)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/de/

Co-authored-by: Christian Wehling <christian.wehling@web.de>
2023-06-16 19:50:35 +02:00
Rune Osnes
8e18cde7f0
Translation update by Rune Osnes <osnes.rune@gmail.com> using Weblate
po/nb.po: 87.6% (4819 of 5499 strings; 680 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/glossary/nb.po: 100.0% (216 of 216 strings; 0 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Glossary (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/glossary/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 83.6% (4602 of 5499 strings; 714 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 83.6% (4602 of 5499 strings; 714 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 79.5% (4372 of 5499 strings; 816 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 74.4% (4092 of 5499 strings; 819 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 70.2% (3864 of 5499 strings; 958 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 70.0% (3853 of 5499 strings; 965 fuzzy)
0 failing checks (0.0%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 65.0% (3577 of 5499 strings; 1211 fuzzy)
132 failing checks (2.4%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 64.8% (3568 of 5499 strings; 1220 fuzzy)
139 failing checks (2.5%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 64.6% (3553 of 5499 strings; 1235 fuzzy)
154 failing checks (2.8%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Translation update  by Rune Osnes <osnes.rune@gmail.com> using Weblate

po/nb.po: 62.9% (3462 of 5499 strings; 1304 fuzzy)
223 failing checks (4.0%)
Translation: GnuCash/Program (Norwegian Bokmål)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/nb_NO/

Co-authored-by: Rune Osnes <osnes.rune@gmail.com>
2023-06-16 19:50:34 +02: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
Richard Cohen
68b689c95c Refactor: remove GNC_DEFINE_TYPE, GNC_IMPLEMENT_INTERFACE
Use GObject constructed() instead
2023-06-14 12:33:14 +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
e6a564de82 Refactor: remove unnecessary GncPlugin*Private 2023-06-14 11:03:37 +01: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
Richard Cohen
c5d4f2bf30 Refactor: DECLARE_FINAL GncPluginQifImport < GncPlugin 2023-06-14 11:03:37 +01:00
Richard Cohen
81ce7bb107 Refactor: DECLARE_FINAL GncPluginOfx < GncPlugin 2023-06-14 11:03:37 +01:00
Richard Cohen
d73117d1ef Refactor: DECLARE_FINAL GncPluginLogReplay < GncPlugin
- Fix the name
2023-06-14 11:03:37 +01:00
Richard Cohen
08168bec26 Refactor: DECLARE_FINAL GncPluginCustomerImport < GncPlugin
- fix the camel-snake hybrid name
  - except the name of the action, which is already used externally
2023-06-14 11:03:37 +01:00
Richard Cohen
f47c9295bc Refactor: DECLARE_FINAL GncPluginCsvImport < GncPlugin 2023-06-14 11:03:37 +01:00
Richard Cohen
d6764414c1 Refactor: DECLARE_FINAL GncPluginCsvExport < GncPlugin 2023-06-14 11:03:37 +01:00
Richard Cohen
631d0e7755 Refactor: DECLARE_FINAL GncPluginBiImport < GncPlugin
- fix the camel-snake hybrid name
  - except the name of the action, which is already used externally
2023-06-14 11:03:37 +01:00
Richard Cohen
a0952e1e5a Refactor: DECLARE_FINAL GncPluginAqBanking < GncPlugin 2023-06-14 11:03:37 +01:00
Richard Cohen
218ca30b46 Refactor: DECLARE_FINAL GncPluginReportSystem < GncPlugin 2023-06-14 11:03:37 +01:00
Richard Cohen
17f41a796a Refactor: DECLARE_FINAL GncPluginRegister < GncPlugin 2023-06-14 11:03:37 +01:00