Commit Graph

253 Commits

Author SHA1 Message Date
John Ralls
34cc103e94 Add doxygen target. 2018-01-25 13:45:02 -08:00
Geert Janssens
52b0c06d30 Merge branch 'maint' into unstable
Conflicts:
- gnucash/gnome-utils/gnc-main-window.c
  I have chosen to ignore the changes pulled in from maint. The same change will
  be reimplemented in a followup commit.
- po/ru.po
  Same here. The translation conflicted too much and there's a
  translation update available for unstable I will pull in soon.
2018-01-25 10:24:53 +01:00
John Ralls
1fc46fe140 Fix some dependency-checking failures.
Thanks to Robert Merkel for reporting them.
* Build gnucash-design.info if makeinfo is available, but don't complain
  if it isn't.
* Fail Cmake if LibXSLT and xsltproc aren't found. Those are required to
  build the gschemas and GnuCash won't work without them.
* Fix the WebKit detection so that it isn't faked out into thinking it has
  WebKit2Gtk-4.0 when it's WebKit2Gtk-3.0 and cmake is run with a
  CMakeCache.txt present.
2018-01-23 16:04:28 -08:00
Christopher Lam
ca22d5531b Change gnc_pricedb_convert_balance_nearest_price from timespec to time64. 2018-01-20 16:40:45 -08:00
John Ralls
74ddb671e4 Merge Chris Lam's and Aaron Laws's branch 'time64-ftw' into unstable. 2018-01-20 12:40:32 -08:00
John Ralls
91f4b19039 Convert python bindings from timespec to time64. 2018-01-20 12:35:04 -08:00
John Ralls
6ffb77de20 Merge branch Rob Gowin's 'bye_bye_autotools' into unstable. 2018-01-18 12:02:56 -08:00
Geert Janssens
2364c5607f Merge branch 'maint' into unstable
Resolved conflicts:
	gnucash/gnome-search/dialog-search.c
	gnucash/gnome-utils/gnc-splash.c
	gnucash/import-export/aqb/gnc-plugin-aqbanking.c
	gnucash/import-export/import-account-matcher.c
	po/de.po
	src/report/standard-reports/budget-barchart.scm
	src/report/standard-reports/budget.scm

