Commit Graph

1949 Commits

Author SHA1 Message Date
Richard Cohen
30586ac3e6 Push -Wno-error=deprecated-declarations from C*_FLAGS down to the target 2023-03-15 10:34:14 +00:00
Geert Janssens
1f0a69a804 Properly parse plus signs while importing numbers
Silly copy/paste error.
2023-03-15 08:58:07 +01:00
John Ralls
a44b3664e2 [c++options] Implement GncOptionGncOwnerValue class.
GncOwners aren't QofInstances and have limited lifetimes so an option
must hold its own, wrapped in std::unique_ptr for memory management.
2023-03-14 16:11:39 -07:00
John Ralls
8db8105850 [c++options] Warn when an option variant type's set_value isn't found. 2023-03-14 16:11:39 -07:00
John Ralls
83829e6513 Merge branch 'maint' 2023-03-14 10:43:45 -07:00
John Ralls
1020bde89c Fix crashes in test-engine on Arch Linux.
Root cause is mutating a list while it's iterating. We're able to
protect it in two cases, have to copy it in xaccTransScrubGainsDate.
2023-03-14 10:33:39 -07:00
Geert Janssens
d75ab275f1 Eliminate gnc-csv-account-map.[ch]
The code is was only used by the csv import assistant and forced
gtk as a dependency on gnc-imp-props-tx

Part has been moved to Account, other bits have
been moved to the importer code where they were
used.
2023-03-13 19:58:10 +01:00
Geert Janssens
13ec4bb594 xaccParseAmount... - some code cleanups
- declare at first use
- compact tests
- reduce use of {}
2023-03-13 19:58:10 +01:00
Geert Janssens
8010d9646c Restore proper indentation
It got mixed up while refactoring the various xaccParseAmountXYZ functions
2023-03-13 19:58:10 +01:00
John Ralls
07d8ebd90c Add JSON::Parse to gnc-fq-update.
Required by finance-quote-wrapper to interpret quoter output.
2023-03-10 12:51:30 -08:00
Richard Cohen
329a2f7d42 Guard against some possible null pointer dereferences
Found by gcc 12 when compiling with "-O2 -Wnull-dereference"
2023-03-08 11:00:56 +00:00
Richard Cohen
3a7464a312 Remove redundant uses of cmake -E env
- In GncAddTest, set_tests_properties() is already setting the env
- In the other uses, there is no change to the environment
2023-03-07 15:44:43 +00:00
John Ralls
cdb674ebf1 [c++options]Really fix the gnc_option_db_lookup_string_value leak
By deleting the function and using GncOptionDbImpl::lookup_string_option
directly. It returns a string that we don't have to worry about
memory-managing.

