- Renamed option to "Account Balance" to avoid confusion with running
total.
- Added helper function to ensure running balance and balance forward
are only shown when transaction are grouped by account and sorted as
in register. In that case column heading remains "Running Balance"
and balance forward is shown. Otherwwise column heading is renamed
"Account Balance" and balance forward is not shown.
- Also added missing code for Common Currency conversion.
Ensure that dialog resources stored in options are freed when the
dialog is destroyed.
The crash happened when a new dialog replaced the old one on the options
and the old one's destructors tried to access a dangling reference to
a GtkWidget.
Edit/Report Options
As a result of auto instead of auto& in a std::visit call which
resulted in a temporary option whose GncOwner* was destroyed before
we could use it.
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.
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.
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
It's better to use the default std::pair implementation
- spotted by clang-tidy bugprone-suspicious-string-compare
- will always return false, because type is the same
Also,
- remove redundant "using GncItem ..."
- spotted by clang-tidy bugprone
- probably no visible effects because of uniqueness, and other checks
libgnucash/engine/gnc-optiondb.cpp:149:5: warning: this call will remove at most one item even when multiple items should be removed [bugprone-inaccurate-erase]
m_options.erase(std::remove_if(m_options.begin(), m_options.end(),
^
libgnucash/engine/gnc-optiondb.cpp:358:5: warning: the value returned by this function should be used [bugprone-unused-return-value]
std::remove_if(m_callbacks.begin(), m_callbacks.end(),
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
libgnucash/engine/gnc-optiondb.cpp:358:5: note: cast the expression to void to silence this warning
for certain reports.
Those reports being ones using complex options, apparently because
the callbacks weren't protected from Guile's garbage collector.
So replace the anyway ugly hack of a void* with a std::any wrapping
a class holding a std::unique_ptr with a custom deleter. The
constructor calls scm_gc_protect_object on the SCM containing the
callback and the custom deleter calls scm_gc_unprotect_object. The
copy constructor, required for std::any, makes a new std::unique_ptr
and calls scm_gc_protect_object again ensuring that the protect and
unprotect calls are symmetrical.
Meanwhile std::any hides the Guile dependency from all the classes
that don't need to know about it. The only ugliness is that there's
no good place to put a common implementation of SCNCallbackWrapper so it's
repeated in gnc-optiondb.i and dialog-options.cpp.
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.
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.