Note the de.po conflict was resolved by dropping all changes
and merging the file again with gnucash.pot (generated after
the merge but before committing).
2018-01-17 18:08:05 +01:00
John Ralls
26fa2acfd5 Use a more appropriate comparison for doubles. 2018-01-16 17:24:29 -08:00
John Ralls
8f96882ead Remove tests checking members of deleted objects.
GLib's scribbling of freed memory is enabled on Arch so attempting to
read the deleted members of inst and book crash instead of reaturning
invalid results. These weren't really useful tests anyway.
2018-01-16 17:24:29 -08:00
John Ralls
8900b19da3 Bug 790845 - 2.7.3: massive test failures on some architectures (reopened).
Fix some test failures caused by erroneous size assumptions.
2018-01-14 16:31:22 -08:00
Rob Gowin
54ac7f23e0 Remove Autotools 2018-01-13 12:52:57 -06:00
Christopher Lam
cc097a3f35 [mod|inc|dec]date64 API rename back to date
This commit mass renames new t64 API back to the original names.
2018-01-11 21:07:02 +11:00
John Ralls
ebbcd30f39 Save Changes Bug 792106 - Wrong dates displayed
The first attempt to fix this, a17bc85a, doesn't work because the
boost::date_time constructor gets enough information in most cases to
generate a date, just not the one we expect. This change looks for '-' in
the fourth position and if it's there assumes iso-extended format, otherwise
it assumes delimiter-less ISO without the 'T', i.e. %Y%m%d%H%M%S.
2018-01-09 14:58:43 -08:00
John Ralls
fcf88262ca Extract function tz_from_string.
Also changes from calculating the Bug 767824 offset to using
boost::date_time::local_time_in() and provides unit tests.
2018-01-09 14:08:42 -08:00
John Ralls
be02abc866 Merge branch 'remove-portfolio-dist' of https://github.com/codesmythe/gnucash into unstable 2018-01-09 09:49:45 -08:00
Christopher Lam
ee8f9053e8 REMOVE-TIMEPAIR: libgnucash/app-utils/app-utils.scm & date-utilities.scm
This commit removes timepair API functions defined in date-utilities.scm
2018-01-08 22:56:50 +11:00
Christopher Lam
465c9e1f21 ADD-TIME64-API: libgnucash/engine/gnc-pricedb.[ch]
gnc_pricedb_lookup_nearest_in_time64
gnc_pricedb_lookup_nearest_in_time_any_currency_t64
2018-01-08 22:56:49 +11:00
Christopher Lam
fb2ed010e7 TP->T64: libgnucash/scm/price-quotes.scm 2018-01-08 22:56:49 +11:00
Christopher Lam
dda0695285 ADD-TIME64-API: libgnucash/engine/gnc-pricedb.[ch] 2018-01-08 22:56:49 +11:00
Christopher Lam
46c9fcc8f8 TP->T64: libgnucash/engine/test/test-split.scm 2018-01-08 22:56:49 +11:00
Christopher Lam
fefea400ce TP->T64: libgnucash/engine/engine-interface.scm 2018-01-08 22:56:49 +11:00
Christopher Lam
b53aa85660 TP->T64: libgnucash/engine/test/test-extras.scm 2018-01-08 13:01:29 +11:00
Christopher Lam
d41ad85f0a TP->T64 COMPATIBILITY SHIM: gnucash/libgnucash/app-utils/options.scm
This commit adds a compatibiliy shim. Although the rest of gnucash
can be converted to time64, this shim allows a Gnucash session to
load reports saved with timepairs.
2018-01-08 13:01:29 +11:00
Christopher Lam
7550ccf537 date-utilities.scm: optimize leapyear calc 2018-01-08 13:01:29 +11:00
Christopher Lam
33a7bb73db Bugzilla 790526 Correct weeknum calculator
This change will fix 'num-of-weeks-since-1/jan/1970' which formerly used quotient to remove
the fractional part of the division. For negative values of num-of-weeks, the number is truncated
in the wrong direction (i.e. towards 0). This change uses floor instead to ensure the num-of-weeks
found is the nearest integer LESS than the fractional number.
2018-01-08 13:01:29 +11:00
Christopher Lam
335165104b ADD-TIME64-API: libgnucash/app-utils/app-utils.scm & date-utilities.scm 2018-01-08 13:01:29 +11:00
lmat
e6ee060121 Adding bill term time64 function 2018-01-08 13:01:29 +11:00
lmat
6dc982c2c6 Some time64 corrections
The build system isn't always catching changed files, so these showed up
later.
2018-01-08 13:01:29 +11:00
lmat
1f050fd1e5 Transaction members Timespec->time64 2018-01-08 13:01:29 +11:00
lmat
9a86dd222b gncInvoice uses time64 2018-01-08 13:01:29 +11:00
lmat
598cb6d861 gncEntry members timespec->time64 2018-01-08 13:01:29 +11:00
lmat
5dd12119b7 Converted timespec_to_dom_tree to time64 2018-01-08 13:01:29 +11:00
lmat
f77369bb96 Removing timspec from some xml parsing
And several other sprawling references that are connected in one
way or another.
2018-01-08 13:01:29 +11:00
lmat
7390396af9 added gnc-dmy2time64* functions 2018-01-08 13:01:29 +11:00
lmat
588fcb6ed2 Transaction getVoidTime uses time64. 2018-01-08 13:01:29 +11:00
Christopher Lam
978ec61f98 Further scheme conversion to gdate to use time64
Add missing time64_to_gdate
2018-01-08 13:01:29 +11:00
lmat
0bf0989aa7 Add time64 functions for gncEntry 2018-01-08 13:01:29 +11:00
lmat
dbd1473730 Adding time64 alternatives 2018-01-08 13:01:29 +11:00
lmat
b5aad8c7bb Renaming time64 function for consistency 2018-01-08 13:01:29 +11:00
lmat
61d4aaaf08 Adding some time64 alternatives 2018-01-08 13:01:29 +11:00
lmat
2f89e4595b timespec->time64 for gnc_budget_get_period... 2018-01-08 13:01:29 +11:00
lmat
95e31f982b Date option absolute now takes time64. 2018-01-08 13:01:29 +11:00
lmat
7d51089501 Changing scheme conversion to gdate to use time64 2018-01-08 13:01:29 +11:00
lmat
d36742d941 Removing uses of timespec 2018-01-08 13:01:29 +11:00
lmat
e947214960 Removing uses of timespec 2018-01-08 13:01:29 +11:00
lmat
168f6d6740 Removing unused timespec function 2018-01-08 13:01:29 +11:00
lmat
ee56f5df78 Adding some time64 API functions 2018-01-08 13:01:29 +11:00
John Ralls
502001cd7c Fix travis test failure: It seems the boost bug is fixed. 2018-01-07 16:46:25 -08:00
Rob Gowin
bee2925ecc Remove gnc-value-portfolio references from dist lists.
File itself was removed in c0fd3b3.
2018-01-05 10:09:40 -06:00
John Ralls
c0fd3b3165 Remove all references to the now-defunct Yahoo! quote retrieval
And make Alphavantage the default.
2018-01-02 10:43:49 -08:00
John Ralls
320c5211b0 Fix extra instance of test-test-extras* in install_manifest.txt
Allows xargs rm < install_manifest.txt to complete without error.
2017-12-31 16:34:48 -08:00
John Ralls
5823f1b2bb Prevent "Save before closing" dialog from appearing at startup.
Caused by simply loading the transaction report, which called
gnc-get-current-book and that it in turn creates a session if one
doesn't already exist.
2017-12-30 13:41:00 -08:00
John Ralls
d06ed7c1a8 Fix -Wsign-compare error. 2017-12-30 13:39:55 -08:00
John Ralls
3d2682ac04 Merge branch 'maint' into unstable 2017-12-30 13:39:21 -08:00
Geert Janssens
fd9474b55f Merge branch 'unstable-TR-plus' of https://github.com/christopherlam/gnucash into unstable 2017-12-29 22:47:44 +01:00
John Ralls
26b82b56e0 Fix Travis 'dangling else' warning. 2017-12-27 06:32:54 -08:00
John Ralls
bbd2df6a3b Bug 791848 - GC 2.6.x does not handle ISO dates introduced with GC 2.7.
Set a feature to prevent versions older that 2.6.20 from loading a
database from which they cannot read the dates. Ideally we would do this
only if the database is written to, but the current persistence design
includes committing back to the database during the load so the net
effect is that the flag would be set anyway.
2017-12-26 15:18:43 -08:00
John Ralls
91727525b9 Enforce -Werror on C++ files and fix resulting errors. 2017-12-26 15:18:43 -08:00
John Ralls
a6a46d7cdc Test struct tm* returns from gnc_gmtime and gnc_localtime
To ensure that we don't crash for dereffing a nullptr.
2017-12-26 15:10:05 -08:00
John Ralls
a17bc85a02 Enable reading undelimited YYYYMMDDHHMMSS time strings.
For backwards compatibility with 2.4 and 2.6 SQLite3 databases.
2017-12-23 15:40:21 -08:00
Christopher Lam
43cbe65282 REFACTOR:Move Void-status filter to filter tab
Also upgrade lookup-value Void Transactions now in Filter tab
2017-12-24 00:13:39 +08:00
Christopher Lam
8990553e2e ENH: Move Account matcher to Filter tab
This commit moves the Account matcher into the Filtering tab in preparation for further options
2017-12-24 00:13:39 +08:00
Christopher Lam
d93d4f68b0 options.scm: upgrade lookup-value to learn section changes 2017-12-24 00:13:39 +08:00
Geert Janssens
2f96b19c77 Merge branch 'fix_bayes' of https://github.com/limitedAtonement/gnucash into unstable 2017-12-23 15:10:48 +01:00
Geert Janssens
ddfd38d8c3 Remove cmake hoop to change file permissions
As we are using cmake's own configure_file command, it will just copy
the permissions of the input file, which is what we want here.
2017-12-23 14:07:25 +01:00
Geert Janssens
f11eab36d9 Replace GNC_CONFIGURE(2) with configure_file 2017-12-23 14:07:25 +01:00
John Ralls
19412de221 Fix use of guile function introduced in 2.0.10, not available in Ubuntu14.04.
Also generalize KVP type detection so that signed and unsigned values\nare appropriately converted.
2017-12-22 11:25:19 -08:00
John Ralls
e0300d3a62 Replace the gnc:numeric pair with normal Scheme rationals.
This allows direct conversion between Scheme numbers and gnc_numeric
without the performance or accuracy penalties arising from using doubles
as an intermediary.
2017-12-21 15:33:15 -08:00
John Ralls
7061803596 Remove SIGFIG rounding from price calculation.
Prices shouldn't be rounded except for display.
2017-12-21 15:33:15 -08:00
lmat
a80318ec5f Adding to version info to feature string 2017-12-21 13:19:01 -05:00
lmat
a23438d5fb Correct string cache code
string cache replace was incorrect and covered by gpointer casting.
2017-12-21 07:39:33 -05:00
lmat
805549ba24 Rename qofinstance function
This function was supposed to be renamed a while back. I had named it
this way for debugging purposes.
2017-12-21 07:39:33 -05:00
lmat
fbf4843f31 Changed bayes import map design
This commit introduces a new feature flag:
GNC_FEATURE_GUID_FLAT_BAYESIAN. It signifies that the bayes import map
data are stored flat and by guid. Any time bayes import map data are
accessed, they are converted if necessary.
2017-12-21 07:39:33 -05:00
lmat
f782be1a51 Code review responses
Using Aliases to represent cmplicated types
Corrected variable-sized array on stack
Using PascalCase for type names and aliases
2017-12-21 07:39:33 -05:00
lmat
3312fe2dcd Changed some constants to constexpr 2017-12-21 07:39:33 -05:00
lmat
29ad8ff9b0 Remove unused kvp function 2017-12-21 07:39:33 -05:00
lmat
4a88f05d11 kvp string: allocate enough space
We need to allocate enough space for the terminating null character.
Also, I double-checked the documents for std::basic_string::c_str () and
verified that it does guarantee the terminating null, so I put a comment
in the code that depends on that.
2017-12-21 07:39:33 -05:00
lmat
5b03182963 Correct kvp to_string typo 2017-12-21 07:39:33 -05:00
lmat
f260a01bfd Keep tokens as they are, don't translate them
Before, it was necessary to remove '/' from tokens so that they won't be
divided up within kvp. Now that kvp doesn't parse tokens, it's okay to
pass '/', and it's better not to translate user-provided tokens if at all
possible.
2017-12-21 07:39:33 -05:00
lmat
551549598a Corrected memory management issue 2017-12-21 07:39:33 -05:00
lmat
d9eebd332b Renaming functions to get rid of temporary name
_var_ was used to make sure I caught all references, but isn't intended
as a permanent name.
2017-12-21 07:39:33 -05:00
lmat
5636afc4a2 Kvp no longer parses entries looking for delimiters 2017-12-21 07:39:32 -05:00
lmat
2cda65e012 Added test for and corrected get_bayes_info 2017-12-21 07:39:32 -05:00
lmat
9d7ec35ce5 Removed qof_instance_set_kvp, qof_instance_get_kvp
And replaced them with versions that take lists of key path elements.
This is in an effort to eliminate the parsing of kvp keys.
2017-12-21 07:39:32 -05:00
lmat
eb6dad86e3 Fixed conversion problem
The conversion assumed there were only three levels to bayes import
map kvp: IMAP token, user-supplied token, GUID/account name. In
actuality, since user-supplied tokens could have the delimiter in them,
there could be several. This fix takes that into account like so:
IMAP token, potentially several user-supplied tokens, GUID/account name.

