Christopher Lam
1eb6709331
[test-lots.cpp] add kvp getter/setter changes
2021-08-31 23:16:43 +08:00
Christopher Lam
323182c9f7
[utest-Account.cpp] add kvp getter/setter changes
2021-08-31 23:16:43 +08:00
Christopher Lam
8a37c4c019
[utest-Invoice.c] add kvp getter/setter tests
2021-08-31 23:16:43 +08:00
Christopher Lam
9ec670f828
[test-commodities.cpp] add kvp setter/getter test
2021-08-31 23:16:42 +08:00
Christopher Lam
d4c8b36f9f
[utest-Transaction.cpp] add kvp setter/getter tests
...
wasn't tested before
2021-08-31 23:16:42 +08:00
Christopher Lam
c3b50f0b58
[gnc-lot.c] fix - cache value properly
2021-08-31 23:16:42 +08:00
Christopher Lam
595e126a34
[account.cpp] modify set_kvp_string_tag to accept strstrip or nullptr
...
- will remove a second call to g_strstrip (g_strdup (str))
2021-08-31 23:16:42 +08:00
Christopher Lam
c5a6383b43
[account.cpp] fix - incomplete #1117
...
- init struct members properly to: is_unset and TriState::Unset
- test acct kvp "equity-type" for "opening-balance" instead of "true"
- cached account->color/sort_order/notes/filter gets strstripped
similarly to previous behavior
2021-08-31 23:16:42 +08:00
John Ralls
bed44f404f
Remove the always questionable Scheme generation and parsing code.
...
It's more reasonable to do that in Scheme than in C++.
2021-08-30 11:47:04 -07:00
Christopher Lam
001b34616f
[Transaction.c] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
a47bee97d6
[Split.c] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
0ecbcb4ef1
[gnc-lot.c] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
ac2afc7e13
[gncInvoice.c] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
3bf49ed8d7
[Account.cpp] GValue string must be unset
2021-08-29 15:38:16 +08:00
Christopher Lam
e3af2f22f9
[gnc-commodity.c] cache user_symbol into commodity struct
...
Continuation of ff2ceb111
which introduced issue whereby user_symbol
returned could become stale, leading to invalid read fixed with
c398bef59
. There are likely other user_symbol pointers becoming stale
without this commit.
This change will save the user_symbol into the commodity struct,
avoids gchar* becoming stale.
2021-08-29 15:38:16 +08:00
John Ralls
a487ca3f98
Improve template conditional readability with custom traits values.
2021-08-28 16:45:31 -07:00
John Ralls
57f73d70c7
Merge Yordan Miladinov's denom_lcd into maint.
2021-08-27 12:34:07 -07:00
Christopher Lam
c6d8333811
Merge branch 'maint'
2021-08-27 20:33:31 +08:00
Christopher Lam
c55ab50349
[gnc-budget.c] gnc_budget_get_account_period_note to be freed by the caller
2021-08-24 23:02:15 +08:00
Christopher Lam
9ddb9e8215
[gnc-module.c] free a GList* properly
...
g_list_free (current) was a NOP because current became NULL after the
preceding GList traversal.
2021-08-24 22:32:39 +08:00
Simon Arlott
0665208299
xml-backend: Lock file is deleted even if the lock is not acquired
...
The lock file is set in m_lockfile and then unlinked in session_end even if
the lock was not acquired.
Clear m_lockfile if locking was not successful.
2021-08-24 09:29:47 +01:00
Simon Arlott
e4619fdae6
xml-backend: Don't try to close m_lockfd if it's not open
...
m_lockfd is not initialised. If the file is locked then it will not be set
before session_end and close() will be called on an uninitialised int.
Initialise it to -1 in the class definition.
Consistently use -1 instead of "< 0" or "< 1" as the definition of invalid.
Always set it to -1 after closing it.
2021-08-24 09:29:45 +01:00
Yordan Miladinov
6cb509ea7d
fix an uncaught exception: denom_lcd may throw an overflow exception if casting lcm to int64_t fails
2021-08-24 00:58:31 +03:00
Christopher Lam
7e41efc232
Merge branch 'maint-speedup-and-leaks' into maint #1109
...
Speedup xaccSplitGetOtherSplit
2021-08-20 21:23:35 +08:00
Christopher Lam
ff2ceb111d
[gnc-commodity] GValue must be unset
2021-08-20 17:02:58 +08:00
John Ralls
62ab148a3e
Output a pair when writing relative date values to scheme file.
...
So that the can be properly recognized on input.
2021-08-19 09:48:44 -07:00
John Ralls
b3f96701a0
GncOptionAccountListValue: Make setter param cv match template.
2021-08-18 16:14:21 -07:00
John Ralls
b361582cf2
Ensure option UI is sorted: Tabs by names, items by keys.
2021-08-18 15:42:29 -07:00
John Ralls
10381d42e0
Fix color option handling.
...
Read and write color options the way legacy code does. Pass only values
with no alpha to gdk_rgba_parse because it fails if a hex-string has
alpha.
2021-08-18 13:38:06 -07:00
John Ralls
97a317b50c
Ensure that alpha values in colors aren't passed to html.
...
html color tags don't like them.
2021-08-17 15:47:11 -07:00
John Ralls
3d1812aacd
Explicitly cast a value to the decltype of get_value().
...
Can't always rely on implicit conversion working.
2021-08-17 15:41:26 -07:00
Christopher Lam
028bf9826b
[Split] xaccSplitGetOtherSplit don't test book trading-accts
...
don't test trading-acct property when finding other split.
2021-08-17 13:04:34 +08:00
John Ralls
474bc360f4
Improve converting vectors to SCM lists.
2021-08-15 14:25:52 -07:00
Christopher Lam
6bf5a618de
qof_instance_get gchar* must be freed
...
A call to qof_instance_get expecting a gchar* receives a newly
allocated string which must be freed.
2021-08-15 09:49:06 +08:00
John Ralls
1cd2cf211c
Specialize QofInstance* options set_value, catch validation exceptions.
...
GncOptionValue<const QofInstance*>.get_value() returns a QofInstance* but
reports store them as strings, either commodity mnemonics or GUIDs.
Specialize set_value/set_default_value from scheme to handle those
possibilities.
GncOptionValidatedValue throws an invalid_argument exception if it's
fed an invalid argument. Catch that so that it doesn't crash the program.
2021-08-13 14:06:47 -07:00
John Ralls
852b2ffc2e
Handle bare currency mnemonics, catch invalid GUID string exceptions.
2021-08-13 14:06:47 -07:00
John Ralls
e43ff93279
Fix some overly-long lines.
2021-08-13 14:06:47 -07:00
John Ralls
1af97ebb9a
Implement registering/unregistering/calling change callbacks.
...
Drives reloading the report when the Apply or OK button is pressed.
2021-08-13 14:06:47 -07:00
Christopher Lam
e4d808e674
[qofbook] qof_book_use_split_action_for_num_field: free a char*
...
qof_instance_get allocates a new char* which must be freed.
2021-08-13 08:58:07 +08:00
John Ralls
86da12d844
Use RGB instead of RGBA for color set for color
2021-08-12 14:28:44 -07:00
Christopher Lam
eafc290034
Merge branch 'maint'
2021-08-12 22:28:58 +08:00
Christopher Lam
40d886fa9d
gnc_account_list_name_violations elements must be freed
2021-08-12 09:39:08 +08:00
Christopher Lam
4c37f6d4ef
[account.cpp] gnc_g_list_stringjoin instead of repeated allocations
2021-08-12 09:19:34 +08:00
Christopher Lam
e84549926b
[gnc-glib-utils] gnc_g_list_stringjoin to join a GList of strings
...
It traverses the GList twice (once to calculate the length) but
allocates only once.
Includes snippet from
https://www.joelonsoftware.com/2001/12/11/back-to-basics/
2021-08-12 09:19:34 +08:00
John Ralls
86d7637160
Handle GncOptionMultichoiceValue::set_value parameters
...
that don't match the get_value return type.
2021-08-08 15:22:53 -07:00
Christopher Lam
bedc85afa3
Merge branch 'maint-leaks' into maint #1101
2021-08-06 19:30:01 +08:00
Christopher Lam
0420ae6a66
[account.cpp] refactor gnc_account_list_name_violations
2021-08-06 17:31:36 +08:00
Christopher Lam
67bd513514
[account.cpp] rewrite gnc_account_foreach_descendant_until in C++
2021-08-06 17:31:36 +08:00
Christopher Lam
17953441cb
[account.cpp] refactor gnc_account_foreach_descendant
2021-08-06 17:31:36 +08:00
Christopher Lam
5698b67bf5
[account.cpp] refactor gnc_account_lookup_by_code
2021-08-06 17:31:36 +08:00
Christopher Lam
09e2e7613c
[account.cpp] refactor gnc_account_lookup_by_name
2021-08-06 17:31:36 +08:00
Christopher Lam
bebc366e88
[account.cpp] refactor gnc_account_n_descendants
2021-08-06 17:31:35 +08:00
John Ralls
b6622a386b
Pick up option aliases recently added in maint.
2021-08-05 15:52:13 -07:00
John Ralls
a97b3e0c6d
Don't let C code destroy the ODB, it's owned by Guile.
2021-08-05 15:52:13 -07:00
John Ralls
a2e1a3e1b8
Extract the GncOptionDB* from the Scheme dispatch function closure.
...
Scheme code keeps the GncOptionDB in a closure. Extract it for C/C++
use. Ownership remains with the closure, don't free the GncOptionDB*.
2021-08-05 15:46:56 -07:00
John Ralls
f0926d66c1
Merge Simon Arlott's 'qof-instance-dispose' into maint.
2021-08-05 11:45:14 -07:00
Christopher Lam
e6c33a39bc
[account.cpp] refactor gnc_account_get_descendants{_sorted}
2021-08-06 00:23:12 +08:00
Christopher Lam
d2db43019c
[account.cpp] internal function account_foreach_descendant
...
fast and efficient
2021-08-06 00:23:12 +08:00
Christopher Lam
de1ad9367a
g_free gnc_ctime which returns a new gchar*
2021-08-05 21:42:31 +08:00
Simon Arlott
7a0ea190ca
qof_instance_dispose should always complete dispose processes
...
If QofInstancePrivate has no collection then qof_instance_dispose() returns
without completing the rest of its dispose processes, skipping removal of
its type string from the string cache resulting in a reference count leak.
Change the check for a collection so that it only affects the call to
qof_collection_remove_entity().
2021-08-05 08:56:51 +01:00
Christopher Lam
c9db551693
g_free qof_print_date which returns a new char*
2021-08-05 09:23:28 +08:00
John Ralls
d099d39afd
Merge Simon Arlott's 'commit-root-on-load' into maint.
2021-08-04 15:52:51 -07:00
John Ralls
fd56512cf7
Merge Simon Arlott's 'load-test-xml' into maint.
2021-08-04 15:48:42 -07:00
John Ralls
9062be3d47
Merge Simon Arlott's 'string-cache-fixes' into maint.
2021-08-04 14:26:27 -07:00
John Ralls
f6766d42ec
Merge Simon Arlott's 'string-cache-no-refcount-empty' into maint.
2021-08-04 14:19:21 -07:00
John Ralls
99eaa81a28
Fix parse of commodity namespace from scheme istream.
...
Just ignore 2 instead of ignoring 1 twice. No ifdef required.
2021-08-04 10:04:47 -07:00
Christopher Lam
a5edacf0fc
[options.scm] Rename option name to "Levels of Subaccounts"
...
Original name "Show Accounts until level". Add backward compatibility
missed in 08f490ee98
2021-08-04 19:02:30 +08:00
Christopher Lam
23bd716451
g_free gnc-path's gchar* intermediate strings
2021-08-03 12:14:12 +08:00
John Ralls
0bd9033bb3
Move includes of glib and gtk out or extern C in new cpp files.
2021-08-01 11:11:20 -07:00
John Ralls
0f02236ebe
Fix gcc warnings.
2021-08-01 10:27:50 -07:00
John Ralls
18997db720
Separate GncOptionAccountValue into GncOptionAccountListValue and GncOptionAccountSelValue.
...
They have different get_value() return types so can't cohabit comfortably.
2021-07-31 18:22:46 -07:00
John Ralls
dd8e8b4efa
Evaluate the getter for making invoice options.
2021-07-31 18:22:45 -07:00
John Ralls
05ac056449
Make separate option type for GncOwner.
...
GncOwner is not a QofInstance subclass.
2021-07-31 18:22:45 -07:00
John Ralls
9d150b1ae7
Always set budget option to default budget.
2021-07-31 18:18:05 -07:00
John Ralls
f5d8d508ee
Create the GncOptionVariant's GncOptionValue in place.
...
Saves a temporary, prevents premature unprotecting of Scheme objects.
2021-07-31 18:18:05 -07:00
John Ralls
c034a26ae7
Protect stored scheme option values from the garbage collector.
2021-07-31 18:18:05 -07:00
John Ralls
67dab6b320
Remove business-options.scm and business-prefs.scm.
...
Their functions have been reimplemented elsewhere.
2021-07-31 18:18:04 -07:00
John Ralls
a1af86ed40
Implement gnc:generate-restore-forms, gnc-optiondb-save-to-scheme.
2021-07-31 17:54:30 -07:00
John Ralls
c34986dad4
Change gnc:new-options to return a fake dispatch function.
...
To placate test-report.scm
2021-07-31 17:54:30 -07:00
John Ralls
3f89d063eb
Evaluate default function in gnc:make-account-sel-limited-option.
2021-07-31 17:54:30 -07:00
John Ralls
6eb5dfed51
make-internal fail if there is a ui_item, not if there isn't.
2021-07-31 17:54:30 -07:00
John Ralls
29a2365fdf
Avoid infinite recursion when the alias changes only the section name.
2021-07-31 17:54:30 -07:00
John Ralls
7885353fe3
Bring option aliases up to date.
2021-07-31 17:54:30 -07:00
John Ralls
bbe74aa086
Remove tooltips from multichoice option values.
...
This is the c++options equivalent to 02a6a0ae
and e1525721
.
2021-07-31 17:54:30 -07:00
John Ralls
7c6ecafd61
Rewrite options.scm to wrap options.hpp functions where needed.
2021-07-31 17:54:30 -07:00
John Ralls
52ef53a405
Implement multichoice selection options.
2021-07-31 17:54:30 -07:00
John Ralls
7239eb809a
Test more natural way of designating relative dates.
2021-07-31 17:54:30 -07:00
John Ralls
23461f1d6c
The value of a list-option is a list. Duh.
2021-07-31 17:54:30 -07:00
John Ralls
12f8df1eab
Fix test failure: Clear the stream before reusing it.
2021-07-31 17:54:30 -07:00
John Ralls
be322a0d7c
Group GncOptionMultChoiceValue::set_multiple with set_default_multiple.
...
Better readability.
2021-07-31 17:54:30 -07:00
John Ralls
27670a6e98
Make the 'pixel and 'percent SCM symbols C++ constants.
...
Improves efficiency and conciseness.
2021-07-31 17:54:30 -07:00
John Ralls
a94f69d6e0
Pretty up some SFINAE formatting for easier reading.
2021-07-31 17:54:30 -07:00
John Ralls
0f8446a1bb
Remove some no longer needed diagnostics.
2021-07-31 17:54:30 -07:00
John Ralls
f66a918be4
Implement GncOptionValue<const QofQuery*>
...
QofQuery isn't a QofInstance and doesn't have a GUID.
2021-07-31 17:54:30 -07:00
John Ralls
0a8f66ee90
Fold GncOptionGncOwnerValue into GncOptionValue<const QofQuery*>.
...
Reflecting the way Scheme options handles it.
2021-07-31 17:54:30 -07:00
John Ralls
418eb06620
Remove GncOptionDateValue::set_default_value(size_t)
...
Because it's ambiguous with set_default_value(time64).
2021-07-31 17:54:30 -07:00
John Ralls
7d0cdf7c94
Handle #f input to option typemap(in)s.
2021-07-31 17:54:30 -07:00
John Ralls
86a2f1551f
Implement gnc-make-date-option.
2021-07-31 17:54:30 -07:00
John Ralls
693e966bf9
Extract Scheme date handling functions and apply them.
...
Including in RelativeDatePeriodVec typemap, making it work correctly.
2021-07-31 17:54:30 -07:00
John Ralls
63502900f3
Permit GncOptionAccountValue to have a nil default value.
2021-07-31 17:54:30 -07:00
John Ralls
42185c0ec8
typemap for std::size_t
...
Unaccountably missing from swig_guile.
2021-07-31 17:54:30 -07:00
John Ralls
5c74337810
Add function GncOption::set_default_value.
...
Allows reports to derive from other reports and then change the option
default values to suit. If they change only the values and not the defaults
then it's possible to create saved report configs that don't include the
options whose values are changed to the base report's default value. See
https://bugs.gnucash.org/show_bug.cgi?id=642292 .
2021-07-31 17:54:30 -07:00
John Ralls
c04f4a00e0
Replace gnc_make_option<SCM> with gnc_make_scm_option
...
To finesse SWIG_Guile's typedef unsigned long SCM, which causes SFINAE
issues when trying to resolve the template.
2021-07-31 17:54:30 -07:00
John Ralls
e7309f077b
Replace gnc_make_option<gnc_commodity*> with gnc_make_commodity_option.
...
To handle cases where we try to create commodity options with a symbol as
the default instead of a gnc_commodity*.
2021-07-31 17:54:29 -07:00
John Ralls
3aa86ca992
QofInstance* needs a typemap to match the from/to SCM logic.
2021-07-31 17:54:29 -07:00
John Ralls
4a305998e4
GncOptionDateValue set_value_from_scm: 'else' required.
2021-07-31 17:54:29 -07:00
John Ralls
d9984f75ab
Update test-gnc-optiondb.scm for not renaming the RelativeDatePeriod enums.
2021-07-31 17:54:29 -07:00
John Ralls
43cd81ba78
Fix a couple of RangeValue retrieval issues.
2021-07-31 17:54:29 -07:00
John Ralls
9bd3baff63
Change the reldate_values alist from a static to a singleton.
...
A static has to be initialized at library load and Guile
isn't necessarily running then. The singleton gets evaluated at
runtime only if the getter is called from Guile.
2021-07-31 17:54:29 -07:00
John Ralls
534a7c2893
GncOptionMultichoiceValue allow setting a default selection.
...
Instead of arbitrarily using the first allowed value.
Also update tests for the Scheme type addition to
GncMultichoiceOptionChoices, intercept more cases where the value
needs to be transformed, and go back to emitting a string instead of
throwing in GncOptionMultichoiceValue::get_value when m_values has more
than one value.
2021-07-31 17:54:29 -07:00
John Ralls
c62b526ba0
Implement scm_to_value<bool>.
2021-07-31 17:54:29 -07:00
John Ralls
efc7346490
Implement scm_to_value<GncOptionAccountList>.
2021-07-31 17:54:29 -07:00
John Ralls
f20c358ce1
Return a pair in scheme for GncOptionRangeValue<int>.
...
This is a bit of a hack to handle PlotSize options. They're the only
RangeValues that use ints; the rest use doubles because the control is a
GtkSpinButton and that uses doubles. The chart code expects a pair with
either 'pixel or 'percent saying what to put in front of the number. We
hack that too: if value <= 100 then it's percent because 100px is about
3cm on modern monitors and 15mm on HiDPI ones. Bigger numbers are pixels.
2021-07-31 17:54:29 -07:00
John Ralls
b5c0477143
Use the SWIGGED pointer for the SCM value of QofInstance* Values.
...
This effectively reverts b7dd7f.
Note that two cases aren't handled because the types aren't GObjects and
so don't have type macros to decipher them: GncOwner and QofQuery. Since
they're not GObjects they're obviously not QofInstances either and we
need to rethink this value type a bit.
2021-07-31 17:54:29 -07:00
John Ralls
f7f2d22909
Implement gnc-optiondb-foreach.
2021-07-31 17:54:29 -07:00
John Ralls
81d261897e
scm_to_value<QofInstance*>() handle Swigged ptrs as well as GUIDs.
...
Some swigged engine functions used to set options return Swigged ptrs.
2021-07-31 17:54:29 -07:00
John Ralls
16a36d9104
Correctly set value of a GncOptionMultichoiceValue.
...
Accounting for the 3 types of SCM object that we might be handed.
2021-07-31 17:54:29 -07:00
John Ralls
7c1b4b794a
Convert from Scheme date-period symbols to C++ RelativeDatePeriod enum.
...
Create an alist mapping the Scheme symbols to the corresponding Swig
functions that alias the enumerations. When a symbol is received look
up the corresponding function and evaluate it, retrieving the enumeration.
2021-07-31 17:54:29 -07:00
John Ralls
d41292fddd
Make set_selectable a GncOptionsGtkUIItem member function.
...
Callable from the option object with set_ui_item_selectable and from
Scheme as gnc-option-db-set-option-selectable-by-name.
2021-07-31 17:54:29 -07:00
John Ralls
a21f329b1e
Use 100% instead of 20000 px for default Pixmap size.
2021-07-31 17:54:29 -07:00
John Ralls
8c2a8edbed
Implement gnc_option_db_set_string_value and gnc_optiondb_lookup_string_value.
2021-07-31 17:54:29 -07:00
John Ralls
86102e1be7
Return SCM_BOOL_F instead of nullptr to Scheme optiondb-lookup.
...
Because unlike C, Scheme thinks (if 0) should return true. Besides, Swig
hides pointers so a null check doesn't even work.
2021-07-31 17:54:29 -07:00
John Ralls
53ad0ba440
Prevent SWIG from trying to call delete on a std::unique_ptr.
2021-07-31 17:54:29 -07:00
John Ralls
08d1eebba2
Use GUID strings instead of QofInstance* for scheme value of QofInstance.
...
Because that's what gets used everywhere else.
2021-07-31 17:54:29 -07:00
John Ralls
fba0248548
Support different GncOptionMultichoiceValue key types.
...
Scheme can use strings, symbols, or ints as keys in multichoice options,
but C++ can handle only strings. Add conversion and tracking so that the
right key type gets sent back to Scheme.
2021-07-31 17:54:29 -07:00
John Ralls
55a2ed1df8
gnc-optiondb.i uses functions declared in gnc-optiondb.h.
...
So it needs it declared in the swig file.
2021-07-31 17:54:29 -07:00
John Ralls
18b83874fd
Another bit of Remove test-option-utils
2021-07-31 17:54:29 -07:00
John Ralls
0b7ccfbd5b
Create gnc-make-foo-option functions.
...
For compatibility with current Scheme code.
2021-07-31 17:54:29 -07:00
John Ralls
a602f64b17
SFINAE-constrain the GncOption constructor templates.
...
So that one can't instantiate an invalid constructor.
Unfortunately Swig doesn't understand SFINAE and will try to create the
invalid constructors anyway but at least this generates a compile-time
error when it tries to.
2021-07-31 17:54:29 -07:00
John Ralls
43f4bcb610
Make GncOptionUIType an enum class.
...
So that Swig will create properly constrained identifiers for its values.
2021-07-31 17:54:29 -07:00
John Ralls
7fa6778b4b
Add a register_option overload to GncOptionDB
...
For compatibility with existing scheme code.
2021-07-31 17:54:29 -07:00
John Ralls
cb7270cafe
Fix myriad gcc10 complaints.
2021-07-31 17:54:29 -07:00
John Ralls
76b0001cbe
Remove option-util.
2021-07-31 17:54:29 -07:00
John Ralls
e2c87f23c3
Convert optiondb users in gnome and gnome-utils to C++.
...
To enable using std::unique_ptr<GncObjectDB> and avoid memory management
problems.
2021-07-31 17:54:29 -07:00
John Ralls
ea835b31b7
Provide GncOptionPtr& overloads for register-option functions.
...
Simplifies and makes safer calls from Scheme and C++ by not requiring
a raw pointer.
2021-07-31 17:54:29 -07:00
John Ralls
472814d315
Change the normal internal option ValueType to SCM.
...
Internal options are used as a Scheme hack and don't need to be interpreted
on the C side so there's no point in converting them to C types.
2021-07-31 17:54:29 -07:00
John Ralls
e48416010d
Remove redundant GncOptionDB decl.
2021-07-31 17:54:29 -07:00
John Ralls
7022f5222d
Revert gnc_option_db_lookup|set_glist_value to ...scm_value.
...
GLists and SCM lists are not interchangeable.
2021-07-31 17:54:29 -07:00
John Ralls
8c77ce967b
Implement and test obsolete option name aliasing.
2021-07-31 17:54:29 -07:00
John Ralls
90b8fce59f
Fix build after merge.
2021-07-31 17:54:29 -07:00
John Ralls
4f3fd665cf
Fix counter and counter_format storage in KVP.
...
So that they go to their own slots instead of to the options slot.
2021-07-31 17:54:29 -07:00
John Ralls
b19f3d383c
Protect some exceptions from being passed to Swig.
2021-07-31 17:54:29 -07:00
John Ralls
52600bbd1f
Instantiate gnc_register_number_range_option templates in SWIG.
2021-07-31 17:54:28 -07:00
John Ralls
31a0153fec
Another GncOptionDBPtr fix.
2021-07-31 17:54:28 -07:00
John Ralls
85db341afe
Remove test-option-utils
...
It no longer works. Since that's all that test-app-utils called,
delete it too.
2021-07-31 17:54:28 -07:00
John Ralls
21398dfda1
Testing fixups for using GncOptionDB* in register_option functions.
2021-07-31 17:54:28 -07:00
John Ralls
7dab089d49
Fix miscalculation of prev_quarter_end for the first quarter.
...
If the current quarter ends June 30 backing up 3 months from there
gets March 30, one day off. Back up first and calculate the end
of the actual quarter of interest.
Changed pre_quarter_start for consistency, it doesn't matter.
2021-07-31 17:54:28 -07:00
John Ralls
d1cfd62f31
Fix loading text fields from KVP into options.
2021-07-31 17:54:28 -07:00
John Ralls
276d33975a
Remove dialog-options.c, replaced by dialog-options.cpp.
...
Adds new function reset_default_value to GncOption; doing it outside
of the class requires knowing the Type of m_value.
2021-07-31 17:54:28 -07:00
John Ralls
5f9c66aa61
Save all options to KVP if clear_options is true.
2021-07-31 17:54:28 -07:00
John Ralls
6491c98563
Clean up some omitted type-forcing in set_option_from_ui_type() instances.
2021-07-31 17:54:28 -07:00
John Ralls
245a8fccc7
Correctly select UI types for GUID output.
2021-07-31 17:54:28 -07:00
John Ralls
c751e56184
Fix fail to load or save number-range values in KVP.
2021-07-31 17:54:28 -07:00
John Ralls
010ab1a965
Fix free of unallocated ptr crash.
2021-07-31 17:54:28 -07:00
John Ralls
4a4e5d36f8
Enable gnc_register_owner_option to handle the three types that GncOwner aliases.
2021-07-31 17:54:28 -07:00
John Ralls
d8f83d6ee6
Boolean simple won't work if its UI type is INTERNAL.
2021-07-31 17:54:28 -07:00
John Ralls
3514725a97
Make gnc_register_number_range_option a template on ValueType.
...
GtkSpinButton works with doubles, but we want to preserve the
ability to use other types.
It really should have enable_if<is_arithmetic(ValueType)>.
2021-07-31 17:54:28 -07:00
John Ralls
e78c012699
Fill in the book options.
2021-07-31 17:54:28 -07:00
John Ralls
ae79fd016d
More skeletons
2021-07-31 17:54:28 -07:00
John Ralls
28438e3126
Rewire gnome and gnome-utils to use GncOptionDB.
2021-07-31 17:54:28 -07:00
John Ralls
41e59df71f
Remove unused and un-needed function.
2021-07-31 17:54:28 -07:00
John Ralls
1eef796f09
Add some skeleton functions to make the option-using code in gnucash/gnome-utils and gnucash/gnome happy.
2021-07-31 17:54:28 -07:00
John Ralls
99103ffd10
Change gnc-register-option functions to take GncOptionDB*.
...
Instead of std::unique_ptr<GncOptionDB> because there's no way
to get a unique_ptr through a C call.
2021-07-31 17:54:28 -07:00
John Ralls
9111f118e0
Business option create_option_widget specializations.
...
Required creating a registration class for create_option_widget
overload functions because without it the dispatch function
complained of missing symbols at link time.
2021-07-31 17:54:28 -07:00
John Ralls
01c0fe2364
Include what we use.
2021-07-31 17:54:28 -07:00
John Ralls
25b717d47a
Add a rudimentary C API for GncOptionDB.
...
So that most of the gnome-util and gnome consumers don't need to
be converted to C++.
Hide the corresponding functions in options-utils to stop the
compiler whining.
Note that this commit breaks the build but is necessary at
least temporarily to compartmentalize the changes.
2021-07-31 17:54:28 -07:00
John Ralls
4451f58bd6
Rename RelativeDatePeriods missed earlier.
2021-07-31 17:54:28 -07:00
John Ralls
6feb92d4e8
Provide scheme function new-gnc-optiondb.
...
Wraps creating a GncOptionDBPtr, freeing up gnc_option_db_new() to
return a GncOptionDB* for use in C code. Convert gnc_option_db_new()
calls in gtest-gnc-optiondb to call std::make_unique() as well.
2021-07-31 17:54:28 -07:00
John Ralls
f9e136dbac
Get the spelling of GncMultichoiceOptionEntry consistent.
2021-07-31 17:54:28 -07:00
John Ralls
eb6e31f803
dialog-options: Change signature of gnc_option_get_gtk_widget()
...
So that it can be called from C.
2021-07-31 17:54:28 -07:00
John Ralls
67508ea039
Reimplement dialog-options for C++.
2021-07-31 17:54:28 -07:00
John Ralls
3b4785e744
Convert GncOptionSection from a std::pair to a class.
...
Provides find_option(const char*) and foreach_option(func) for easy
iteration. find_option and find_section now return plain const ptrs
instead of std::optionals. Much less cumbersome though the compiler
won't nag if you forget the nullptr check.
2021-07-31 17:54:28 -07:00
John Ralls
c63db36a60
Rename string_equal_charptr to operator==(const std::string&, const char*)
...
Much prettier and more idiomatic as well as being a lot less typing.
2021-07-31 17:54:28 -07:00
John Ralls
0106176436
Provide GncOption::is_alternate() for GncOptionRangeValue<>.
...
Needed for GncOptionUIType::PLOT_SIZE to indicate whether the option
value represents pixels or percent.
2021-07-31 17:54:28 -07:00
John Ralls
5fd53c94de
Provide GncOption::GetLimits for setting a NUMBER_RANGE spin button.
2021-07-31 17:54:28 -07:00
John Ralls
a995343a8b
Provide for multiple selections in GncOptionMultichoiceValue
...
To support the GncOptionUIType::LIST. This UI type is unused in GnuCash
code but might be used in user custom reports.
2021-07-31 17:54:28 -07:00
John Ralls
16da3208fc
Make GncOptionDateValue::get_period_index return value size_t.
...
Instead of int8_t to match the built-in vector index type.
2021-07-31 17:54:28 -07:00
John Ralls
ac0e7063c7
Move the GncOptionUIType and dirty members to GncOptionUIUtem.
...
Even though it makes the class not pure virtual any more it is necessary
behavior common to all possible subclasses.
2021-07-31 17:54:28 -07:00
John Ralls
3200bd4966
Add a multiselect boolean member to GncOptionAccountValue.
...
To support a variation available in dialog-options. Even though it's not
used in any GnuCash code nor documented anywhere it might be in some
custom reports.
2021-07-31 17:54:28 -07:00
John Ralls
fce33799af
Change GncOptionUIItem to be a pure virtual class instead of a templated one.
...
Simplifies the design because derived classes can have whatever save UI class
they need and implement the void(void) set_ui_item_from option and
set_option_from_ui_item with whatever functions are appropriate for
the UI class. No need for callbacks or std::function members.
2021-07-31 17:54:27 -07:00
John Ralls
00aa0f603d
Add a PLOTSIZE option UI type.
...
I'd missed this one earlier.
2021-07-31 17:54:27 -07:00
John Ralls
6c8e0e23f7
Redesign GncOptionDateValue.
...
After getting a better understanding of how it interacts with dialog-options and
finding some additional scheme API needing implementation (exposed only in
hello-world.scm, but possibly used in user-written reports).
Creates a new file-pair, gnc-options-date.[ch]pp to separate the creation of
the static structs with the type info and strings for the various
RelativeDatePeriod values from the already too large gnc-option-impl.
Although the result is a rather C-ish design the alternative with classes
or template specializations would be more complicated and offer no
benefit.
Implements the permissible_values functions of GncOptionMultichoiceValue
for GncDateValue and provides for absolute, relative, and both
UI values for the three widget configs afforded by dialog-options.
2021-07-31 17:54:27 -07:00
John Ralls
08bf3ec5b0
Merge branch 'maint'
2021-07-30 10:28:57 -07:00
Christopher Lam
f1e35daab3
Rename option name from "Extra notes" to "Extra Notes"
2021-07-23 06:25:01 +08:00
Christopher Lam
251db8c37b
Rename option name from "Report title" to "Report Title"
2021-07-23 06:25:01 +08:00
Christopher Lam
2606ddf905
Rename option name from "Invoice number" to "Invoice Number"
...
This ensures it matches all other invoice reports.
2021-07-23 06:24:55 +08:00
Simon Arlott
4a5b5f3bf2
Don't cache the empty string
...
Avoid unnecessary reference counting for uses of the empty string.
2021-07-11 18:54:49 +01:00
Simon Arlott
320df7e409
Use const return values for string cache
...
This is a prerequisite for being able to return "" (which is const) and
none of the returned values should ever be modified.
2021-07-11 18:54:49 +01:00
Simon Arlott
4132939612
Avoid leaking string cache entries for "" in Transaction and Split
...
When g_object_new() is used, the strings that default to "" are added to
the string cache. These are then not correctly removed when updating them
with new values when cloning a Transaction/Split.
Use CACHE_REPLACE instead of CACHE_INSERT.
2021-07-11 18:52:09 +01:00
Simon Arlott
bf8fe1123c
Commit root accounts after loading from XML
...
The root accounts start with a non-zero editlevel because BeginEdit is
called for them during loading but not committed after loading.
If the book is then closed without performing any further edits that would
require a commit, the Account book_end process does nothing because the
root account is still being edited and so none of the accounts are freed.
2021-07-11 15:04:57 +01:00
Simon Arlott
f15402a9a6
Load test data from XML properly
...
If qof_session_new() is called without a book then qof_session_load()
won't do anything.
Set up a book for it to use.
2021-07-11 14:56:56 +01:00
John Ralls
3b78b6e894
Change the GncOptionMultichoiceValue permissible value return types to const char*.
...
From std::string. The consumer is a GtkWidget so we might as well do the conversion
inside the class and this will simplify adding these functions to GncOptionDateValue
in the next commit.
2021-07-10 17:29:16 -07:00
John Ralls
d5f6a2539b
Replace GncOption::_get_option() with a friend function swig_get_option.
...
Implemented in gnc-optiondb.i it more clearly indicates the intended
use and restricts the access. Unfortunately further limiting the
friend declaration with #ifdef SWIG prevented the declaration from
working, raising the error "m_option is a private member of GncOption".
2021-07-10 17:29:15 -07:00
John Ralls
93a3716c00
Enable retrieval of a GncOptionDateValue's relative period.
...
So that it can be displayed by dialog-option.
2021-07-10 17:29:15 -07:00
John Ralls
dc876d4041
Provide an accessor to GncOptionAccountValue::m_allowed
...
To enable its use by gnc_account_sel_filter
2021-07-10 17:29:15 -07:00
John Ralls
102f36c3be
Provide more than one Date UI type to match options available in dialog-option.c
...
Also differentiates begin-period and end-period controls.
2021-07-10 17:29:15 -07:00
John Ralls
99c2c5e439
GncOptionUIItem from the GncOptionVariant classes to GncOption.
...
Separating the UI from the data model. Note that the GncOptionVariant
classes still have a GncOptionUIType member to ensure that a
GncOptionUIItem of the right type is attached.
2021-07-10 17:29:15 -07:00
John Ralls
1bea809cec
Remove the UI interface from GncOptionDB.
...
UI operations occur only in dialog-option so there's no need to expose
them from GncOptionDB.
2021-07-10 17:29:15 -07:00
John Ralls
cbf7d70ecd
Integrate gnc-option into app-utils.
...
Includes converting swig-app-utils-guile to c++.
2021-07-10 17:29:15 -07:00
John Ralls
81c5ac6689
Remove the incomplete book-currency code.
...
Not everything from the 6 Book-Currency commits is removed: Switching
the Num and split-action fields and restricting edits of transactions
older than n days were included and those changes are left in place.
Some other partly-implemented features were also part of these commits
and were removed: Options for setting a default capital gains account
and currency, completion of the LIFO cap-gains policy, and creation of
a list of cap-gains policies.
If any of these are to be revived they should each be done in a separate
feature branch and submitted via Github pull request for a code review
before merging; a design discussion on gnucash-devel before restarting
work is also advisable.
2021-07-10 17:29:11 -07:00
John Ralls
aa246d3096
Make implementation classes and template code visible only in app-utils.
...
So only GncOption and the GncOptionDB free-function interface are public.
We don't want to expose template headers widely, it would blow up compilation
times and might lead to one definition rule violations.
2021-07-10 17:24:58 -07:00
John Ralls
20b3ef8a89
Handle some minor differences between libc++ (clang) and libstdc++ (gcc).
2021-07-10 17:24:58 -07:00
John Ralls
cd6ccbe331
Fix account-tree double-free in scheme test when built with gcc.
...
Oddly when built with clang it doesn't exhibit the crash.
2021-07-10 17:24:58 -07:00
John Ralls
691cb0992e
Follow change in loading method for engine's guile bindings.
2021-07-10 17:24:58 -07:00
John Ralls
cbd0607e80
Implement load and store options from/to book options.
2021-07-10 17:24:58 -07:00
John Ralls
5a82aac639
Hide constexpr constants from SWIG.
...
Swig bindings don't need them and SWIG can't digest constexpr.
2021-07-10 17:24:58 -07:00
John Ralls
ffc6866406
Changes to accommodate moving guile engine bindings to bindings/guile.
...
Plus for changing targets gncmod-engine and gncmod-app-utils to
gnc-engine and gnc-app-utils.
2021-07-10 17:24:58 -07:00
John Ralls
d2535fe21b
KvpValue: Use boost::typeindex::type_id instead of buildtin typeid.
...
Under some build conditions boost::typeindex will use an internal type
identifier that's different from the C++ builtin. In that case type equality
tests to C++ typeid in boost::variant will fail, breaking it. Using
boost::typeindex::type_id ensures that the comparisons always work.
2021-07-10 17:24:58 -07:00
John Ralls
009219c63d
Much less ugly and fragile.
...
Finding the right form now relies on the form name instead of its
position in the parse tree.
2021-07-10 17:24:58 -07:00
John Ralls
276641ef15
Change parse of option input to generate a parse tree.
...
This is I hope less brittle than the previous character-counting, though
it's still brittle because it relies instead on counting form-depth.
2021-07-10 17:24:57 -07:00
John Ralls
51a1430c24
Remove stray diagnostic.
2021-07-10 17:24:57 -07:00
John Ralls
76172af239
Implement saving and loading OptionDB items to/from scheme and
...
key-value string representations.
2021-07-10 17:24:57 -07:00
John Ralls
6ab5618b76
Set a 50-character limit on the saved size of option section and name.
...
Allows use of istream::getline() to retrieve the values, simplifying
delimiter detection.
2021-07-10 17:24:57 -07:00
John Ralls
d7a2a0ffff
Make a constant for std::numeric_limits<std::size_t>max().
...
Improves readability.
2021-07-10 17:24:57 -07:00
John Ralls
826d75af16
Use istream::getline instead of std::getline for date option type parsing.
2021-07-10 17:24:57 -07:00
John Ralls
c5294ed6b3
Fix missing-declaration errors in swig-gnc-optiondb-guile.cpp.
2021-07-10 17:24:57 -07:00
John Ralls
7ccba53739
Add stream functions to_scheme and from_scheme to GncOption.
...
These add or parse the textual noise needed to replicate the Scheme options'
serialization technique of saving scheme forms for saving report options
and then evaluating those forms to restore the option values. Required for
backward saved-reports compatibility.
2021-07-10 17:24:57 -07:00
John Ralls
1ea3822665
More operator <</>> Fixups.
2021-07-10 17:24:57 -07:00
John Ralls
98ca190700
Fix commodity in/out to use namespace & mnemonic instead of GUID.
2021-07-10 17:24:57 -07:00
John Ralls
4b997cd025
Fixups for GncOptionDateValue better design.
2021-07-10 17:24:57 -07:00
John Ralls
b2fb57d39e
Fix GncOption::set_value() to work with GncOptionDateValue::set_value(RelativeDatePeriod).
...
Adjusting tests as necessary.
2021-07-10 17:24:57 -07:00
John Ralls
4dcf4a0e6a
Test GncOptionRangeValue as a GncOption.
...
Better representation of how it will be used.
2021-07-10 17:24:57 -07:00
John Ralls
4cabd6c052
Change the GncOptionMultichoiceValue test to use a GncOption.
...
Requires exposing the permissible values functions to GncOption.
2021-07-10 17:24:57 -07:00
John Ralls
e2a36a8be3
Expose function validate to GncOption and test it on GncOptionValidatedValue.
2021-07-10 17:24:57 -07:00
John Ralls
6df516dfcd
Clean up the commodity/currency tests with a better fixture class.
2021-07-10 17:24:57 -07:00
John Ralls
52d0ec5290
Change GncOptionDateValue design to better match usage.
...
Added advantage that it handles (not correctly, but in the same way as
the old code) the ambiguity between a period starting or ending with
the stored value "relative . today".
2021-07-10 17:24:57 -07:00
John Ralls
883127a59d
Implement operators >> and << on GncOption.
2021-07-10 17:24:57 -07:00
John Ralls
e583c84f4e
Clean up comments for GncOptionDateValue.
2021-07-10 17:24:57 -07:00
John Ralls
aaf6b14c67
Remove commented-out code.
2021-07-10 17:24:57 -07:00
John Ralls
1b00399b14
Remove GncOptionValue<std::Vector<GncGUID>>.
...
This going to be the Account List option implementation, but a more
customized approach is better.
2021-07-10 17:24:57 -07:00
John Ralls
5a9c4ccaf8
Clean out copies of the option.scm comments used as a development guide.
2021-07-10 17:24:57 -07:00
John Ralls
b95ea2c4aa
Add Account-list options.
2021-07-10 17:24:57 -07:00
John Ralls
7183e7c43a
Fix begin/end of quarter calculations.
...
Set the period to the calendar year if it's not set in prefs.
Handle correctly the FY start month being after the current month.
2021-07-10 17:24:57 -07:00
John Ralls
399573a89d
Fix multichoice test construction.
2021-07-10 17:24:57 -07:00
John Ralls
12c5b94430
New scheme function gnc_option_default_value.
2021-07-10 17:24:57 -07:00
John Ralls
3f576671aa
Adapt GncOptionMultiChoiceValue to support list options.
...
Main change adds a value field to the constructor to set the value and
default value.
2021-07-10 17:24:57 -07:00
John Ralls
2f2ac99944
Replace the direct wrapping of GncOptionDB-set-option-string-foo.
...
With a simple type-free function gnc_option_set. This mirrors the current
(gnc:option-set(gnc:lookup-option... and takes care of SCM type conversion.
2021-07-10 17:24:57 -07:00
John Ralls
252ba9b477
Change GncOptionDB::lookup_option to gnc_option_value().
...
The old gnc:lookup-option returned the option object so that it could be
manipulated rather than getting its value; gnc_option_value replicates
the behavior of (gnc:option-value (gnc:lookup-option)).
2021-07-10 17:24:57 -07:00
John Ralls
ff7b263a5f
Fix up and test the int specialization of GncOptionRangeValue.
...
Not sure yet that a double one is really needed.
2021-07-10 17:24:57 -07:00
John Ralls
39b7c9c74d
Convert scm_from_value() to templates for stricter overload resolution.
2021-07-10 17:24:57 -07:00
John Ralls
3dc4bc2377
Implement GncOptionDateValue.
2021-07-10 17:24:57 -07:00
John Ralls
435667e8fe
Implement GncOptionMultichoiceValue
...
Replaces GncOptionValue<GncMultiChoiceOptionChoices> because having the
vector as the value obviously wouldn't work and besides it needs
additional functions.
2021-07-10 17:24:57 -07:00
John Ralls
8eedcb6d6d
Extract all SCM functions to gnc-optiondb.i.
...
So that it can be moved to bindings/ when gnc-module-load-begone is ready.
2021-07-10 17:24:57 -07:00
John Ralls
d544f85256
Replace boost::variant and boost::optional with the C++17 std equivs.
2021-07-10 17:24:57 -07:00
John Ralls
694a15ed21
Extract SCM GncOptionDB::lookup_option to gnc-optiondb.i.
2021-07-10 17:24:57 -07:00
John Ralls
16d1f0655b
Get libswig-gnc-optiondb to install in the right place on Windows.
2021-07-10 17:24:57 -07:00
John Ralls
cee3cdaff9
Instantiate GncOption::set_option for guile, initial types string and int.
...
For proof-of-concept. Guile obviously doesn't know about templates.
2021-07-10 17:24:57 -07:00
John Ralls
9cdcaf0da8
Remove GncOptionDB::set_selectable and convert set_option to a template.
2021-07-10 17:24:57 -07:00
John Ralls
935ce6db99
Move the SCM option value conversion from the GncOptionValue classes to GncOption.
2021-07-10 17:24:57 -07:00
John Ralls
e51faff3e3
Throw an exception if one tries to set a GncOption with an unsupported type.
2021-07-10 17:24:56 -07:00
John Ralls
c5fac51a8b
Change the type of OptionUIItem's m_ui_item from void* to GncOptionUIItem.
...
A locally-opaque class wrapping whatever sort of widget ptr one needs.
Thanks, warlord!
2021-07-10 17:24:56 -07:00
John Ralls
3296212aef
Sketch out the rest of the option types.
...
Minimal implentation to get it to compile and pass tests, not functional yet.
2021-07-10 17:24:56 -07:00
John Ralls
0a13b4c518
Fix up the SWIG wrapper for GncOptionDBPtr.
...
Thanks to Flexo@stackoverflow for
https://stackoverflow.com/questions/27693812/how-to-handle-unique-ptrs-with-swig
5 years later, why isn't this in SWIG yet?
2021-07-10 17:24:56 -07:00
John Ralls
4146251cc7
Add GncOptionUIItem manipulation to GncOptionDB.
2021-07-10 17:24:56 -07:00
John Ralls
6ccb9dbb9e
Use a std::unique_ptr<GncOptionDB> instead of a raw ptr.
...
Passing references to it to the gnc_register_option functions.
Not tested yet with SWIG, might not work.
Includes introducing fixtures to gtest-gnc-optiondb.cpp.
2021-07-10 17:24:56 -07:00
John Ralls
94628097e4
Use GncOptionUIType parameters in gnc_register_option functions.
2021-07-10 17:24:56 -07:00
John Ralls
3769a356d5
Extract functions find_section and find_option using boost::optional
...
to handle not-found condition.
2021-07-10 17:24:56 -07:00
John Ralls
6deedd441f
Make the ptr returned by GncOption::get_ui_item() const
...
but not the GtkWidget it points to.
2021-07-10 17:24:56 -07:00
John Ralls
40361ec854
gnc-opption.hpp needs to include <functional>.
2021-07-10 17:24:56 -07:00
John Ralls
41ef2c5d44
Add OptionUIItem composition class to GncOption.
...
Provides a type and a raw pointer member with accessors. The type is one of
enum GncOptionIUType and is either VOID (for internal options that don't
get UI items) or one of the widget types specified in dialog-option.c or
business-options-gnome.c.
2021-07-10 17:24:56 -07:00
John Ralls
083e5b93df
Replace the CRTP class GncOptionBase with direct calls in its former children.
...
Benefit of CRTP too limited to accept the cost of understanding it.
2021-07-10 17:24:56 -07:00
John Ralls
cf0b1da4fa
Remove GncOptionWrapper.
...
Move the GncOptions into the GncOptionDB. This works with tests but
might not with real reports.
2021-07-10 17:24:56 -07:00
John Ralls
2ee0edaa16
Use targets instead of variables for GncOption* tests.
2021-07-10 17:24:56 -07:00
John Ralls
d2655d3fb0
Remove gnc-option-db business convenience functions.
...
gnc_option_db_lookup_invoice_option used only once, so moved its
guts there. The others weren't used at all.
2021-07-10 17:24:56 -07:00
John Ralls
ade7fc8b6e
Initial SWIG of GncOptionDB and Scheme tests.
...
This class will be heavily used by reports so we need to ensure SWIG and
Scheme compatibility from the start.
2021-07-10 17:24:56 -07:00
John Ralls
f3eee511e8
Add free functions to create a new GncOptionDB and to register options.
...
The objective of the free functions is to hide the GncOption from language
bindings so that the GncOptions can be moved into the GncOptionDB instead
of having shared ptrs splattered around the heap. Nearly all access to
the options can then be mediated through the GncOptionDB container.
Note that gnc_option_db_new creates the GncOptionDB on the heap and
returns a raw ptr, so it's up to the creator of the GncOptionDB to
call delete on it when it's no longer needed.
2021-07-10 17:24:56 -07:00
John Ralls
455d3c2d60
Add GncOptionDB class.
2021-07-10 17:24:56 -07:00
John Ralls
16fd632ec8
Make the GncOption member variables private.
...
GncOption is intended to be final, so there's no point in protected members.
2021-07-10 17:24:56 -07:00
John Ralls
13b94d2370
Test integer options, calling get_value with wrong type.
2021-07-10 17:24:56 -07:00
John Ralls
d88ec0dc1b
Replace the gnc_make_foo_option free functions with a template ctor.
...
The free functions will reappear for GncOptionDB. This is to avoid
having to pass naked pointers to Scheme with the attendant object
lifetime issues.
2021-07-10 17:24:56 -07:00
John Ralls
01dc70cc60
Add GncOption accessors for Classifier strings.
2021-07-10 17:24:56 -07:00
John Ralls
01fcae6ac8
Make the OptionClassifier members non-const.
...
Constness deletes the default copy assignment operator, making GncOption
not copy-assignable.
2021-07-10 17:24:56 -07:00
John Ralls
b6fd844774
Wrap GncOptionValue/GncOptionValidatedValue in Boost::Variant.
...
To provide a single type for containers.
2021-07-10 17:24:56 -07:00
John Ralls
c0ba3e2706
[C++ Options] Begin Implementation for basic and validated options.
2021-07-10 17:24:56 -07:00
John Ralls
b495da4e29
[C++ Options] Remove some unused C API from options-utils.
2021-07-10 17:24:56 -07:00
John Ralls
e1c153a516
Bug 798224 - Scheduled transactions are created with date-entered...
...
copied from the template transaction.
2021-07-10 16:35:20 -07:00
Robert Fewell
0f026f6a10
Bug 798221 - Transfer funds between accounts with different currencies crashes Gnucash on macOS
...
In the scrub function find_account_matching_name_in_list there was a
test for account names being the same for currency but condition was
backwards so was matching on account names being different. There was
also a g_list_free resulting in a double free which was removed.
2021-07-08 09:33:10 +01:00
John Ralls
ebf84fbf8d
Bug 798229 - GncDate::c_formats is being created and destroyed twice...
...
resulting in a double free crash on every exit.
Exclude by name the obsolete pre-GnuCash 4 modules from being inspected
so that they don't try to construct and destroy their static variables
twice.
2021-07-06 12:03:41 -07:00
John Ralls
06fc58c39d
Merge Simon Arlott's 'load-pricedb-faster' into maint.
2021-07-05 14:48:48 -07:00
Simon Arlott
08b56e9669
[gnc-pricedb] Don't lookup old prices when doing bulk updates
2021-07-05 21:57:34 +01:00
Geert Janssens
60f50e34c7
Tax - fully express source file dependencies in build scripts
2021-06-30 15:19:34 +02:00
luz paz
95f8884892
Fix misc. typos in comments
2021-06-29 08:46:34 +02:00
Christopher Lam
1b4d30b3b1
Merge branch 'maint'
2021-06-22 23:30:20 +08:00
Christopher Lam
e653c30193
[gnc-xml-backend] g_free char*
2021-06-22 18:57:55 +08:00
John Ralls
b1b368746f
Merge Hong Xu's 'explain-as-of-date' into maint.
2021-06-19 13:19:31 -07:00
John Ralls
b33d7eb98d
Doxygenize some function description comments in gnc-ui-util.
2021-06-18 11:54:14 -07:00
John Ralls
7f62c5395a
Bug 743999 - Deleting a digit from an existing number greater than...
...
four digits in length generates an error message.
Because the grouping is off. Checking grouping on input is pointless so
just ignore the grouping separator when parsing number input.
2021-06-18 11:40:06 -07:00
Hong Xu
0fd0aca531
Explain out what AsOfDate means in the doc
...
As discussed at
https://lists.gnucash.org/pipermail/gnucash-user/2021-June/096893.html
2021-06-16 12:07:23 -07:00
John Ralls
601eb51361
Improve transaction sorting on effective num field.
...
Inspired by PR #983 . Transaction sorting on num broke down if the
user had a non-numeric string or a number larger than an int in
the effective num field (might be split-action if the option is set).
The comparison first tries to use strtoull on the two strings and
compares the results. If they're both nonzero and different then the
numeric order is returned. If they're both nonzero but the same the
unconverted parts of each are passed to g_utf8_collate; if either is 0
then the whole strings are passed to g_utf8_collate. strtoull will
return 0 for a negative number.
2021-06-15 14:02:25 -07:00
John Ralls
985a6420fc
Bug 798196 - not building with Boost 1.76
2021-06-12 16:47:35 -07:00
John Ralls
6aa35ea7fb
Better fix for bug 798204, doesn't break trading account selection.
2021-06-12 16:42:10 -07:00
John Ralls
9eeff5dd7e
Bug 798204 - Creation of Imbalance Accounts
...
Search recursively when getting account by name.
2021-06-12 15:21:50 -07:00
John Ralls
68ec80e68d
Bug 798203 - g_assert fault while reversing transaction
...
* Re-commit the original transaction to ensure that there aren't
any stray trading splits.
* If the original and cloned transactions have a different number of
splits don't leak the cloned transaction.
* Check that the cloned transaction isn't NULL before trying to invert
it.
2021-06-12 13:37:25 -07:00
John Ralls
80d6749989
Bug 787813 - Price change from editing a transaction not reflected...
...
in pricedb.
Allow PRICE_SOURCE_SPLIT_REG to overwrite PRICE_SOURCE_XFER_DLG_VAL.
2021-06-10 11:29:34 -07:00
Christopher Lam
321b5efabc
Merge branch 'maint-leaks' into maint #1019
2021-06-09 06:47:23 +08:00
John Ralls
42213c597c
Bug 798199 - Pasting invalid value in date column crashes GnuCash
...
Catch boost::gregorian::bad_year in LDT_from_struct_tm and rethrow
std::invalid_argument for C wrappers to catch and handle.
2021-06-08 13:14:30 -07:00
John Ralls
66685f042e
Merge Bob Fewell's 'bug796761' into maint.
2021-06-08 11:58:27 -07:00
Christopher Lam
b095d1e7da
Revert "[qofquery] q->terms g_list members must be freed"
...
This reverts commit a3e3823ee7
.
Already freed earlier in the same function.
2021-06-08 07:36:47 +08:00
Christopher Lam
c8a7b9edb3
[Account] g_value_unset
2021-06-07 07:54:36 +08:00
Christopher Lam
bfdec74a48
[qof-backend] gchar * gnc_path_get_pkglibdir must be g_freed
2021-06-06 11:03:04 +08:00
Christopher Lam
f6a9be45ba
[Split] g_value_unset
2021-06-05 00:21:52 +08:00
Christopher Lam
36901c5751
[gncJob] g_value_unset
2021-06-05 00:21:52 +08:00
Christopher Lam
1824a30bd0
[gncinvoice] g_value_unset
2021-06-05 00:21:52 +08:00
Christopher Lam
badd976e11
[gnc-lot] g_value_unset
2021-06-05 00:21:52 +08:00
Christopher Lam
c9565abe8b
[gnc-commodity] g_value_unset
2021-06-05 00:21:52 +08:00
Christopher Lam
302020fcb7
[gnc-budget] g_value_unset
2021-06-05 00:21:50 +08:00
Christopher Lam
ceeb1dff7a
[scrub.c] g_value_unset
2021-06-05 00:21:21 +08:00
Christopher Lam
92cd437562
[Transaction.c] g_value_unset to release GValue string
2021-06-05 00:21:20 +08:00
Christopher Lam
3353d3950b
[gnc-budget] g_value_unset GValue
2021-06-05 00:20:23 +08:00
Christopher Lam
a3e3823ee7
[qofquery] q->terms g_list members must be freed
2021-06-03 17:16:09 +08:00
Christopher Lam
8a6413342d
[SchedXaction] free GList*
2021-06-02 22:04:54 +08:00
Christopher Lam
c5585ebe2c
[gncInvoice] free GList*
2021-06-02 22:04:52 +08:00
Christopher Lam
d611538ae7
[gncTaxtable] free GSList*
2021-06-02 22:04:33 +08:00
Christopher Lam
b3101c9385
[gnc-pricedb.c] plug GList leak
2021-06-02 20:09:45 +08:00
Christopher Lam
8a56a00313
Modify documentation for gncEntryComputeValue
...
Modify documentation for be19b489e
2021-06-01 08:14:25 +08:00
Robert Fewell
7ee9dac2e9
Add filter for currency symbol for GNCAmountEdit widget
...
When pasting an amount that includes the currency symbol the validation
will silently fail which may lead to unusual behaviour.
2021-05-31 11:11:01 +01:00
Robert Fewell
748dbf54e0
Change monetary value for gnc_default_share_print_info
...
Share values are not currencies so set the monetary value to 0 for the
GNCPrintAmountInfo
2021-05-31 11:11:01 +01:00
Robert Fewell
435bb1c76b
Parse the register monetary cells for a currency symbol
...
Add the ability to strip the currency symbol from a registry monetary
cell if it is pasted with one so it can be validated.
2021-05-31 11:11:01 +01:00
Robert Fewell
d55060c0fc
Bug 796761 - Control characters can be pasted in register fields
...
If copied text includes control characters they are inserted when
pasted which can cause alignment issues. This commit filters the
clipboard text for control characters before it is pasted.
2021-05-31 11:11:01 +01:00
Christopher Lam
f37fa85705
build dom_tree_to_list_kvp_value more efficiently
...
seems to be unused however
2021-05-30 11:09:39 +08:00
Christopher Lam
59386b4081
gchar* dom_tree_to_text must be g_freed
2021-05-30 08:10:19 +08:00
Christopher Lam
292deb0a11
[binreloc.c] free strings
...
subdir, prefix are not consistently freed.
2021-05-29 07:55:26 +08:00
Christopher Lam
d83eff3a55
Merge branch 'maint'
2021-05-28 08:00:20 +08:00
Christopher Lam
c1cb29df53
GncGUIDs should be freed with guid_free instead of g_free
2021-05-17 21:00:59 +08:00
Christopher Lam
b25a444140
Merge branch 'maint'
2021-05-14 21:16:48 +08:00
John Ralls
da3c511b6c
Remove trading splits instead of trying to adjust them.
2021-05-12 09:00:51 -07:00
John Ralls
4f030aac6e
Bug 798093 - Changing the symbol/abbreviation of a security...
...
after the trading account was created breaks GnuCash.
Revisited. The original changeset looked for a top level trading account
and a namespace account in the transaction currency; if either of those
accounts had been created in a different currency it would duplicate
them.
This commit will accept any such account regardless of commodity. If
more than one exists it will prefer the one in the root currency if
there is one, otherwise it will select the first one found.
2021-05-12 09:00:51 -07:00
John Ralls
18c72baddf
Don't bother scrubbing for orphans if there's no transaction currency.
...
If it found one it would try to create an orphan account with no
currency which will crash later.
2021-05-11 14:43:45 -07:00
John Ralls
2b48fd375d
Revert "Fix duplicate trading accounts."
...
This reverts commit ed486a58a4
.
2021-05-03 17:16:23 -07:00
Hong Xu
888676eb31
from_price and to_price may be uninitialized in extract_comon_prices
...
Fix the compilation error on gcc 10:
gnucash/libgnucash/engine/gnc-pricedb.c: In function âextract_common_pricesâ:
gnucash/libgnucash/engine/gnc-pricedb.c:2469:40: error:
to_price may be used uninitialized in this function [-Werror=maybe-uninitialized]
2469 | if (from_price == NULL || to_price == NULL)
| ^
gnucash/libgnucash/engine/gnc-pricedb.c:2469:20:
error: âfrom_priceâ may be used uninitialized in this
function [-Werror=maybe-uninitialized]
2469 | if (from_price == NULL || to_price == NULL)
| ^
2021-04-29 14:51:07 -07:00
Christopher Lam
ae7eb9b3ad
[gnc-pricedb] extract common code into get_nearest_price
...
Extracts common code in:
* gnc_pricedb_get_nearest_before_price
* gnc_pricedb_get_nearest_price
* gnc_pricedb_get_latest_price
2021-04-26 07:16:25 +08:00
Christopher Lam
a2f5223148
[gnc-pricedb] use g_list_find and plug memory leak
...
found_coms was not being freed.
2021-04-26 07:16:25 +08:00
John Ralls
ed486a58a4
Fix duplicate trading accounts.
...
In many cases GnuCash would create a new trading account hierarchy
when one already existed because gnc_account_lookup_by_type_and_commodity
didn't check the account presented and didn't recurse down the
account hierarchy correctly.
2021-04-24 15:51:32 -07:00
John Ralls
2258e7a44e
xaccAccountTypes was backwards
...
vs. the documentation. The unit tests and dialog-account were similarly
backwards, but the use in gnucash/import-export/ofx followed the docs.
2021-04-24 15:51:32 -07:00
Christopher Lam
5ce8f78f77
Merge branch 'maint'
2021-04-24 23:16:22 +08:00
Robert Fewell
e535ba5411
Change some functions to use const gnc_commodity for gnc_pricedb
2021-04-23 11:56:15 +01:00
Robert Fewell
e75308e684
Rename a couple of gnc-pricedb functions that have not been used.
...
To be more consistent change gnc_pricedb_lookup_latest_before_t64 and
gnc_pricedb_lookup_latest_before_any_currency_t64 to be of the form
'_nearest_before_' and add a missing utest.
2021-04-23 11:56:15 +01:00
Robert Fewell
d3bd7fda61
Add unit tests for new gnc-pricedb functions
2021-04-23 11:56:15 +01:00
Robert Fewell
4a491f7cde
Change a couple of docbook definitions in gnc-pricdb.h
2021-04-23 11:56:15 +01:00
Robert Fewell
05507008c5
Add retrieval functions for price before the date given
...
Add a new function, gnc_pricedb_convert_balance_nearest_before_price_t64
that retrieves the balance using the last price dated before a
specified date like today for the preset value. This uses another new
function gnc_pricedb_get_nearest_before_price to do the retrieval.
2021-04-23 11:56:15 +01:00
Robert Fewell
b54c30e03d
Bug 798148 - Chart of Accounts page Present(xxx) value wrong
...
If for some reason you have price information in the future for a
security, the present value is based on the price retrieved for the
greatest date and not a price which is before the current date.
To fix this use the 'xaccAccountGetBalanceAsOfDateInCurrencyRecursive'
function.
2021-04-23 11:56:15 +01:00
John Ralls
bbb4113a5a
Bug 798156 - glib 2.68.0 breaks gnucash
...
Move all of the #include <glib> to before the extern "C" blocks
so that the include guards will protect against headers inside
the extern "C" block also including glib.h.
2021-04-20 11:03:23 -07:00
John Ralls
f7f35faefe
Bug 797928 - Since last run asks for security price when no shares traded
...
Refactor a bit to ensure that the same price variable names and transaction
currency is used for both extracting the variables and retrieving
any required exchange rates, and that splits with no formula are
ignored in both cases.
2021-04-19 14:25:59 -07:00
Robert Fewell
33b8a19253
Add depreciation warnings for the removal of individual option tool tips
2021-04-18 12:17:51 +01:00
Robert Fewell
02a6a0ae4a
Remove the function gnc_option_permissible_value_description
...
Remove function and scheme using this function which deals with
individual tool tips on multi-choice options.
2021-04-18 12:17:51 +01:00
John Ralls
4eaa10c6be
Another extern-C glib.h, for Windows this time.
2021-04-13 16:56:55 -07:00
Christopher Lam
67e65d436c
Remove duplicate definitions
2021-04-02 09:37:14 +08:00
Christopher Lam
9b671b2039
[date-utilities.scm] remove unused date selectors code & string
2021-03-30 18:09:44 +08:00
Christopher Lam
b06ee5efaf
Merge branch 'maint'
2021-03-30 18:09:08 +08:00
Christopher Lam
d316b01da7
[date-utilities] deprecate unused date selectors
2021-03-29 20:14:18 +08:00
Christopher Lam
d28ff20ff7
Merge branch 'maint'
2021-03-29 17:29:19 +08:00
Geert Janssens
a4cab54afc
i18n - Reuse strings for less translation work
2021-03-28 20:51:19 +02:00
John Ralls
170502c6c5
Bug 797906 - GnuCash data file is locked after a "save-as"...
...
to mysql database.
It's more general, any save-as to a different backend type, i.e.
xml->sql or sql->xml, left the previous book locked.
Ensure that the session is ended and the book unlocked in the
backend's destructor. This also fixes a memory leak in the SQL
backend because the GncSqlConnection wasn't being deleted.
2021-03-23 11:27:37 -07:00
John Ralls
27435b1038
Don't filter use of TTInfo file section based on sizeof time_t.
...
The whole point of GncDateTime is to work around 32-bit time_t.
2021-03-22 14:23:23 -07:00
John Ralls
b40589244c
Fix test-gnc-datetime failure on Ubunutu.
2021-03-22 14:18:24 -07:00
John Ralls
c49b45d8f1
Finish the glib 2.67 fixes for CI tests.
2021-03-22 14:02:37 -07:00
Geert Janssens
e9dfd0d9ea
Still more fixes for Arch ci failure
2021-03-22 21:30:41 +01:00
Geert Janssens
cb04365013
More fixes for Arch ci failure
2021-03-22 21:14:34 +01:00
John Ralls
1221d7ebc1
Bug 798150 - Error on report over time
...
Extract functions LDT_from_date_time and LDT_from_date_daypart
to avoid duplicate code. Handle date-times in start-of-DST transitions
and better handle those in end-of-DST transitions. Test the results.
2021-03-21 15:55:08 -07:00
John Ralls
ebb5eb1f17
Fix GncDateTime::format_zulu to emit the UTC timezone.
...
Instead of the GncDateTime's timezone with the UTC timestamp.
2021-03-21 15:55:08 -07:00
John Ralls
3a35514d84
Fix the implementations of gnc_foo_get_day_neutral.
...
As implemented these returned 10:59 AM local on the day but neutral
time is 10:59 UTC.
2021-03-20 09:45:38 -07:00
Christopher Lam
2a2f080813
Merge branch 'maint'
2021-03-18 07:36:40 +08:00
Geert Janssens
fbabcd58e0
Remove dead code
2021-03-17 16:24:22 +01:00
Geert Janssens
b9208eccbf
Remove duplicate declaration
...
The function is also declared and defined in gnc-locale-utils
2021-03-17 16:24:22 +01:00
Geert Janssens
e973a1b60d
Drop default locale currency special case for euro
...
The condition mentioned in the comment no longer applies.
All European locales on Windows (MingW64) properly present EUR
as currency these days
2021-03-17 16:24:22 +01:00
Frank H. Ellenberger
4a983761d7
Fix a typo in a comment of the last commit
2021-03-16 06:34:08 +01:00
John Ralls
a11065b823
Fix fencepost error in calculating the week_num for POSIX timezone rules.
...
Fixes CI failure caused by US starting DST in 2021, a year in which
March began on a Monday.
2021-03-15 17:07:16 -07:00
John Ralls
a6276708c0
Bug 797630 - Check for missing dependencies of 'Get Quotes'...
...
to avoid Gnucash crash.
We already did, just not in the right order to get the error to
percolate up to price-quotes.scm.
2021-03-14 10:48:25 -07:00
John Ralls
8e41857014
Catch more exceptions in gnc_numeric_convert
...
To enable fixing https://bugs.gnucash.org/show_bug.cgi?id=798132 .
2021-03-12 13:47:24 -08:00
Christopher Lam
87473ed5f9
Merge branch 'maint'
2021-03-12 23:14:51 +08:00
Dong Lin
75209c024f
Update price database for imported transactions
...
When a transaction is added from the ledger, price database is updated properly.
But if the transaction is imported, there is no price db update.
This change adds the proper pricedb update in the import path (qfx/ofx/qif).
Tested with make check
2021-03-09 10:39:56 -08:00
Sumit Bhardwaj
df579c257b
Replace g_memdup by memcpy
...
GLib is deprecating g_memdup. Since older versions of GLib
wouldn't have g_memdup2, this PR replaces occurrences of
g_memdup by memcpy.
2021-03-08 15:14:17 -08:00
Christopher Lam
3739d9121c
[date-utilities.scm] typo fix and deprecate unused functions
2021-03-07 13:35:39 +08:00
Frank H. Ellenberger
93e2829ee5
Merge PR #899 into maint
2021-03-02 01:17:26 +01:00
luz paz
16b4976381
Fix typos in libgnucash/
...
Found via `codespell -q 3 -L ans,ba,parm,parms,numer`
2021-03-02 01:15:32 +01:00
Christopher Lam
e79db92d8d
[Split.c] xaccSplitListGetUniqueTransactionsReversed
...
Same as xaccSplitListGetUniqueTransactions but doesn't reverse the
list prior to returning. To be used by gnc-tree-model-split-reg.c
Several optimizations
* doesn't call g_list_find and g_list_append for every iteration
* uses g_hash_table to cache list of txns already added instead of g_list_find
* does not reverse the result, thereby returning a reversed list.
2021-02-24 09:08:25 +08:00
Christopher Lam
b2b8792110
prepend-and-reverse instead of O(N^2) append
2021-02-24 09:08:25 +08:00
Frank H. Ellenberger
6bc8679932
I18N: replace several spourious spaces
2021-02-22 17:56:50 +01:00
Alex Aycinena
9d74333d82
2nd Update Form/Schedule line references for 2020 for the US Income Tax Report.
2021-02-16 18:41:20 -08:00
Alex Aycinena
320e84b990
Update Form/Schedule line references for 2020 for the US Income Tax Report.
2021-02-16 16:21:31 -08:00
John Ralls
7a7c26f87e
Move glib and gtk includes out of extern C for tests.
...
Needed to compile with glib 2.67 and later.
2021-02-16 13:23:48 -08:00
Bill Nottingham
c0f2c3ae25
Fix build with glib2 2.67.x.
...
glib headers should not be included with 'extern "C"'.
2021-02-16 13:23:16 -08:00
Christopher Lam
092040c7fe
Merge branch 'maint'
2021-02-16 18:44:02 +08:00
John Ralls
4359243c08
Move glib and gtk includes out of extern C for tests.
...
Needed to compile with glib 2.67 and later.
2021-02-15 12:37:09 -08:00
Christopher Lam
779c0521e0
[options.scm API] yank canonically-tabbed parent-subtotal-mode
...
'canonically-tabbed option is buggy and has never graduated out of
experimental for 17 years. Time to put it to rest.
All previous saved reports with this option will be switched to 't
i.e. parent-subtotal-mode enabled..
2021-02-15 08:59:50 +08:00
Bill Nottingham
f60b6354f8
Fix build with glib2 2.67.x.
...
glib headers should not be included with 'extern "C"'.
2021-02-13 16:35:27 -05:00
Christopher Lam
c20a588e0f
Don't use g_list_append unnecessarily
2021-02-10 07:09:02 +08:00
John Ralls
ba0e412815
Bug 798112 - An error occurred while processing mysql ...
...
A "Feature" of MYSQL is that it allows C-style backslash escapes
in string constants and replaces them with the actual character
(e.g. \n is converted to 0x0a). This causes round trip problems
if the escape is one of the allowed ones and a MYSQL error if it
isn't.
Disable the feature so that MYSQL follows the SQL standard.
2021-02-07 13:53:00 -08:00
John Ralls
fe4f9ed64a
[test-backend-dbi] Fix copying hidden property.
...
So that it actually copies it to the *other* root account.
2021-02-07 13:50:29 -08:00
Micha Lenk
9386b276e5
Make prototypes static for autoclear unit test
...
With the explicit prototypes not marked as static unit test builds on Debian
Buster (using buster-backports) fail with
error: testing::internal::ParamGenerator<TestCase*> gtest_InstantiationAutoClearTestAutoClearTest_EvalGenerator_() was declared extern and later static [-fpermissive]
According to the comment preceding the declaration the only intent of the
explicit prototype (in newer versions of googletest implicitly defined by the
GTEST macros) seems to be to silence a warning which would cause a build
failure on Ubuntu 18.04 when using -Werror.
Builds on Debian unstable seem to build just fine without this explicit
declaration, hence I consider it safe to just drop it. However, builds on
Ubuntu 18.04 then fail (see above).
Making the prototypes as static should make both build environments happy.
2021-02-07 13:50:29 -08:00
Christopher Lam
0d196bfb65
Merge branch 'remove-scheme-deprecated-module' #891
2021-02-01 21:43:59 +08:00
Frank H. Ellenberger
f556ad35ef
Merge branch 'maint'
2021-01-31 23:17:19 +01:00
John Ralls
12ad4fadae
Bug 798101 - Do not #undef __STRICT_ANSI__
...
Remove defines and undefines for Windows, they were needed with
MinGW classic but are not with MinGW-w64.
2021-01-30 17:38:37 -08:00
Christopher Lam
d16f39046d
Merge branch 'maint'
2021-01-30 07:13:32 +08:00
Christopher Lam
bbcffa3eca
Remove deprecated scheme modules
2021-01-30 00:42:20 +08:00
John Ralls
0f8d9f6d7c
Bug 798093 - Changing the symbol/abbreviation of a security after...
...
the trading account was created breaks GnuCash.
Introduces a new function, gnc_account_lookup_by_type_and_commodity
that does that, though it also looks at name for the one special case
of finding/creating the Namespace placeholder account. Adds a parameter
checkname to xaccScrubUtilityGetOrMakeAccount to flag whether to look
for the name.
Namespaces aside this makes it possible for the user to rename trading
accounts or securities independent of each other.
2021-01-27 17:44:21 -08:00
John Ralls
bcbebe62b1
Make xaccScrubUtilityGetOrMakeAccount static and remove ScrubP.h
...
It being the only declaration in ScrubP.h
2021-01-27 17:44:21 -08:00
Christopher Lam
2fa5cba250
Merge branch 'maint'
2021-01-25 22:25:20 +08:00
John Ralls
b66eab2583
Bug 798100 - Equity totals calculating incorrectly
...
Prevents creation of non-currency opening balance accounts.
2021-01-24 16:53:02 -08:00
Christopher Lam
ddc86579c0
Merge branch 'master-remove-deprecated' #855
2021-01-24 09:25:08 +08:00