Commit Graph

16652 Commits

Author SHA1 Message Date
John Ralls
78b5b7cb5b Convert gnc-slots-sql.cpp to use the Kvp C++ API.
Plus a few minor C++11 tweaks.
2015-07-03 17:13:14 -07:00
John Ralls
7c4e1f7f2a Fix slash handling in keys.
In actual use '/' is a path delimiter indicating a child KvpFrame. The
previous implementation created keys for single frames with embedded '/'
characters.

Memory management issues in make_vector necessitated changing Path to a
std::vector<std::string>>.
2015-07-03 17:13:13 -07:00
John Ralls
0987184709 Add path-vector get/set functions to KvpFrameImpl.
Needed for Scheme access. The C functions used GList.
2015-07-03 17:13:13 -07:00
John Ralls
45a01b0f67 Change the KVP string storage type from char* to const char*.
Because we don't want to be able to get a pointer to the KvpValue and
change its contents without using KvpValue::set().
2015-07-03 17:13:13 -07:00
John Ralls
831a360122 XML Backend:Replace C KVP function calls with C++. 2015-07-03 17:13:13 -07:00
John Ralls
ab30b4c680 Remove #include "kvp_frame.h" from qof.h and add it where it's legitimately used. 2015-07-03 17:13:13 -07:00
John Ralls
c721bf9f48 Remove the unused backend-configuration member and virtual setter/getters.
Not used, and if it was it would be an inappropriate use of KVP.
2015-07-03 17:13:13 -07:00
John Ralls
3956ee0f01 Remove the rest of the KVP direct-query functions. 2015-07-03 17:13:13 -07:00
John Ralls
171669ec68 Change io-gncxml-v2.c to C++. 2015-07-03 17:13:13 -07:00
John Ralls
435aef03b7 Isolate direct KVP operations.
Into sixtp-dom-parser, sixtp-dom-generator, and gnc-slots-sql.
The XML V1 file io-gncxml-v1.c is not yet done.
2015-07-03 17:13:13 -07:00
John Ralls
13377f56d5 Cpp files in CMakelists.txt. 2015-07-03 17:13:13 -07:00
John Ralls
55e4d30a44 Pass QofInstance instead of KvpFrame to gnc_sql_slots_save. 2015-07-03 17:13:13 -07:00
John Ralls
8b53483562 Change gnc-slots-sql, sixtp-dom-generators, and sixtp-dom-parsers to C++.
So that they'll be able to use the C++ Kvp classes.
2015-07-03 17:13:12 -07:00
John Ralls
9b3f6078fc Abstract options handling to QofBook.
Eliminates direct KVP access in app-utils, all of which centered around
options.

Beneficial side effect: With all option writes now handled by
qof_book_set_option(), the problem of options not being committed is
eliminated.