The import map is undergoing two conversions at the same time: account names
to guids and an hierarchical representation to a flat representation in KVP.
2017-12-21 07:39:32 -05:00
lmat
b3667c76fc Implement flat bayes kvp
The bayes data are stored in the KVP store. Before this commit, they are
stored under /import-map-bayes/<token>/<account guid>/count (where count
is the datum that "matters" in bayes matching).

The problem with this is that any token including the kvp delimiter
(currently '/') gets divided, and is not found correctly during bayes
kvp searching. The quickest solution to this is to replace all "/"
characters with some other character. That has been done, along with a
re-structuring of the bayes matching code to take advantage of c++
features to make the code more concise and readable.

Also modified some test functions to fix leaks and double-frees: the
same kvp value can't be in the kvp tree twice.

Also, when I added code to clean up after the tests, some things started
breaking due to double-delete. Apparently const_cast was hiding some
programming errors. Really? You don't say? When giving a GUID* to KvpValue,
the latter takes ownership of the former.
2017-12-21 07:39:32 -05:00
lmat
08aa0104ef Change kvp string representation
The nested representation was very noisy. Now, the string representation
shows one line per value with the full prefix which is also more
expressive than the old version.
2017-12-21 07:39:32 -05:00
lmat
34e0d6cfa0 kvp frame to template and correcting failure macro
The template avoids the need to cast to and from void*, and adds flexibility to
the targeted function's signature.

