Commit Graph

753 Commits

Author SHA1 Message Date
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
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
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
John Ralls
66817bb997 Rework directory determination in CMake builds.
Sets paths for finding componenents depending on the state of ENABLE_BINRELOC,
GNC_UNINSTALLED, GNC_BUILDDIR and whether any install paths have been set
outside of CMAKE_INSTALL_PREFIX.

GNUInstallDirs changes the name of CMAKE_INSTALL_LIBDIR depending on the
operating system and distro. When CMAKE_INSTALL_PREFIX is /usr,
/usr/local, or any subdirectory of /opt it also changes
CMAKE_INSTALL_FULL_SYSCONFDIR to /etc. An earlier commit by Aaron Laws
mirrors the name of CMAKE_INSTALL_LIBDIR to the build library directory.

It's possible for builders to set any of the install directories
anywhere they please.

Setting any directory outside of CMAKE_INSTALL_PREFIX breaks Binreloc so
the toplevel CMakeLists.txt now detects that and disables Binreloc.

If Binreloc is enabled then all path queries use it to find paths. This
works in the build directory because the gnucash executable and all of
the test programs are in build_directory/bin and LIBDIR, DATADIR, and
SYSCONFDIR can be found in the same root path.

If Binreloc is disabled then in order to build or run programs from the
build directory one must set GNC_UNINSTALLED and set GNC_BUILDDIR to the
absolute path of the build directory. When those are set GNC_BUILDDIR
replaces CMAKE_INSTALL_PREFIX in all paths that are subdirectories of
CMAKE_INSTALL_PREFIX; paths that are not in CMAKE_INSTALL_PREFIX are
appended whole to GNC_BUILDDIR. This process is constent between CMake
and gnc_path_get_foo. GnuCash is unlikely to run from a DESTDIR without
Binreloc.
2017-12-05 17:25:52 -08:00
Rob Gowin
e7b7974a3c Handle cases where LIBDIR is not "lib"
For example, Fedora installs to lib64, Debian to lib/<arch-tuple>
2017-12-01 19:44:35 -08:00
Rob Gowin
778b86e29e Handle cases where LIBDIR is not "lib"
For example, Fedora installs to lib64, Debian to lib/<arch-tuple>
2017-12-01 17:00:39 -06:00
John Ralls
0a8e50069c Remove overrides directory as being obsolete.
Also don't install qof test headers to libexec.
2017-12-01 13:56:52 -08:00
John Ralls
9b0a8723a4 More GNUInstallDirs path fixes. 2017-12-01 13:56:52 -08:00
John Ralls
5ca129d82d Remove unset variable SWIG_ARGS from Makefile.am 2017-11-30 13:31:23 -08:00
Geert Janssens
649a6a263e Fix installation destinations for overrides and quotes scripts
Mentioned by Robert Gowin and Christopher Lam
2017-11-30 17:37:32 +01:00
Guy Taylor
c9c5876431 Use glib.h over custom typedefs in Python SWIG
Use the native glib.h (mainly gint, gfloat ...) over custom typedefs in
SWIG type files. This is for Python only.
2017-11-28 16:27:50 -08:00
John Ralls
5204100d53 Use GNUInstallDirs in CMake Builds
Provides correct file layout when building distribution tarballs.
Fixes Bugs 790840 and 790841.
2017-11-28 14:25:35 -08:00
John Ralls
13657ee1bb Merge branch 'maint' into unstable 2017-11-25 15:35:24 -08:00
John Ralls
d8c2f52447 Correct quoting for SQL backends.
Only string values should be quoted in queries; in particular NULL
isn't a string value and must not be quoted.
Note that this is a less than perfect solution because it doesn't use
the Database's quoting function and so doesn't escape quotes, linefeeds,
or carriage returns inside the string. That's because the SQL generating
logic is independent of the connection class and can't easily get to it.
2017-11-25 14:46:31 -08:00
John Ralls
9c4635e393 Bug 784623 - GNUCash does not work with sql backend.
Wherin the problem is that MySQL's TIMESTAMP has a date range of
1970-01-01 00:00:01 to 2038-01-19 03:14:07 and is unable to handle
time_t of 0. MySQL's TIMESTAMP also assumes that input is in the server's
timezone and adjusts it to UTC. GnuCash has already done that conversion.
2017-11-23 11:41:09 -08:00
John Ralls
937f8c5083 Set GncSqlObjectBackend::m_version to the appropriate TABLE_VERSION.
For each subclass, getting rid of GNC_SQL_OBJECT_BACKEND_VERSION which
was a bit misguided.

