Commit Graph

791 Commits

Author SHA1 Message Date
Richard Cohen
5d955654bc Refactor: DEFINE_TYPE GncSxInstanceModel < GObject 2023-05-26 13:34:09 +01:00
Mike Alexander
d61b962954 Fix a typo in some debug output. 2023-05-18 17:34:05 -04:00
John Ralls
26162da450 Merge Richard Cohen's 'cleanup-build' into stable. 2023-05-17 21:16:09 -05:00
Richard Cohen
80e9d9c35d scanf supports %lld since C++11, C99 2023-05-15 13:21:30 +01:00
Richard Cohen
4df662afae Fix the typo in function name "new_query_for_addresss" 2023-05-13 13:08:07 +01:00
John Ralls
df878c6a3d Merge Maarten Bosmans's 'memleak-fixes' into stable. 2023-04-29 11:54:41 -07:00
Maarten Bosmans
71802b5627 [test] Fix memory leak in test-gnc-quotes
When the commodity table is registered, the current book will get
a default table assigned.  When later setting the table explicitly
using qof_book_set_data() the exisiting table gets overwritten and
is thus leaked.

There is no way of removing or freeing a currency table from a book,
so the best we can do here is to set our own table on the book before
calling gnc_commodity_table_register().
2023-04-29 11:52:12 -07:00
Maarten Bosmans
6be682b645 Store allocated temporaries in a variable so they can be freed
If a function that returns an allocated pointer is passed directly into
something that does not take ownership of the pointer, the allocation is
leaked.  This can be fixed by assigning the pointer to a new variable
and freeing it after operation on the memory.
2023-04-29 11:51:43 -07:00
Christopher Lam
e26c3d6cf4 [gnc-ui-balances.c] gnc_ui_account_get_balance_limit_explanation
returns a char* explanation, or NULL
2023-04-22 14:22:40 +08:00
John Ralls
2f471e65a7 Bug 798802 - Online Price quote - Stocks not working GNU 5.0 Windows Bis
The previous change of the delimiter between namespace and symbol
is needed in both overloads of GncQuoteImpl::query_fq.

Also log the query json string to ease future troubleshooting.
2023-04-09 15:24:53 -07:00
Maarten Bosmans
0d86be6d2a [test] Properly destroy resources on end of tests
This fixes memory leaks that are only present in testing code.
Not very useful on itself, but it does make it easier to fix memory
leaks and other AddressSanitizer problems in actual gnucash code later.
2023-04-02 21:12:50 +02:00
Maarten Bosmans
ed3fe00880 [test] Use test fixture to initialize and destroy resources 2023-04-02 21:12:50 +02:00
John Ralls
0d598d51ed Fix Finance::Quote use on Win32.
By dealing with Win32 \r\n newlines on return from finance-quote-wrapper.
2023-03-30 16:45:01 -07:00
John Ralls
a587dfff2c Bug 798802 - Online Price quote - Stocks not working GNU 5.0 Windows
Change the property-tree path delimiter for constructing paths from
'.' that's commonly used in stock symbols, to '|' that isn't.
2023-03-29 20:01:10 -07:00
John Ralls
89f41a305c Merge new potfile reflecting string changes. 2023-03-24 14:28:24 -07:00
John Ralls
576fc9b52c Fix quotes on Windows.
Boost process wchar_t conversion chokes if it's fed an empty string.
This would happen when the user had no alphavantage key. Separate
the process invocation to not present the empty value to boost process.
2023-03-19 10:32:26 -07:00
John Ralls
90e1e2d1c3 Merge Bob Fewell's 'bug798558' into master. 2023-03-19 10:11:42 -07:00
John Ralls
0c3e85404d Avoid crash from trying to free an unallocated char*. 2023-03-19 10:09:01 -07:00
Christopher Lam
97f0653238 [gnc-quotes] g_free a char* from gnc_prefs_get_string
ultimately gets char* from g_settings_get_string and must be freed
2023-03-20 00:40:41 +08:00
Robert Fewell
a576dd87a4 Bug798558 - Irregular line spacing in Account Tree View
When securities are in the list, the rows look twice as high as though
there is a linefeed at the end. This is partly due to commit for bug
797501 which worked at the time but a change in pango 50.4 to do with
wrapping has highlighted this bug.

