Commit Graph

23 Commits

Author SHA1 Message Date
Robert Fewell
4368e18ac5 Bug 797165 - Crash on price deletion.
Caused by the introduction of caching used in gnc_pricedb_nth_price,
when prices were deleted, the cached list was never updated and so the
tree model could reference a deleted price and hence crash. This also
affected adding prices as the new prices would not show due to the
cache not being updated. To fix this a function was added to reset the
cache when prices are updated from the model.
2019-04-26 12:09:05 +01:00
Robert Fewell
9f0558ffb5 Add some missing log Macros for the price model
Add some missing LEAVE macro statements so the log entries do not get
longer and longer.
2019-04-26 12:09:05 +01:00
John Ralls
f9f714c78d gnc_pricedb_nth_price: Clarify code and cache results.
Use built-in glib functions to retrieve the list of per-currency price
lists, concatenate them into a single list, instead of doing it all in
hand-rolled loops.

Sorting is preformed by the calling GncTreeViewPrice so this removes
sorting from gnc_pricedb_nth_price.

There's no concurrency concern because gnc_pricedb_nth_price is a
GUI callback and so must run in the GUI thread.
2019-01-25 08:49:03 -08:00
John Ralls
3a48672763 Complete reversion of e81bcf6 in gnc-pricedb.c. 2019-01-23 17:54:29 -08:00
John Ralls
020bc5371f Bug 797046 - Tools / Price Database / Currencies UI not working...
since 3.4.
2019-01-19 14:31:10 -08:00
John Ralls
e81bcf6e33 Fix the remaining static analysis warnings.
Except two incorrect leak warnings and one about mktemp
 being insecure in the XML backend. See the respective
comments about those.
2018-11-30 15:08:41 +09:00
John Ralls
bf55c30aeb Fix most of the unused assignment errors from static analysis.
There are a very few left that need deeper study, but this gets
rid of most of the noise. For the most part it's just getting rid of
extra variables or removing an assignment that is always
replaced later but before any reads of the variable. A few are
discarded result variables.
2018-11-30 15:08:41 +09:00
John Ralls
536606a89c Fix extract_common_prices logic.
So that the returned price tuple has the two commodities of interest
converted to a common currency. Before the first pair that that shared
any random currency would be returned, perhaps creating an absurd result.
2018-11-27 22:17:22 +09:00
John Ralls
fee589b28c Remove Timespec from pricedb.
Includes removing the time64 specialized functions because the regular ones
handle time64 now.
2018-08-13 11:52:42 -07:00
John Ralls
6f89bd62b3 Remove timespec from gnucash/gnome.
With a little API bleed into engine.
2018-08-12 16:12:19 -07:00
Geert Janssens
c71204628d Bug 795031 - 3.0 Crashes on loading when opening 2.6.19 file 2018-04-26 23:06:36 +02:00
John Ralls
85cc574d50 Prevent throw in gnc-pricedb.
If a price lookup is given an invalid time64/timespec (i.e. INT64_MAX)
then just return NULL instead of trying to find the nearest price.
2018-04-12 15:17:01 -07:00
Christopher Lam
ca22d5531b Change gnc_pricedb_convert_balance_nearest_price from timespec to time64. 2018-01-20 16:40:45 -08: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
dda0695285 ADD-TIME64-API: libgnucash/engine/gnc-pricedb.[ch] 2018-01-08 22:56:49 +11:00
lmat
61d4aaaf08 Adding some time64 alternatives 2018-01-08 13:01:29 +11: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
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
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
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
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