Also remove the bogus test the skipped loading a table if its version
didn't match GNC_SQL_OBJECT_BACKEND_VERSION which was even more misguided.
2017-11-21 18:15:37 -08:00
John Ralls
d44f6bc9d5 Fix missing/misspelled files for distribution.
Mostly errors from 6c01e54.
2017-11-19 17:32:12 -08:00
John Ralls
9444c1e300 Fix bad string construction in adjust_sql_options. 2017-11-19 17:32:12 -08:00
Geert Janssens
cd9c3807c0 Assign as payment - when random transaction is selected, reset transaction description to owner
This will make the assigned payment more in line with traditionally created business payments
2017-11-18 17:43:33 +01:00
Geert Janssens
0dfb921e86 Add functions to retrieve a copy of splits of a certain type from business transactions 2017-11-18 16:55:18 +01:00
John Ralls
61316648b8 Bug 789608 - Compilation problems when linking libraries.
Fix using a preproc macro in a different file from where it was declared
and more-strict template resolution of error_handler<> by gcc-7.x.
2017-11-09 13:47:08 -08:00
John Ralls
1895ae280c Merge branch 'maint' into unstable 2017-11-09 13:45:45 -08:00
John Ralls
6c01e54042 Convert shell-executed scheme tests to run directly from Guile.
I.e., remove the shell invocation and with it the need to set the shebang.

Surprisingly this required some build-system modifications particularly
for cmake in order to correctly set the environment.
2017-11-07 15:04:16 -08:00
John Ralls
f412795ef2 Remove extraneous parameters from GNC_ADD_SCHEME_TARGETS 2017-11-07 15:04:16 -08:00
John Ralls
04642fc42a [SQL] Check return of string_to_guid, bail if false. 2017-10-27 09:46:47 -07:00
John Ralls
d17c24b770 Bug 789298 - Prompt for file history update leads to crash during startup. 2017-10-27 09:46:47 -07:00
John Ralls
77ab04100c Bug 789297 - Account Tax Related Information - 2.7.0 is not backwards compatible 2017-10-26 16:23:44 -07:00
John Ralls
4be826055a Revert "Partial fix to exception crashes on Windows."
This reverts commit 4746054635.
a300384 is the correct fix for this problem.
2017-10-26 13:08:36 -07:00
John Ralls
4746054635 Partial fix to exception crashes on Windows.
There seems to be more than one problem that causes the exception handler ("catch") to
get lost on Windows:
* Throwing from a constructor called from a member function of another object of the same
class. That's fixed here for the GncNumeric string constructor, but there's at least one other
instance I'm still working on in GncNumeric::to_decimal.
* Hidden memory allocation in a stack-allocated object like std::string, std::istringstream,
or boost::smatch: The throw causes the object to go out of scope which calls its destructor
and in that case the catch reference is either lost or never compiled in.

