This required moving around a few other parameters
- currency_format and date_format will now be passed directly to the function that needs it
- Account is converted into a trans_prop just like all the other columns the user had selected
As per recommendation 10 in Meyer's Effective Modern C++
This also means the string array with column type names
can no longer be shared between c and c++ code, so
set up a separate one in c++
- use iterators to loop and std::find
This allows us to use 'continue' on the loop in case
of errors instead of using an ever more indenting if/else
- Use auto where possible
- Use constant iterators where possible
This base class takes care of the common things like
file opening and character set conversion.
The actual interpretation of the contents will be
delegated to specialized child classes.
Effective c++ note: explicitly declare special member functions
The Character Encoding menu imported from goffice comes with many such strings.
I still need to find a nice way to copy the existing translations for them
from goffice directly to gnucash.
The dependency on goffice can't be eliminated completely yet at this point.
The stf library we're currently using to parse csv files depends on it. This
will be fixed in a future commit.
We're using only a tiny fraction of that library.
Adding it directly in the gnucash source saves a large dependency chain.
Note this is a verbatim copy of these files from
https://github.com/GNOME/goffice/tree/GOFFICE_0_8_17
to preserve a clean link with it's origin.
It will only build correctly after the next commit.
The previous logic failed because GMOCK_SRC_DIR is cached. On
subsequent cmake runs FIND_PATH is not invoked again and hence
the first test for GMOCK_SRC_DIR will always succeed and
src is always appended to it to obtain GMOCK_SRC_MAIN_DIR.
This is not what we want, so I have chosen to force a rerun
of FIND_PATH by clearing the cached value of GMOCK_SRC_DIR.
With SQLite3 and PGSql perform all of the safe_sync actions in a SQL transaction.
Unfortunately MySQL commits the transaction on the first schema-altering
query (CREATE_TABLE in this case) without decrementing sql_savepoint, so
raising an error when we try to release the (non-existent) save point at
the end of writing the tables, so we have to fall back on detecting a failed
safe_sync at the next connection attempt.
Add a GncDbiSqlConnection::check_and_rollback_failed_save() to restore
the database after a failed safe_save; this is performed at the next connection.