src/backend/sql/gnc-transaction-sql.cpp:
Move inclusion of escape.h out of extern "C" block since
escape.h is now C++ code.
src/backend/xml/gnc-backend-xml.cpp:
Move inclusion of gnc-pref.s out of extern "C" block since
gnc-pref.c is still plain C code.
Add new functions to get the number of prices and the get a price by
index for a given commodity. Use these instead of building a list of all
prices several times for each price.
1. Use guile-2.0 instead of guile-1.8.
2. Set GNC_PLATFORM_POSIX on Unix (for gnc_timezone.cpp).
3. Pass guile include files when compiling cutecash.
4. Link Boost libraries.
5. Add -std=gnu99 to CMAKE_C_FLAGS.
6. Temporarily put -O2 in CMAKE_C_FLAGS since Fedora requires
optimization for FORTIFY_SOURCE. (Eventually with CMake
we will have separate Debug and Release builds.)
Tested that cutecash builds and launches on OS X, Fedora 23 and Ubuntu 14.04.3.
Opening my accounts file took over 10 minutes before this change, most of
it spent populating the account balances in account tree, and most of that
spent in g_sort_list. Expanding or collapsing subtrees in the account tree
also took several seconds. This change reduces the use of g_sort_list and
reduces the length of lists sorted when it is used. Opening the file is
now only a few seconds slower than before the PriceDB changes.
This patch renames the Imap functions in Account.c and
adds them to the .h file to make accessible. Also added
a delete function to the non Baysian functions along with
a test.
In several cases replaces attempting to check both directions directly. This
had produced incorrect results because an older forward price would be preferred
over a reverse price.
To invert a price when it's currency is what we want to use as a commodity.
Generalizes the source-type PRICE_SOURCE_INVOICE to PRICE_SOURCE_TEMPORARY
for all cases like this where we don't want to save the price.
Currency exchange rates can be recorded in either direction depending upon
which one provides the larger fraction. Queries therefore need to check
both directions when creating the date-ordered list for selecting latest,
nearest in time, or latest before.
Gnc-fq-helper will flip currency price quotes if the one requested is < 1
or not available, which might mean that it's not representable in 4 digits
to the right of the decimal.
Some currencies quotes are one-directional, so check both directions if
necessary. Quotes with values < 1 often have too few significant digits,
so in that case use the other direction if available.
Poaching someone else's macro name is a really dumb idea, because aclocal
looks in our macros directory only if it can't find the macro in the system
directories. Our config code doesn't work with Gnome's macro, it exports
WARN_CFLAGS rather than modifying CFLAGS directly the way ours does.
The problem is that QofBook is not a well-formed GObject and doesn't clean
itself up properly when its ref count goes to zero. qof_book_destroy() must
be explicitly called on it. An interesting side effect is that QofObject
keeps a list of all of the books ever opened and not properly destroyed and
registering a class (in this case GNCPriceDB) tries to create that class's
instance in all of those leaked books. Since they already have one, the
instantiation code raises a critical error and the test program fails.