This change ifdefs out the creation of detailed exception messages on Windows to avoid
the destruction of the std::istringstream and its attached std::string, creates a series of
helper functions to ensure that the boost::smatch is in a non-throwing scope, and puts the
computed values directly into the member variables instead of delegating the construction
to a temporary and then copying out the values. The last item is more correct anyway, as
C++ constructor delegation is supposed to happen in the member initialization part rather
than the function body.
With these changes the exceptions from the GncNumeric string constructor are handled
correctly.
2017-10-26 11:33:50 -07:00
Geert Janssens
7cb59aafe8 Fix disabling src docs build on Windows
As it was written it also prevented building source docs on other platforms, causing
cmake warnings and a failed dist build.
2017-10-26 14:05:17 +02:00
Geert Janssens
1238b9d8cd Prevent gcc from searching config.h in the current directory
This will avoid a ninja-build from picking up a config.h generated by the autotools build
(in the root build directory). Picking up the wrong config.h may lead to all kinds of
subtle issues if the autotools run was done with different options than the cmake run.
2017-10-26 14:05:17 +02:00
Carwyn Nelson
7b1d298bc6 Little refactor of account.c 2017-10-25 09:43:13 +02:00
Geert Janssens
444eb1c28e Improve gnc_numeric_boxed_copy_func based on discussion in PR#145
In essence
- guard against nullptr dereferencing
- free returned values
2017-10-23 23:05:49 +02:00
Bob-IT
53ef0c5be9 Save button active on every load
The gnc_numeric numval was being set with a valid numeric and hence was always different to the parsed amount.
2017-10-23 23:05:49 +02:00
John Ralls
70a37a24ae Don't build design docs on Windows.
To avoid requiring texinfo.
2017-10-22 11:51:48 -07:00
Geert Janssens
b83be1b8c6 Remove configure option --enable-locale-specific-tax and make gnucash always behave as if it was set 2017-10-20 20:50:33 +02:00
Jose Marino
968956d271 fix reconcile dialog always showing ending balance of zero
The reconcile account dialog always displays a value of 0.00 as the
Ending Balance, regardless of account and statement date.
This is caused by function xaccAccountGetReconcilePostponeBalance
returning the wrong value, returning TRUE when it should return FALSE,
and setting balance to the default {0,1}.

The code uses bal.denom!=0 as an indicator that a valid balance was
received in variable v. However, bal is initialized to {0,1}
making the test always true even when we didn't receive a valid
value in variable v.
Thus, this function returns TRUE with *balance={0,1} when no valid
balance was found in "reconcile-info/postpone/balance".

This patch fixes the function to return FALSE if v doesn't hold
a valid value or if bal.denom is set to 0.
2017-10-19 11:29:19 -06:00
John Ralls
91a2ee4525 [MacOS] Change CMake installed names to absolute paths from @rpath/...
gtk-mac-bundler can't access the executable's rpath list so it can't
follow dependencies if they're not in $install_dir/lib from @rpath.
Autotools always sets absolute path install names so this should have no
adverse affects on other Mac builds.
2017-10-15 13:22:29 -07:00
Geert Janssens
9472e9347f Replace ambiguous 'scm' with 'vcs' in macro name
Pointed out by Frank.
2017-10-05 22:47:11 +02:00
Geert Janssens
545b24fe97 Merge branch maint into unstable
Resolved conflicts:
2017-10-05 16:29:36 +02:00
Geert Janssens
e56cb37813 Additional changes to use commit date rather than build date
This effectively replaces the use of GNUCASH_BUILD_DATE with GNUCASH_SCM_REV_DATE.
The latter is extracted from the current commit if building from some kind of vcs
(currently only works correctly for svn and git). The info extracted while building
from vcs is then also added to the dist tarball so it's available when building
from tarball as well (via the file libgnucash/core-utils/gnc-vcs-info.h).

The same date is also used to set the date in gnucash' man page document.
A practical detail: I have changed the substitution variables in the man page template
from @- -@ to ${} so we could leverage CONFIGURE_FILE in cmake. The necessary
related adjustments have also been made to Makefile.am's substitution rules.
2017-10-05 15:51:55 +02:00
Geert Janssens
d266ee346c Fix build failures if userdata_home exists but gnc_userdata_home doesn't
userdata_home is a different directory on each platform we support (default /home/janssege/.local/share on linux for example)
and gnc_userdata_home is normally userdata_home/GnuCash.
These directories may not always exist (yet) in all circumstances, so properly handle
all of these possible situations.
2017-09-26 12:37:33 +02:00
John Ralls
711cea1f4f Fix the fix from mac for test-userdata-dir.c 2017-09-16 18:09:34 -07:00
John Ralls
9dc8e6f40a Fix test-userdata-dir on Mac. 2017-09-16 14:50:33 -07:00
Geert Janssens
a8cccc00f3 Minor tweaks to the userdata_dir logic
- have gnc_validate_directory throw as well in case of a missing directory
  that it shouldn't create. This allows to remove 3 other throws