test-stuff.h defines a macro, "failure" which is used as an identifier
in the standard IO library, so I moved any inclusion of test-stuff.h to
the last include position so that "failure" wouldn't be defined before
the IO library was included.
2017-12-21 07:39:32 -05:00
lmat
eb6c741bf9 Account.c to Account.cpp
Since Account.c is now Account.cpp, the function signatures look a bit
different internally. The tests rely on function signatures in error
messages. Instead of trying to figure out what the exact
function signature might be, I use a substring matching strategy to
ensure that the correct error was issued.
2017-12-21 07:39:32 -05:00
Geert Janssens
723b51a06d Add unit test for rewritten scheme error handlers 2017-12-20 14:55:40 +01:00
Geert Janssens
3d910ad2b1 Drop guile 1.8 support
And with it all quirks we still had in the code to support that version.
2017-12-20 14:55:40 +01:00
Geert Janssens
a784dd5784 Add support for guile 2.2 2017-12-20 14:55:40 +01:00
John Ralls
7c57ad18cd Fix date offset error in datetime test. 2017-12-19 14:34:10 -08:00
John Ralls
baad2097a7 Add tests for GMT and GMT+7 timezones. 2017-12-18 10:15:05 -08:00
John Ralls
5af21dfad8 Fix timezone constructor crash when zone file has no transitions. 2017-12-18 09:48:17 -08:00
John Ralls
0026b10851 Merge branch 'maint' into unstable 2017-12-17 13:00:00 -08:00
John Ralls
e1d3385428 Handle mid-pacific timezones in date-sensitive tests. 2017-12-15 10:13:41 -08:00
John Ralls
ac0d335c4f Revert post-construction adjustment of ldt for DST.
It was incorrect.\nMake corresponding adjustment to far eastern offset in neutral time adjustment.
2017-12-15 10:12:01 -08:00
John Ralls
a5134f91e1 Fix neutral time for consistent dates in mid-pacific time zones.
Echoes a change made some time ago in 2.6 where the time is adjusted from 10:59Z in time zones where that won't be the same date.
2017-12-12 21:02:11 -08:00