The options system is unnecessarily complex, with much back-and-forth
between C and Guile. It needs to be completely rewritten, but that's a
project for its own branch.
2015-07-03 17:13:12 -07:00
John Ralls
fa22188549 Remove gnc:kvp-option-dialog, make gnc_make_kvp_options static.
gnc:kvp-option-dialog is unused, was only external user of gnc_make_kvp_options.
2015-07-03 17:13:12 -07:00
John Ralls
cb9d8c93b7 Use gnc:company-info instead of directly accessing the KVP in reports. 2015-07-03 17:13:12 -07:00
John Ralls
095d1781f0 Remove a couple of distracting comments about KVP. 2015-07-03 17:13:12 -07:00
John Ralls
61ecdda845 Miscellaneous KVP cleanup.
Everything but the backends and app-utils.
2015-07-03 17:13:12 -07:00
John Ralls
a4c748e201 Miscellaneous KVP cleanup in Engine.
Doesn't include tests or Scheme support.
2015-07-03 17:13:12 -07:00
John Ralls
f631f6e6c5 Fix formatting, line too long. 2015-07-03 17:13:12 -07:00
John Ralls
68dedc1ba2 Reimplement gnc_template_register_get_debcred_entry.
So that it at least returns something reasonable. Note the comment, though.
2015-07-03 17:13:12 -07:00
John Ralls
43e93e5fb5 Modify gnc_imap... functions to use KVP indirectly, provide unit tests. 2015-07-03 17:13:12 -07:00
John Ralls
ccd74059a2 Implement qof_instance_for_each_slot().
Wraps kvp_frame_for_each_slot().
2015-07-03 17:13:12 -07:00
John Ralls
dcc9bfec36 Reimplement AQBanking template list in C++ and in libqof.
It requires direct manipulation of KVP, so it needs to be hidden away in
libqof.
2015-07-03 17:13:12 -07:00
John Ralls
b4e0240783 Make the instance const in qof_instance_get_kvp(). 2015-07-03 17:13:12 -07:00
John Ralls
4f4711c564 Convert Scrub.c from using direct KVP to routing them through qof_instance. 2015-07-03 17:13:12 -07:00
John Ralls
232dd4c0dc Provide qof_instance with functions to delete slots. 2015-07-03 17:13:11 -07:00
John Ralls
eb2d556086 Move initializing the GValue to the correct type to qof_instance_set_kvp.
And ensure that all returns are checked to be the expected type.
2015-07-03 17:13:11 -07:00
John Ralls
57ba97422d Rename the hash-table functions so that they don't contain "kvp".
They don't have anything to do with KVP. What were they doing in kvp-utils
in the first place?
2015-07-03 17:13:11 -07:00
John Ralls
50bb5c162a Remove "FIXME" comments about KvpFrame in SX-ttinfo.c.
SX splits and regular splits have different requirements for Kvp. A
regular split's Kvp contains information that applies to that one split
alone so it would be a mistake to propagate it into SX. Meanwhile the SX
split puts its formulas in Kvp, and we certainly don't want those going
into regular splits.
2015-07-03 17:13:11 -07:00
John Ralls
cadd1976df Remove kvp-utils.
No longer required.
2015-07-03 17:13:11 -07:00
John Ralls
c941a52a9f Copy GHash/KVP functions from kvp-util to the one place they're used. 2015-07-03 17:13:11 -07:00
John Ralls
c2d44b89fb Replace Scrub2 direct KVP access with Split lot-guid accessors. 2015-07-03 17:13:11 -07:00
John Ralls
d86a0b2378 Replace the lot-split and peer_guid properties with accessor functions.
The properties weren't backwards compatible with existing books, nor
would they work in the multiple-peers case.
2015-07-03 17:13:11 -07:00
John Ralls
db5317f80f Rewrite the gnc_kvp_bag functions in qofinstance.
They were over general and were used in only one place not in QOF.
2015-07-03 17:13:11 -07:00
John Ralls
1bd6afe384 Move KVP_TYPE_BOOLEAN to the end of the enum.
So that it doesn't change the numeric values of other entries, which
would introduce a database incompatibility.
2015-07-03 17:13:11 -07:00
John Ralls
ac29ad3cef Remove direct query of KVP.
Wasn't actually used anywhere, and it's not something we want to
support.
2015-07-03 17:13:11 -07:00
John Ralls
45e41a07b1 Convert gnc-budget, gnc-lot, and gncJob to qof_instance_foo_kvp. 2015-07-03 17:13:11 -07:00
John Ralls
39c521512b Provide qof_instance_has_kvp(); used for feature testing. 2015-07-03 17:13:11 -07:00
John Ralls
97b44a71ec Convert all Split kV operations to use qof_instance_foo_kvp().
Except for clearing the KVP Frame, which we do by calling qof_instance_dispose().
2015-07-03 17:13:11 -07:00
John Ralls
97031fa62a Correct the kvpvalue type for lot-split in test_xaccSplitOtherSplit. 2015-07-03 17:13:11 -07:00
John Ralls
eccdfd0aa3 Convert all Transaction KVP operations to use qof_instance_foo_kvp. 2015-07-03 17:13:11 -07:00
John Ralls
542557724c Convert almost all Account KVP operations to use qof_instance_foo_kvp.
Can't do the import-matcher stuff, it's a bit too hard-wired to KVP.
2015-07-03 17:13:10 -07:00
John Ralls
c9785be334 Provide qof_instance_copy_kvp, qof_instance_swap_kvp, and qof_instance_compare_kvp.
To facilitate abstracting all kV operations to libqof/qof.
2015-05-08 13:31:56 -07:00
John Ralls
32d4fff366 Implement KVP_TYPE_BOOLEAN
In terms of KVP_TYPE_STRING such that TRUE->"true" and FALSE->NULL. This
provides compatibility with the existing boolean KVP in Account.c.
2015-05-07 16:12:54 -07:00
John Ralls
31cfa0a9f0 Merge branch 'maint' 2015-06-30 12:42:36 -07:00
John Ralls
3d8b58a1be Change gtkmacintegration-gtk2 include directory back to gtkmacintegration.
As of gtk-mac-integration-2.0.8.
2015-06-30 12:33:25 -07:00
Alex Aycinena
5fdf14f8cb Book-Currency Feature Step 3
Add an option to the File->Properties dialog to select a Currency Accounting Method, and to specify the book-currency and a default gains/loss policy if the 'book-currency' method is selected.
Revert some changes made in prior commits. Other than storing and retrieving the
book-currency and policy in book KVPs, the behavior of gnucash has not been
affected by these changes. The changes made are:

     engine/policy.c & .h - define valid policies and their descriptions
         and hints; define functions gnc_get_valid_policy_list and
         gnc_valid_policy
     engine/engine.i - include policy.h; define 'CURRENCY-ACCOUNTING',
         'BOOK-CURRENCY', and 'DEFAULT-GAINS-POLICY' as option names
     engine/test/utest-Split.cpp - revert prior commit that modified test
         function for trading accounts
     engine/test/utest-Transaction.c - revert prior commit that modified test
         function for trading accounts
     libqof/qof/qofbookslots.h - revert prior commit that defined Currency
         Accounting Method; modify definitions of Currency Accounting and Book
         Currency; add definition of default gains policy; keep the previous
         Trading Accounts definition
     libqof/qof/qofbook.cpp & .h - reverted function to determine currency
         accounting method; add function to get book-currency, revert
         previously committed changes to function to determine if book uses
         trading accounts; add function to get gains policy; modify gobject
         properties accordingly
     libqof/qof/test/test-qofbook.c - revert prior modification to test
         function for trading accounts; define tests for book-currency and
         default gains policies
     app-utils/options.scm - define make-currency-accounting-option and
         required support functions
     app-utils/options-util.c & .h - make support functions of
         make-currency-accounting-option available in c code
     app-utils/test/test-options-util.c - include tests for using book-currency
     app-utils/gnc-ui-util.c & .h - define gnc_book_use_book_currency,
         gnc_book_get_book_currency and gnc_book_get_default_gains_policy
         functions
     app-utils/test/test-gnc-ui-util.c - set up tests for new gnc-ui-util
         functions
     app-utils/test/test-app-utils.c - include test-gnc-ui-util.c
     app-utils/test/Makefile.am - include test-gnc-ui-util.c
     app-utils/app-utils.scm - define and export book options for Currency
         Accounting, Book-Currency and Default Gains Policy; export required
         currency-accounting-option support functions
     app-utils/business-prefs.scm - replace the Trading Accounts boolean option
         with a currency-accounting-option and rearrange the order of the
         options
     gnome-utils/dialog-options.c - define functions for set-ui-widget,
         set-ui-value, and get-ui-value for 'currency-accounting' option and
         various other support functions
2015-06-27 16:06:56 -07:00
John Ralls
757a50c9ec Release 2.6.7 2015-06-27 11:31:44 -07:00
John Ralls
df6326f7f3 Get latest translations from the Translation Project. 2015-06-27 10:44:44 -07:00