- slightly adjust the error message in case of missing directory
- never migrate when the final directory is a temporary (sub)directory
2017-09-16 22:29:29 +02:00
Geert Janssens
2ac118f80c Improve a few comments. 2017-09-16 19:33:56 +02:00
Geert Janssens
75b5a41eee Merge branch 'maint' 2017-09-15 21:51:50 +02:00
Geert Janssens
37ecf56fbb Merge branch 'maint'
Resolved conflicts:
	bindings/python/tests/CMakeLists.txt
2017-09-12 13:48:01 +02:00
John Ralls
465f24af2e Link libgncmod-app-utils-python to libgncmod-app-utils.
Instead of building libgncmod-app-utils-python as a stand-alone library
because gncmod-app-utils.c can be compiled only with guile thanks to
declaring scm_init_sw_app_utils_module. Linux linkers will just mark it
'U' but the MacOS linker errors out.
2017-09-10 18:24:39 -07:00
Geert Janssens
556f7037ad Merge branch 'maint' 2017-09-10 19:16:38 +02:00
John Ralls
43c81b6ebb Add include of Foundation framework for NSString and NSBundle. 2017-09-06 22:28:13 -07:00
Geert Janssens
118af3e9e9 Fix gtest-gnc-timezone test on Windows 2017-09-05 14:14:01 +02:00
Geert Janssens
333edb1900 Fix gnc-rational test on Windows 2017-09-05 13:54:50 +02:00
Geert Janssens
449d3ca32d Windows: check permissions actually used on the platform
The code assumed these would be the same as on all other platforms which turns out not to be the case
2017-09-05 00:07:17 +02:00
Geert Janssens
d96bb3ebd5 Amend previous commit
The utf8 conversion is only used in the Windows specific section so there's no
need to define an overloaded function on std::string in this case.
Also CMakeLists.txt doesn't require the MingW specific library name setting
for boost::filesystem. Just removing the hardcoded one allows the build to
pick the right name up from the Boost_LIBRARIES variable.
2017-09-04 23:03:08 +02:00
Geert Janssens
d6677ff39f Convert boost::filesystem path strings to utf8.
Fixes windows build.
2017-09-04 13:37:46 -07:00
Geert Janssens
1b3a0e56ff Use boost::filesystem's built-in conversion between character encodings.
This should fix the wide character mixup on Windows
2017-08-31 12:20:08 -07:00
John Ralls
e2386253ca Move Win32 additions to engine_SOURCES to before first use.
It doesn't do anything where it is.
2017-08-31 12:20:07 -07:00
Geert Janssens
74b6ef8ab3 Merge branch 'kvpvaltostring' of https://github.com/limitedAtonement/gnucash 2017-08-31 10:10:45 +02:00
Geert Janssens
a670783eb6 Merge branch 'prices-out2' of https://github.com/Bob-IT/gnucash 2017-08-29 22:24:43 +02:00
lmat
a9cc488cbf Should return std::string
This is only used in C++, so there is no need to g_strdup in here. Also,
this fixes a memory leak in KvpFrameImpl.
2017-08-29 14:12:25 -04:00
Geert Janssens
bbea5061a3 Extend environment file parsing to also parse environment.local
This latter file can be created by the administrator next to the environment
file in order to override parameters set in environment file.
The reason for this is the environment file is always overwritten
during installation, while environment.local is never touched by
the installers. So making the changes in there ensures they persist
acros gnucash updates.
2017-08-26 21:38:21 +02:00
Geert Janssens
045ee429bf Check GNC_DATA_HOME environment to override default userdata location.
This replaces GNC_DOT_DIR as it was called in older gnucash releases.
2017-08-26 21:38:21 +02:00
Geert Janssens
a153412e5a Use platform dependent locations for gnucash user's data (gnc_userdata_home)
- Linux: use whatever the xdg spec dictates
- Windows: use AppData(Roaming)
- OS X/Quarz: use NSApplicationSupportDirectory special directory, which
              typically resolves to $HOME/Library/Application Support

