collectors are accumulator-type objects, being mutated with each call,
rather than functional objects. (map) is meant for functional
constructs, returning a list to current continuation. We're not using
the (map) output, so, change it to (for-each) to emphasise this.
The last three commits fix the main part of Bug 796137. An inconvenience
with GSList remains as for the moment qof_query_add_boolean_match only
accepts bytes as parameter and no strings. This still needs to be fixed.
Patch by David Osguthorpe to provide typemaps so that SWIG doesn't
free buffers mem when buffer is saved as part of query struct leading
to garbage content. See https://bugs.gnucash.org/show_bug.cgi?id=796137
for incremental entry.
Because the Quartz Input Method module (imquartz.c) messes with the
selected text, so we cache it in the gnucash_sheet object and restore it
after the input module is done with the keypress.
And make the icon small to recover some vertical screen estate.
The motivation for this is that Gtk has dropped the ability for users
to change a toolbar's appearance. And as our icons are often less
than descriptive many users benefit from having textual descriptions
as well. This is the best compromise we can make until the gui
gets an in-depth redesign.
Casting a char* to a struct containing a uint32_t is not universally safe
due to alignment constraints on reads on some platforms. Copy our possibly
unaligned source data into an aligned area of memory to avoid SIGBUS on
armhf.
Reported by vorlonofportland in PR#403. This commit the John's optimized
version of Vorlon's proposed fix.
- add -Wno-deprecated-declarations to CXX_FLAGS as well. This was
reported by vorlonofportland in PR#401 to become necessary for glib 2.58
as that has deprecated g_type_class_add_private which appears in our
c++ code.
- change -Wno-deprecated-register into -Wregister. The former appeared to
be a clang dialect and alias for the latter (see
https://github.com/Barro/compiler-warnings for an overview of clang
and gcc warnings). It was moved to global CXX_FLAGS as it can only be
added for g++.
While debugging for bug 796054 I found cases where an invoice was unposted, but the toolbar
buttons and menu items were configured for a posted invoice. This should now be solved.
In the conversion from a timespec pointer to a time64 in
https://github.com/Gnucash/gnucash/commit/6f89bd62b3cf
we lost the write-back of these two dates to the calling function.
Fixed by making the time64 members pointers again as the timespecs were before.
get-commodity-totalavg-prices seeks to create a share-weighted average of
all prices for a commodity and 0-share splits (normally used to book
trading gains) don't represent a price and so distort (sometimes
dramatically) the resulting average as well as creating extra invalid
entries in the resulting alist.
When a register is created an initial query is run and then the filter
and sort item/reverse order is added and after each item the ledger is
refreshed. By adding a parameter to the three main functions to toggle
the refreshing, with a value of false at register creation, and moving
the gnc_ledger_display_refresh command this can be reduced to 2 from 5.
In the sort/filter dialogue the refresh parameter is TRUE allowing the
changes to be seen immediately.
The General Ledger default for the number of days shown is 30 but for
the Register it is 0, meaning show all. So change the default filter
based on ledger type and use this when determining if the setting should
be saved or removed.
The KVP value for the qof_book_get_num_days_autoreadonly was being
called many times so it makes sense to cache it in the book to avoid
the KVP lookup.
If you open File->Properties and the dialogue gets hidden and you go to
open it again the existing dialogue was not being raised to the front.
This was due to a bad cast.
Change the two register get_help functions to use gnc_date_cell_get_date
with the warn parameter FALSE, this way we only get one warning when the
date is out of range.
Also as no functions use gnc_date_cell_get_date_gdate it can be removed.
Change gnc_split_register_save_date_cell function and the equivalent one
in gncEntryLedgerModel to use time64 version of gnc_date_cell_get_date
which includes the warning for dates out of range.
For the LD_GL save the filter and sort settings to the .gcm always.
For the rest, keep saving the filter and sort settings to kvp only
when the GNC_FEATURE_REG_SORT_FILTER is not set, if set then save
only to the .gcm file. This will be set on first use in version
4.0 where a conversion will be run to only use the .gcm meta file.
matching transactions.
gnc_date_edit_get_date returns the time64 value set to 00:00:00 for the
day entered so for the LTE and GT options gnc_date_edit_get_date_end
needs to be used for 23:59:59. For finding transactions on the date,
the use of QOF_DATE_MATCH_DAY needs to be used.
We only used strfmon in one source file to generate three fixed format
strings. Instead of updating to a newer strfmon in borrowed I have
chosen to reimplement the string formatters for these strings in C++.
Note this is *not* a full c++ conversion of the full functionality
of assistant-loan. Only the string parsing has been redone.