Commit Graph

18873 Commits

Author SHA1 Message Date
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
318f7ebc4f Force build order on report system support files
Guile 2.2 is more picky about this than guile 2.0 was.
2017-12-20 14:55:40 +01: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
christopherlam
76921b5e28 Fix -DWITH_SQL=OFF Build. 2017-12-19 15:40:33 -08:00
Robert Fewell
0186bc1c0c Change the relative path to a full one for rpath 2017-12-19 15:40:33 -08: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
c1b5e6c8df Release 2.6.19 2017-12-16 15:28:56 -08:00
John Ralls
70fe66c9fd Fix python tests when building from tarball. 2017-12-16 15:11:14 -08:00
John Ralls
5da9e2f4c9 Update Dutch and Serbian translations from the Translation project. 2017-12-16 11:28:24 -08:00
John Ralls
8efc0e7bdc Merge Rob Gowin's Partial Fix for Bug 787497 into maint. 2017-12-16 10:54:03 -08:00
John Ralls
51fab91ffe Add test-flat-bayes to autotools build. 2017-12-16 10:38:07 -08:00
John Ralls
4ce47b898d Add minimum version to feature and fix copy-paste error in test-flat-bayes.
As recommended by Geert Janssens.
2017-12-16 10:35:07 -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
John Ralls
aeb2e65ff1 Fix posted-date scrub incrementing the day in central pacific timezones. 2017-12-12 21:02:11 -08:00
John Ralls
1c8c53a861 Remove (unused because of an error) parse-to-tm string timespec construction. 2017-12-12 21:02:11 -08:00
John Ralls
6db0820771 Fix offset handling in GncDateTime struct tm ctor, gnc_mktime, & gnc_timegm.
Tests now pass in all TZa from Honolulu to New Zealand.
2017-12-12 21:02:11 -08:00
Geert Janssens
de4d1e9859 Add infrastructure to handle preference schema migrations and use it to replace one preference
The preference schema migration collects all schema mutations that can occur
when upgrading to a newer gnucash version. The old gconf to gsettings conversion is
integrated in this system as well. Newer schema mutations will happen based on version
number upgrades though.

The preference that got replaced is "use-theme-colors". Based on discussion in bug 746163
(https://bugzilla.gnome.org/show_bug.cgi?id=746163) and gnucash-docs PR#105
(https://github.com/Gnucash/gnucash-docs/pull/105) this has been replaced with
"use-gnucash-color-theme" with inverted meaning. The old option is kept around for one or
two major release cycles to allow seamless conversion.
2017-12-11 21:56:23 +01:00
John Ralls
9dc66c0b7d Fix the Mac install_name_dir to point at CMAKE_INSTALL_FULL_LIBDIR.
Instead of CMAKE_INSTALL_LIBDIR; it needs to be an absolute path.
2017-12-10 13:01:32 -08:00
John Ralls
c0659c8e2b Bug 791422 - gnucash 2.7 no longer opens sqlite3...
as it doesn't load proper backend.
The cause was that the libdbi-driver path in CMakeLists.txt was wrong
and GNC_DBD_DIR was being set unconditionally in etc/gnucash/environment
with an invalid path.
2017-12-10 12:51:24 -08:00
John Ralls
ec9f60d3fd Test more thoroughly gnc-timezone's parsing of the zoneinfo database.
Then fix the resulting problems.
2017-12-09 15:37:16 -08:00
Geert Janssens
98d41bc374 Fix transient parent warnings for tip-of-the-day and file dialogs 2017-12-08 23:29:21 +01:00
Geert Janssens
ac89797e78 Fix transient parent warnings in search callbacks 2017-12-08 15:49:31 +01:00
Geert Janssens
a092aecd56 Add transient parent for search dialog 2017-12-06 22:36:15 +01:00
Geert Janssens
0c254c36a0 Fix missing transient parent warnings for several business dialogs 2017-12-06 22:36:15 +01:00
Geert Janssens
8986795251 Fix transient parent for SX since last run... at startup 2017-12-06 22:36:15 +01:00
Geert Janssens
995c3cf4c3 Set transient parents for all query views and dialogs 2017-12-06 22:36:15 +01:00
Geert Janssens
d8cc165e28 Alter function signature of gnc_(verify|yes_no|info|warning|error)_dialog
The new signature makes it more clear what the purpose and required type of the parent widget should be.
While at it, the info,warning and error dialog code got slightly refactored for better code reuse.
Finally a few more parent widgets were passed in places where a parent was readily available.
2017-12-06 22:36:15 +01:00
Geert Janssens
68103dd02d Improve window management
This first commit will replace gnc_ui_get_toplevel with two functions
- gnc_ui_get_gtk_window (widget): tries to find the immediate GtkWindow the given widget belongs to
- gnc_ui_get_main_window: looks for the main window that's the final transient parent widget
  can be traced back to. In the absence of widget, this will behave as gnc_ui_get_toplevel did
  and return the first active or mapped window.
2017-12-06 22:36:15 +01:00
Geert Janssens
12bad5cec8 Ensure the main window is mapped before any reminder dialogs are shown at startup 2017-12-06 22:36:15 +01:00
Geert Janssens
47d622de61 Handle the splash/lock file warning more the gtk way
If the splash screen is still availabe when the dialog should be displayed,
make the splash' window the transient parent for this dialog.

In the other case we try to use the front-most main window. While this
works well when calling file->open from the menu, there may not be a
visible main window yet during startup. Since the user can close
the splash before the dialog is due, we may end up with no usable candidate
as parent window.
In that case the dialog will emit a missing transient parent message on stdout.
There's no easy fix for this as users don't want to see an incomplete
main window (see old bug 350993).
2017-12-06 22:36:15 +01:00
lmat
87e833c693 GUID/Flat bayes handling in 2.6
With 2.8 soon able to write flat guid bayes kvps, 2.6 will also need
to be able to read them. This change enables 2.6 to be able to write
all known types of import maps: not-flat guid and account name, and
flat guid import maps, but it is not able to convert between these
types. 2.8 is able to read earlier, not-flat bayes kvps,
and will convert them to a flat guid model.
2017-12-06 13:12:16 -08:00