The context being either multi-split or two-split. There's no use
in selecting a Transaction ID column in two-split mode for example.
Similarly none of the 'Transfer xzy' types will be used in
multi-split mode.
In its current state it will only work for a very restricted context.
However there's no code to validate this context so the importer will
happily produce wrong results in all other contexts.
A query on the mailing list didn't return any interest in this feature
so instead of fixing it I'd rather drop it to keep the code clean.
A detail worth noting: contrary to most other date fields
an empty value for a reconcile date is allowed if the reconcile
field is not set to 'y' (reconciled).
At the same time drop the exception handling for the num for action setting.
The importer can't possibly get this right automatically in all cases. It's
now up to the user to assign the right columns to the correct properties
based on how he/she wants gnucash to store it internally.
Additionally use g_key_file_[gs]_<type>_list to store and retrieve coltypes and colwidths
instead of storing/retrieving a raw string to parse afterwards
The returned values in case of an error from the g_key_file_get* are
the correct defaults in most cases already.
In addition:
- Reduce number of temporary variables
- Fix a memory leak while testing the saved data
This was still pulled in via the now removed gnc-csv-model.
In order to remove this, the fixed format csv importer
has been tweaked to get the required features from
the c++ csv importer code instead.
Dereferencing an iterator and then assigning it to another variable
apparently copies the object the iterator points at, instead
of making a reference to it. C++ beginner mistakes...
Also do the multi-split parent dance before handling errors. Otherwise
child lines would be mistakenly added to the first working parent split
instead of also being skipped until the parent is fixed.
- The preview part should be less chaotic now. It already has an option for future multi-split
import functionality, but that's not used yet
- rename a few variables
- change semantics on start/end lines; this is now communicated in number of lines to skip
- avoid a couple of double value storing (once in the assistant object and onece in the import object)
- improve comments
- improve variable and function names (to be more concise and to the point
- use 'Transfer Account' instead of 'Other Account' as that's the term used in the rest of gnucash
The overly complex templated class hierarchy is replaced
with two simple classes. One to keep the discovered transaction
properties and one for the discovered split properties. Make
both classes responsible for verifying it's state and creating
the necessary objects.
- Use CamelCase for type definitions and _ for function names
- m_ for member variables
- avoid typedef (not needed for structs, replace by using for aliases)
- use std::string for composing strings
- fix condition part in for loop (can't use , need &&)
- markup comment for doxygen inclusion
The class was still called after the original struct in c and the file
had an almost ok name from when I started the conversion.
Add some usage information to the class as well.
- Use a more logical grouping for setting up liststores and columns
- Use one common store for all the header line's combo box entries
- Store column number in each combo box entry for later retrieval
- prefer c++ data types (auto, bool, int, std::string)
- iterate over vectors instead of accessing via the [] operator
- use boost::{u32}regex instead of directly manipulating a c-string