Commit Graph

19915 Commits

Author SHA1 Message Date
John Ralls
1e6627c4c5 [DBI Backend] Init and finalize the backend in setup and teardown.
Xcode 9's clang creates a separate dbi_instance for each test and so
each one needs to be initialized during its setup and finalized at
teardown.
2018-06-23 17:35:42 -07:00
Geert Janssens
b74cc7c4e6 Merge branch 'bug795471' of https://github.com/Bob-IT/gnucash into maint 2018-06-23 17:39:29 +02:00
Geert Janssens
a438a59513 Bug 795944 - Cannot store change to Business Suppliers data
The underlying problem was that the vendor object remained in infant state
That confused the backend code so it used an sql INSERT statement instead
of an UPDATE statement to write back the changes. As the object already
existed in the db this would fail.
The fix is to ensure the object doesn't remain in infant state during
sql loading. See the bug report for a more detailed explanation.
2018-06-23 13:15:46 +02:00
Christian Stimming
92ea3ba8a6 Register speed-up for large files.
The function qof_book_use_split_action_for_num_field gets called quite a
lot in each register display refresh (due to sorting all splits from
Split.x's xaccSplitOrder function), but it always used to use a KVP
lookup, which is rather expensive compared to accessing a gboolean member
variable.

To get rid of this cost, I had to remove the KVP lookup in this
simple-looking function. The pattern is this: A gboolean cache variable is
introduced, along with an isvalid flag. The lookup makes the expensive
KVP lookup once, then caches the value. The GObject property mechanism
offers a callback for when the setter was called, which is used to mark
the cached value as invalid. A parallel setter method (here:
qof_book_set_option) also just marks the cache as invalid. This covers
all setters, and the getters will use the cached value except for their
first invocation.

The NUM_FIELD_SOURCE feature was introduced in 2012 by the very large
commit 7cdd7372 and apparently its costs never were a problem
until the KVP lookup became more costly due to the std::vector
construction and destruction.
2018-06-22 22:54:33 +02:00
John Ralls
f144a8deb7 Revert "Bug 796248 - Editing Scheduled Transaction"
This reverts commit ffe6044cd6.
It breaks loading splits on transactions that have already
been loaded.
2018-06-22 10:14:21 -07:00
John Ralls
696277bbf6 New clang error enforces virtual destructors. 2018-06-22 09:09:33 -07:00
Geert Janssens
32e7994843 Restore mechanism to prevent windows from being restored off-screen on opening a book
This got disabled in commit 54019608ee in the gtk3 refactoring by accident.
While we now no longer save the negative coordinates for hidden windows,
there are still other situations in which this could happen, like switching
from a dual monitor to a single monitor setup (common with laptops).
2018-06-21 16:23:20 +02:00
Robert Fewell
7a33c6c0ba Added some padding to the numbers in Budget view
Added some padding to the numbers so they are separated from the next
more clearly.
2018-06-21 12:09:05 +01:00
Robert Fewell
e128836013 Simplify getting the cell renderer in budget view 2018-06-21 12:08:56 +01:00
Robert Fewell
3f9bb7a109 Bug 795471 - Make sure account column has expand option
By default the account column is the expand column but if it is manually
 changed this is reset to the last column. If Gnucash is maximised in
this state, the totals column then has a lot of white space so this
change reapplies the expand setting to the account column so it has the
extra space.
2018-06-21 11:40:52 +01:00
Geert Janssens
4485966bec Bug 796638 - configuration not properly saved for CSV transactions import form 2018-06-21 11:36:45 +02:00
Geert Janssens
a2983935a2 Use a comment to indicate full account name in saved register state
This replaces the 'account_name' key in the same state. Keys should only be used
data that's actually parsed when reading the state. Using a key for account_name here
can create the false impression this data can be modified. A comment makes it much more
clear the name is only informational while keeping the convenience.
2018-06-21 10:33:22 +02:00
John Ralls
d906ac4136 Prevent "quit without saving" dialog at shutdown when there's no session.
Don't create a session if there isn't one.
2018-06-17 14:09:00 -07:00
John Ralls
a9f0fe2f93 Merge Chris Lam's 'maint-test-all-charts' into maint. 2018-06-17 14:06:38 -07:00
Christian Stimming
1e3a445007 Optimize calls to get_path_kvp so that std::strings are not always created and deleted immediately.
Turns out that the on-the-fly conversion from const char* (the KVP_OPTION_PATH
constants) to std::string with their immediate deletion afterwards is
a quite costly operation. Avoiding this is surprisingly easy: Just keep
local std::string objects at hand, and they don't have to be created
and deleted anymore.

The more optimized solution might be to turn the std::vector<std::string>
into a std::vector<GQuark>, but this commit at least improves the picture for now.
2018-06-17 22:51:16 +02:00
John Ralls
4aaa18eafc Bug 796600 - stock split cash-in-lieu income/asset labels backwards. 2018-06-16 16:19:12 -07:00
John Ralls
9b7544a777 Fix build of windows resources file. 2018-06-16 15:30:23 -07:00
John Ralls
c1103a3a52 Bug 796586 - QIF import incorrectly converts unicode characters from...
UTF8 encoded file

Force UTF-8 encoding; the line processing includes checking each
line for legal UTF-8 and transcoding it to the locale encoding.
2018-06-16 10:37:58 -07:00
Christopher Lam
186ac71fcf Merge old tests with their support files.
It bothered me that these old tests have 2 scheme files per test. It
was always confusing.
2018-06-16 22:47:41 +08:00
Christopher Lam
a78e8b1035 [test-balance-sheet] initial commit
Adds basic balance-sheet testing.

This does not yet test foreign-currency conversions, nor calculation
of unrealized gains.
2018-06-16 22:47:41 +08:00
Christopher Lam
6a62b8db8c [balance-sheet] sanitize & in (add-subtotal-line) 2018-06-16 22:47:41 +08:00
Christopher Lam
62b5c8138d [html-acct-table] sanitize &nbsp; in (gnc-commodity-table)
This sanitizes the commodity-table html.
(improves my first commit!)
2018-06-16 22:47:41 +08:00
Christopher Lam
01a426bf79 [test-transaction] upgrade to test foreign conversion too
Thanks to previous commit, we can now test foreign currency conversions.
2018-06-16 14:19:13 +08:00
Christopher Lam
02bb981daa [test-extras] upgrade env-transfer-foreign to update pricedb 2018-06-16 14:18:30 +08:00
Christopher Lam
f1823c525c [webkit] eradicate css?
Forgot to remove in 5093a8fb14, remove all traces off css?
2018-06-16 13:09:39 +08:00
Christopher Lam
0461eb43c3 [test-charts] will now test presence of *all* standard charts
And will eventually test data for all chart types too.
2018-06-16 07:55:43 +08:00
Christopher Lam
b1a165eb3b [test-charts] rename test-net-charts to test-charts
It is not that much more difficult to test *all* charts in the same
test-file.
2018-06-16 07:55:43 +08:00
John Ralls
1801fed486 Remove emacs spoor from POTFILES.in 2018-06-15 16:42:02 -07:00
John Ralls
7ce8c9d336 Bug 796595 - QIF Import Select Account button to add a new account...
is labled gnc-account-new but should be New.

Made it "New Account".
2018-06-15 15:21:14 -07:00
John Ralls
d6de324b32 Bug 795272 - QIF importer causes application crash if action is invalid.
Fixes the crash and also pauses after loading if there are load errors.
The load "protection" catches exceptions other than bad-date so that it's
real protection.
Check for unbalanced transactions (i.e. with only one account) and don't
try to match if there is; report the error in the error log space in the
assistant.
Don't proceed to finding duplicates if the new account tree hasn't been
created, there aren't any.
2018-06-15 14:59:06 -07:00
John Ralls
1f8f681732 Remove abandoned C-Language QIF implementation. 2018-06-15 11:38:31 -07:00
John Ralls
9f1bfddc27 Revert "Remove abandoned C-language QIF implementation."
Because it included some extraneous changes.
This reverts commit edd439a05e.
2018-06-15 11:30:09 -07:00
John Ralls
edd439a05e Remove abandoned C-language QIF implementation. 2018-06-15 09:30:31 -07:00
John Ralls
554001604a Merge Chris Lam's 'maint-chartjs-part-1' into maint. 2018-06-14 10:52:42 -07:00
John Ralls
0efe32ea73 Merge Chris Lam's 'maint-test-net-charts' into maint. 2018-06-14 09:52:19 -07:00
Christopher Lam
754c047892 [net-charts] styling table for all charts 2018-06-14 12:53:33 +08:00
Christopher Lam
be1ebb9d32 [net-charts] use scheme rationals directly 2018-06-14 12:53:33 +08:00
Christopher Lam
66488bbb1a [net-charts] *reindent/whitespace* 2018-06-14 12:53:33 +08:00
Christopher Lam
ffd20b2e2f [net-charts] combine net-[bar|line]chart.scm into net-charts.scm
This commit combines both charts into one. This can improve ease of
maintenance.
2018-06-14 12:53:33 +08:00
Benjamin Gordon
8cae602e66 Add support for libsecret to cmake
gnucash has historically supported storing passwords for database
backends with libsecret when HAVE_LIBSECRET is defined. The code is
still present, but support for detecting libsecret's availablity was not
ported over when the build system was converted to cmake.  This change
restores the missing detection.
2018-06-13 21:13:21 -06:00
Christopher Lam
2e4e18e21e [test-net-charts] initial commit test-net-charts
This just tests that the report exists. It does not do any checking
for the data generated yet.
2018-06-14 11:11:04 +08:00
Christopher Lam
7de68cef88 [test-extras] split gnc:options->sxml into 2 functions
Creates (gnc:options->render) which outputs report as a string.
2018-06-14 11:11:04 +08:00
Christopher Lam
1fc5634c7a [html-text] [bugfix] img url was mistakenly disabled. 2018-06-13 21:38:26 +08:00
John Ralls
6c03d07e00 Merge Chris Lam's 'maint-test-invoice' into maint. 2018-06-12 16:28:28 -07:00
John Ralls
87f4791fae Merge Chris Lam's 'maint-fix-796537' into maint. 2018-06-12 16:21:26 -07:00
John Ralls
9c7fa77d3b Merge Bob Fewell's 'fixes6' into maint. 2018-06-12 16:12:48 -07:00
John Ralls
5d3ae6c672 Fix test-tokenizer failure due to not nulling the GError*. 2018-06-12 16:12:30 -07:00
John Ralls
ffe6044cd6 Bug 796248 - Editing Scheduled Transaction
An extra XaccTransBeginEdit, never committed, for transactions that
the backend tried to load when they were already there. That made
the register think that something else had it open.
2018-06-12 15:49:28 -07:00
John Ralls
c8861d4666 Bug 795276 - Invalid date on price stops file from being parsed.
Instead of reporting an error and declining to load the file (XML)
or failing to enter a value (SQL) when a bad date is found in the
database, use a 0 time stamp (1970-01-01 00:00:00 UTC). Adds a warning
in SQL backends; there was one already in XML.
2018-06-12 14:56:27 -07:00
John Ralls
9179505208 Bug 796484 - csv import: iostream error
Unfortunately it turns out that we can't use filestreams because
they can't take path arguments containing Unicode on Windows.
Replace the filestream code with g_file_get_contents(),  which
takes care of all of that Windows compatibility noise for us.
2018-06-12 11:48:03 -07:00