Also create a new GncOptionDbImpl::set_string_option to replace
gnc_option_db_set_string_value.
2023-03-06 11:43:50 -08:00
John Ralls
92071e8844 [c++options] Fix leak. 2023-03-05 10:14:20 -08:00
John Ralls
f735c64cac Merge Richard Cohen's 'extern-c-part2' into master. 2023-03-04 13:51:07 -08:00
Richard Cohen
7b47c07f8e Don't use extern "C" around #includes
Some I missed the first time. Some are new.
2023-03-03 18:55:42 +00:00
Frank H. Ellenberger
bdb12fd94f I18N: Change TaxTable to "Tax Table" for consistency 2023-03-03 09:58:01 -08:00
John Ralls
bbfa378783 Don't crash and do pass tests. 2023-03-02 17:03:39 -08:00
John Ralls
af02dae286 Fixups for merging into master instead of maint. 2023-03-02 17:02:46 -08:00
John Ralls
1eecb9f5c0 [c++ options] Fix locale dependency in test-gnc-option-scheme-output.
Created by using std::to_string() in GncOptionRangeValue::serialize.
It wraps sprintf that reads the locale. Use ostringstream instead.
2023-03-02 12:22:55 -08:00
Christopher Lam
76014f18a0 [account.cpp] don't cache char* [fails] 2023-03-01 23:58:22 +08:00
Christopher Lam
3d381eb6fd [gnc-lot] don't cache char* 2023-03-01 19:49:33 +08:00
Christopher Lam
50f998fad8 [gncInvoice] don't cache char* 2023-03-01 19:49:27 +08:00
Christopher Lam
c9dc71978b [gnc-commodity] don't cache char* 2023-03-01 19:49:20 +08:00
Christopher Lam
57fcaabd8f [Split.c] don't cache char* 2023-03-01 19:49:04 +08:00
Richard Cohen
be41bde58a Add missing MAKE_LINKS, and the local scm directory to %load-path
Before this change, "make check" would fail after
  rm -rf ${build}/share/guile/site/*/gnucash/
2023-02-28 11:51:23 +00:00
John Ralls
675d894128 Merge Richard Cohen's 'cleanup-options' into master. 2023-02-27 16:33:00 -08:00
John Ralls
ca73b00039 Merge Richard Cohen's 'cleanup-boost' into master. 2023-02-27 16:31:53 -08:00
John Ralls
3d5e27982f Merge branch 'maint' 2023-02-27 16:24:44 -08:00
John Ralls
7f0353adc4 Fix a missed g_value_dup_string and some no longer used variables. 2023-02-27 16:19:50 -08:00
John Ralls
8a7c539258 Bug 798748 - Transaction Notes field's value does not appear in...
reverse transaction.

The proximate cause was that xaccTransBeginEdit put the KVP cache
variable of the new transaction in a state that prevented the value
from being copied. More generally the KVP cache variables didn't
handle any invalidating events.

With the change to GValue usage in qof_instance_get_kvp it's now
a simple memory dereference with no copying except for POD types
so caching is no longer useful. This commit removes caching from
Transaction, eliminating the notes problem.
2023-02-27 14:54:46 -08:00
John Ralls
ddc3f28899 [kvp] Use static strings and boxed in gvalue_from_kvp_value.
Saves allocating and copying complex values, avoiding potential
memory leaks.
2023-02-27 14:54:02 -08:00
Richard Cohen
9f06859390 Remove references to old boost versions
we already require 1.67
2023-02-27 11:48:09 +00:00
Richard Cohen
3d995de2ab Refactor: use default GncOptionValue copy constructor 2023-02-27 11:46:39 +00:00
Richard Cohen
1b0af4246a Refactor: remove extra template parameter from member functions 2023-02-27 11:46:34 +00:00
Richard Cohen
87c52f53fa Update some references to hello-world.scm 2023-02-27 11:36:04 +00:00
Richard Cohen
ec169e6e24 Fix some non-translatable typos 2023-02-27 11:32:12 +00:00
Christopher Lam
47b85d3b2f [gnc-xml-backend.cpp] g_free char* from g_path_get_dirname 2023-02-27 09:18:01 +08:00
Christopher Lam
89e2bef427 Merge branch 'maint' 2023-02-26 13:51:33 +08:00
Christopher Lam
89e63ef672 Bug 798754 - Build fails with gcc 13 and glib > 2.76, ter 2023-02-26 08:30:14 +08:00
John Ralls
6ab7b16d62 [c++options] Restore the ability to set plot sizes in pixels.
Enable and fix the previously untested GtkOptionGtkUIItem::PLOTSIZE.

This has the potentially unfortunate side effect that integer range
options are assumed to be plot sizes. That's correct for now, but
if some report comes along that needs an integer range option for
something else it will have to be differentiated.
2023-02-25 16:25:36 -08:00
Christopher Lam
abcce5000c Bug 798754 - Build fails with gcc 13 and glib > 2.76, bis 2023-02-25 13:12:35 +08:00
Geert Janssens
26482f397b Bug 797033 - The CSV Importer should not obey with the "automatic digital point" setting
Expose variations of xaccParseAmount and
xaccParseAmountExtended that will ignore the
automatic decimal point user preference.
This preference is really only useful for manual number
entering in the register.

The xaccParseAmountImport variant replaces xaccParseAmountPosSign
which was used exclusively by the csv importers.
Like xaccParseAmountPosSign, this replacement has the flag
to ignore or parse the positive number indicator.
2023-02-24 23:02:15 +01:00
Frank H. Ellenberger
fcbda57a6b Merge branch 'maint' 2023-02-24 19:19:12 +01:00
John Ralls
184669f517 Bug 798754 - Build fails with gcc 13 and glib > 2.76
GLib 2.76 introduced a no-discard warning on g_string_free
if the second parameter is FALSE. This revealed a string
leak and a correct usage that didn't use the return value.
2023-02-23 09:47:37 -08:00
Geert Janssens
549c93e005 Fix test for import-backend
Another split function needed mocking
2023-02-23 12:33:31 +01:00
Richard Cohen
bddb4468fa Import GLIB2 as a target, and use it to simplify the CMakeLists 2023-02-21 12:59:42 +00:00
Robert Fewell
ec7cc27d6d Add tests for default invoice report book property 2023-02-21 10:48:34 +00:00
Robert Fewell
76f0e3a97e Add some PWARN messages to the default invoice report
book functions
2023-02-21 10:44:07 +00:00
Geert Janssens
8a23304283 GncGSettings - use bool as return type for static function 2023-02-17 18:10:35 +01:00