until the very end of the import (OK or Cancel), because account commits trigger very lengthy balance
computations. For this, I call xaccAccountBeginEdit on all the accounts involved in the import,
keeping a list of them so BeginEdit is called only once. At the end of the import, commit is called
on all the accounts in the list. Note that when the user selects a target account for an imported
transaction, xaccAccountBeginEdit is called on the target account, and it is added to the list.
Another area of improvement is avoiding re-checking all register transactions to verify whether
a given imported transaction has already been matched. Instead, a hash table of split online IDs
is computed once (per account), and verified for each incoming transactions.
Finally, the list of register transactions that are potential matches for the imported ones is
further pruned ahead of time to only keep transactions that do not have an online ID. This avoid
the repeated checks that were previously happening in the match-score loop.
With this, importing 6000 transactions into a 6000 split account becomes fairly fast (a few seconds
on my slowish machine).
There are still slow areas: If you select all 6000 imported transactions and assign a destination
account to all of them, the process is impossibly sluggish because of repeated path operations
(selections, freeing) in the tree view.
If you do not specify a target account for any of the 6000 imported transactions, an "imbalance"
account is used, but the xaccAccountBeginEdit mechanism isn't applied to it by the new code, so
each imported transaction will trigger a commit, and therefore a slow balance recomputation.
Remove use of xaccTransGetSplit
I now save them into a temporary list. A single query is done for all imported transactions
and the resulting register splits are put into a hash table of lists with accounts
as key, which will speed things up when multiple accounts are found.
My tests of large imports on large accounts seems to ate that most of the time is spent
verifying whether the imported transactions has already been imported, then computing
the balance repeatedly for each imported transaction (!) when the user clicks OK to
add all the transactions to the account. So there's still room for improvement here!
The previous ofx import code performed one query for each imported transactions, which
was quite slow. The change consists of gathering all ofx transactions before doing the
query. The query must be wider to search for all matching accounts (in case the imported
transactions come from different accounts) and an enlarge date range (according to the
earliest and latest imported transaction). The rest of the code is identical to what was
done before. The final query is performed just before the matching dialog is displayed.
Rearranged gnc_price_cell_modify_verify to remove code duplication.
Also added removal of any thousands separators as if they were left
in the wrong place gnc_basic_cell_set_value_internal would raise
an error dialog and fail to accept the value.
In update_language_region_combos, the directory returned from
gnc_path_get_accountsdir is traversed looking for language/regions.
When it hits "C" directory it unconditionally overwrites the
start_region variable which is used to determine the default
language/region so commit compares this directory with the locale_dir
before setting. Patch provided by 'YOSHINO Yoshihito'
On windows 10, if the font has been specified in CSS with 'sans-serif',
the insertion cursor on an empty entry widget is not shown. Choosing a
different font such as 'arial' is OK. As reporter based there changes
on the example CSS file remove the reference to 'sans-serif'
Currently new pages are created in the last position which
could result in a lot of scrolling if a large number of
tabs are open. This commit changes that so new pages are
created next to the current page.
gnucash_sheet_delete_cb should always reset the entry to the returned
value because the combo-box manipulations might have reset it to the
combo box value. Also always stop the delete signal because otherwise
the gtk_entry delete handler will dupllicate the deletion.
Both the account separator and the input string might have regular
expression special characters that will screw up regex matching.
Escape both to ensure that matching works correctly.
averaging-multiplier is an inexact value with Year or Month average.
gnc-numeric-convert seems to barf when it receives an inexact floating
point number.
SWIFT MT940 import.
GWEN_Date_ToLocalTime doesn't handle Daylight Savings Time correctly
so extract the day, month, and year from the GWEN_DATE and use our
own coversion function.
A new per-account preference is added to let the user decide whether the interest transaction dialog should be
opened automatically before the reconcile. This preference is only enabled for certain types of accounts and
the code that decides that was moved to Account.h as is it now used in two separate place.