To fix this only wrap currencies with ltr bidi isolate characters in
gnc_print_amount_with_bidi_ltr_isolate
2023-03-19 13:53:41 +00:00
Geert Janssens
1f0a69a804 Properly parse plus signs while importing numbers
Silly copy/paste error.
2023-03-15 08:58:07 +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
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
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
Christopher Lam
89e2bef427 Merge branch 'maint' 2023-02-26 13:51:33 +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
Richard Cohen
bddb4468fa Import GLIB2 as a target, and use it to simplify the CMakeLists 2023-02-21 12:59:42 +00:00
Geert Janssens
8a23304283 GncGSettings - use bool as return type for static function 2023-02-17 18:10:35 +01:00
Geert Janssens
64329414e9 GncGSettings - cosmetic: NULL->nullptr 2023-02-17 14:08:20 +01:00
Geert Janssens
32ae47980c GncGSettings - some minor cleanups
- remove unused macros
- avoid manual counters
2023-02-17 14:02:34 +01:00
Geert Janssens
03aff5642a GncGSettings - rework signal handler manipulation
Use ref-counting to manage GSettings object lifecycle
Use g_signal_handler_handlers_[un]block_matched to
block or unblock handlers rather than tracking them in
our own hash table.
2023-02-17 14:02:34 +01:00
Geert Janssens
4761aa414c GncGSettings - reduce code duplication
Most getters and setters are identical with the exception of
the actual function to call into GSettings. Extract
boilerplate in two template functions and make all
getters/setters wrappers of these two functions.
2023-02-17 11:48:41 +01:00
Geert Janssens
edab41f23a GncGSettings - basic c++ cleanups
- declare at first use
- gboolean->bool (TRUE/true, FALSE/false)
2023-02-17 11:48:41 +01:00
Robert Fewell
a1d17518a8 Add a function to dump the schema entries when in debug
mode.
2023-02-17 10:15:23 +00:00
Robert Fewell
2306ef8ca6 On a new install, the gnc_gsettings_version_upgrade
would not run

When doing a new install, set the GNC_PREF_VERSION to the current
version.
2023-02-17 10:14:42 +00:00
Robert Fewell
57f874bd3f Change the behaviour of the gseettings migration
function

In the pref_transformations.xml file, when the release version is
greater than the current GnuCash version, do not process those changes.
2023-02-17 10:14:09 +00:00
Robert Fewell
ac0532bf5c Change the alignment of a function in gnc_gsettings.cpp 2023-02-16 14:23:52 +00:00
Robert Fewell
308c609904 Fix comment typo in gnc-gsettings.cpp 2023-02-16 14:23:51 +00:00
Geert Janssens
286e1afa41 Bug 798749 - Fails to read gsettings on startup
Only cache GSettings objects we need to keep
track of callback functions.
This means a bit more overhead per GSettings
interaction, but as typical interactions are
only a few objects at once at best, this
overhead is unnoticeable.
2023-02-16 22:40:36 +01:00
Richard Cohen
9c6ad222a9 [-Wunused-function] - remove 2023-02-16 09:20:59 +00:00
Richard Cohen
8a20bcadb0 [-Wunused-variable] - remove unused translatable string 2023-02-16 09:20:59 +00:00
Richard Cohen
0dd406de10 [-Wunused-lambda-capture] (clang) - remove 2023-02-16 09:20:59 +00:00
Richard Cohen
78ec20515b Remove some unused variables - and the initialization
- checked that any side effects were irrelevant
2023-02-06 14:20:28 +00:00
Richard Cohen
ea2d3be217 Remove some unused variables with obviously no side effects 2023-02-06 14:19:22 +00:00
Christopher Lam
85c2491664 Merge branch 'maint' 2023-02-05 12:09:38 +08:00
John Ralls
7bb14b9caa Merge Richard Cohen's 'use-reference-for-loop' into master 2023-02-02 14:32:14 -08:00
Richard Cohen
d8f45f2443 Use const references for for-loops to avoid unnecessary copies
Found by clazy - clazy-range-loop-reference
2023-01-31 14:44:57 +00:00
John Ralls
ce3447e6ea Bug 798740 - Build fails with gcc 13
Protect against passing an lseek failure rv to read().
2023-01-30 16:48:16 -08:00