If the preferred directory can't be used the code will fallback to
$HOME/.gnucash (the old location) if it exists. It won't create it
however. Instead if missing it will fall back to the platform's
temporary directory.

Code is added also to automatically migrate all data from the old
location to the new (only the first time).
2017-08-26 21:38:21 +02:00
Geert Janssens
ae75bc963f Rewrite several file path routines to use boost::filesystem
This is a basis for moving .gnucash to a more modern location for
application specific user data (following the xdg spec).
2017-08-26 21:38:21 +02:00
Mike Alexander
29a92431cb Fix sigfigs(n) rounding to work when the input is bigger tnan 10**n.
For example rounding 1234567/1 to 6 significant figures would fail.
2017-08-22 00:47:08 -04:00
Mike Alexander
57638161f2 Fix numerator overflow constructing GncNumeric from 96.16 2017-08-22 00:35:10 -04:00
Mike Alexander
00c7089ecb Add tests for converting doubles 96.16 and 9616000000.0 to GncNumeric. 2017-08-22 00:30:28 -04:00
Geert Janssens
4b3db97ba1 Merge branch 'maint'
Resolved conflicts:
	gnucash/report/report-system/html-document.scm
2017-08-21 21:53:27 +02:00
John Ralls
115d61e7f3 Remove test for transaction set-date diagnostic message.
Since we removed the diagnostic, testing for it fails.
2017-08-20 23:25:56 +02:00
John Ralls
71e3703087 Use time64 GncDateTime constructor instead of struct tm constructor.
It's substantially faster and we do a lot of time64->gdate conversions.
2017-08-20 21:49:04 +02:00
John Ralls
f7ce8bcbb3 Disable creating a date string to maybe use in a PINFO message.
Creating a date string occupied nearly all of the time required to
set a date on a transaction, generally to no benefit at all.
2017-08-20 21:31:07 +02:00
John Ralls
1e0a9a0ef8 Parse date strings into a struct tm and construct GDateTime with that.
Instead of using the more generic string constructor. The struct tm
constructor is several times faster and this change speeds up
transaction loading by 2x.
2017-08-20 21:28:09 +02:00
John Ralls
82d891a202 Test features to see if they're already set before setting them.
Setting a feature writes to KVP which in the SQL backend causes the book
to be written out, which is rather expensive. Doing this in a loop (as
is the case in convert_imap_account, is quite slow, and this change
afforded a 4x speedup.
2017-08-20 21:24:02 +02:00
Robert Fewell
6ca85450a8 Move gnc-gdate-utils functions to gnc-date and remove files.
Also update related files to reflect move of gnc-gdate-util functions
2017-08-20 14:07:30 +01:00
Robert Fewell
b485206378 Change tabs to spaces and remove some blank lines 2017-08-20 14:07:30 +01:00
Robert Fewell
047bc8d69b Rename gnc_pricedb_remove_old_prices_keep_last
Rename gnc_pricedb_remove_old_prices_keep_last to reflect that there is
an option to keep none so new name is gnc_pricedb_process_removal_list
2017-08-20 14:07:23 +01:00
Robert Fewell
a7abc312a9 Rename save_cloned_price to clone_price
Renamed save_clone_price to clone_price and changed to pass the address
of the cloned_price variable instead of returning it.
2017-08-20 14:06:10 +01:00
Robert Fewell
89dbc09410 Added second if clause for completeness. 2017-08-20 14:06:09 +01:00
Robert Fewell
c3466b79ef Move gnc-gdate-utils.c/h from app-utils to engine 2017-08-20 14:05:05 +01:00
Robert Fewell
42915a42d1 Modify the unit tests to reflect changes. 2017-08-20 09:50:31 +01:00
Robert Fewell
667f175757 This change modifies the way old prices can be removed.
There are now options to specify which commodities to remove prices
from as well as options to leave none or the last one for the week,
month, Quarter, year and a scaled option.
2017-08-20 09:50:31 +01:00
John Ralls
4fc61b2ac8 Commit imap conversions once per account instead of per import map slot.
Commits are expensive in the SQL backend; this resulted in a >40x
speedup in loading a database with 3400 import map slots (>2 hours to 3
minutes).
2017-08-19 20:25:57 +02:00
John Ralls
c6a72cc596 Revert "Fix mac looking in wrong directory for libgncmod-backend-dbi.dylib."
This reverts commit 6a359f86a0.
2017-08-19 20:25:04 +02:00
John Ralls
7e7d42847c Fix load string KVP memory error. 2017-08-19 17:15:49 +02:00
John Ralls
6a359f86a0 Fix mac looking in wrong directory for libgncmod-backend-dbi.dylib. 2017-08-19 17:15:49 +02:00
Geert Janssens
f943ba61ae Rename directory for code from external projects
'lib' is also being used by the cmake build, so there was a
theoretical risk for file conflicts. The new name is 'borrowed'.
2017-08-17 15:25:49 +02:00
Geert Janssens
7fd38c88a5 Improve a comment
My Ingrish is pretty poor at times...
2017-08-17 12:36:48 +02:00
Geert Janssens
a96a68fd4e Add as many values as there are fields in the list
This wasn't causing trouble, but it looks more correct this way.
2017-08-17 12:33:08 +02:00
Geert Janssens
0946b0315f Use another way to fix backend loading on OS X 2017-08-17 10:10:50 +02:00
John Ralls
cc39a04f6f Fix mac looking in wrong directory for libgncmod-backend-dbi.dylib. 2017-08-16 23:17:07 +02:00
John Ralls
e9ac71c0f9 Fix time-string format in backend for GncDateTime(std::string).
Also provide a simple test of that ctor.
2017-08-16 23:17:07 +02:00
John Ralls
43df1ccc3a Fix the most serious backend memory leaks. 2017-08-16 23:17:07 +02:00
Geert Janssens
1883d8ec31 Fix a number of test mismatches between cmake and autotools
cmake:
- add test-app-utils
- rename test-link-module to test-link-module-app-utils
- add gtest-import-map
autotools:
- move gtest-import-map from TEST_PROGS to TESTS (autotools) so it shows up in the colored results list
2017-08-16 12:40:38 +02:00
Geert Janssens
53afd36de1 Keep the test modules from gnc-module outside of the normal GNC_MODULE_PATH
They interfere with other tests and pollute the build logs in cmake.
2017-08-16 11:59:27 +02:00
Geert Janssens
3e3eead3c5 Eliminate plugins directory
bi-import and customer-import have been put with the other importers
example is moved to gnc-module as, well, an example
2017-08-14 18:17:13 +02:00
Geert Janssens
dfe8ea4536 Add conditional source files to dist tarball
They should be added even if not used on the system being used to create the dist tarball
2017-08-11 22:51:14 +02:00
Geert Janssens
0c6da2f001 Cleanup some more obscure references to no longer existing 'src' directory 2017-08-11 22:44:50 +02:00
Geert Janssens
afecab330a Move accounts, checks and pixmaps into a data directory
At the same time move the art directory into contrib to unclutter the top level
2017-08-11 22:42:15 +02:00
Geert Janssens
83d14e1c1c Restructure the src directory
It is split into
- /libgnucash (for the non-gui bits)
- /gnucash (for the gui)
- /common (misc source files used by both)
- /bindings (currently only holds python bindings)

This is the first step in restructuring the code. It will need much
more fine tuning later on.
2017-08-10 18:45:00 +02:00