Commit Graph

384 Commits

Author SHA1 Message Date
Richard Cohen
329a2f7d42 Guard against some possible null pointer dereferences
Found by gcc 12 when compiling with "-O2 -Wnull-dereference"
2023-03-08 11:00:56 +00:00
John Ralls
1341511edb [c++options] Save an empty SCM string for nil or empty option values.
Avoids crash at reload due to unknown variable.
2023-03-06 15:36:23 -08:00
John Ralls
1eecb9f5c0 [c++ options] Fix locale dependency in test-gnc-option-scheme-output.
Created by using std::to_string() in GncOptionRangeValue::serialize.
It wraps sprintf that reads the locale. Use ostringstream instead.
2023-03-02 12:22:55 -08:00
Richard Cohen
be41bde58a Add missing MAKE_LINKS, and the local scm directory to %load-path
Before this change, "make check" would fail after
  rm -rf ${build}/share/guile/site/*/gnucash/
2023-02-28 11:51:23 +00:00
Richard Cohen
ec169e6e24 Fix some non-translatable typos 2023-02-27 11:32:12 +00:00
John Ralls
408b5ec216 [c++ options] Restore forward & backward compatibility, fix crash.
Store Number Range option values as a pair '(percentage . value) or '(pixels .
value) depending on the size of value as 4.x and earlier expect. When reading a
stored number range option handle the possibility that value is fixed
point (e.g. 50.0) as 4.x and earlier emit, avoiding a crash.
2023-02-25 16:25:36 -08:00
Richard Cohen
bddb4468fa Import GLIB2 as a target, and use it to simplify the CMakeLists 2023-02-21 12:59:42 +00:00
Richard Cohen
27fe72496e Remove unused ${GLIB_LIBS} ${GLIB_INCLUDE_DIRS}
They have been replaced by GLIB2_*
2023-02-21 12:50:38 +00:00
Richard Cohen
56d950598d [-Wunused-variable] - pretend to use
Looks like a SWIG bug, creating an extra variable that it doesn't use

bindings/python/gnucash_core.c: In function ‘_wrap_xaccAccountGetReconcileLastDate’:
bindings/python/gnucash_core.c:10096:10: warning: unused variable ‘secs20’ [-Wunused-variable]
10096 |   time64 secs20 ;
      |          ^~~~~~
bindings/python/gnucash_core.c: In function ‘_wrap_xaccAccountGetReconcilePostponeDate’:
bindings/python/gnucash_core.c:10298:10: warning: unused variable ‘secs20’ [-Wunused-variable]
10298 |   time64 secs20 ;
      |          ^~~~~~
bindings/python/gnucash_core.c: In function ‘_wrap_qof_query_date_predicate_get_date’:
bindings/python/gnucash_core.c:20237:10: warning: unused variable ‘secs20’ [-Wunused-variable]
20237 |   time64 secs20 ;
      |          ^~~~~~
2023-02-16 09:20:59 +00:00
Christopher Lam
4d977a947a [business-core] remove gnc:split->owner 2023-02-13 23:29:00 +08:00
Christopher Lam
d53f3e68d1 Merge branch 'maint' 2023-02-13 23:28:44 +08:00
Christopher Lam
4953cf94fa [reports] use gnc:make-split->owner with guardian
Instead of a gnc:split->owner, use gnc:make-split->owner instead which
generates a split->owner function with its own hashtable. This
function (and its hash table) will be garbage collected in due course,
triggering the gncOwnerFreeing of all owners.

This is a better approach than gnc:split->owner which maintains a
single hash table. It could be buggy: a report calls gnc:split->owner
to query a split, fails to reset its hashtable via #f; the split's
owner is assigned or modified, and the next call to gnc:split->owner
will return the incorrect cached owner.
2023-02-13 23:17:02 +08:00
John Ralls
732a005710 Merge Christoph Holtermann's 'python-log-access' into master. 2023-02-06 15:24:04 -08:00
Richard Cohen
78ec20515b Remove some unused variables - and the initialization
- checked that any side effects were irrelevant
2023-02-06 14:20:28 +00:00
Richard Cohen
ea2d3be217 Remove some unused variables with obviously no side effects 2023-02-06 14:19:22 +00:00
Christopher Lam
119356752f Merge branch 'maint' 2023-01-30 09:56:13 +08:00
luzpaz
67ab9e90d2 Fix some typos 2023-01-26 13:48:58 +01:00
John Ralls
f6919e60a7 Merge Richard Cohen's 'cleanup' into master. 2023-01-24 12:05:47 -08:00
Richard Cohen
d6ac56ce5f Re-enable -Waddress - gncInvoiceLookup etc. are now inline functions, not macros
- Remove outdated comments
2023-01-24 13:35:22 +00:00
Richard Cohen
1cec0cb3f3 Use internal extern "C" { ... } for C++
- removes warnings compiling swig engine
...
[ 10%] Generating swig-engine.cpp
.../libgnucash/engine/engine-helpers.h:31: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gnc-date.h:83: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/qofquery.h:90: Warning 302: Identifier 'QofQuery' redefined (ignored),
.../libgnucash/engine/gnc-option.hpp:55: Warning 302: previous definition of 'QofQuery'.
.../libgnucash/engine/gnc-commodity.h:56: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncBusiness.h:40: Warning 313: Unrecognized extern type "C++".
.../libgnucash/engine/gncEntry.h:37: Warning 313: Unrecognized extern type "C++".
2023-01-23 18:40:01 +00:00
Frank H. Ellenberger
d039e65aca Merge branch 'maint' 2023-01-22 11:25:44 +01:00
John Ralls
09751e20c5 Bug 789730 Bis: Sometimes we get lists of Account*
And sometimes a list of Guid strings. Handle either.
2023-01-21 15:57:39 -08:00
John Ralls
816219c246 Bug 798730 - Open report doesn't remember selected accounts over restart
scm_to_value<GncOptionAccountList> written for std::vector<Account*>
instead of std::vector<GncGUID>.
2023-01-20 13:22:26 -08:00
Christopher Lam
645cc9461d [core-utils] modify gnc:format to accept -
this allows use of varnames such as ${report-title}
2023-01-17 00:24:08 +08:00
John Ralls
61673ec919 [c++ options] Rearrange header includes to avoid windows.h conflicts.
Since SWIG guile pulls in libguile early the options headers must
be included in a begin block.
2023-01-08 16:09:32 -08:00
John Ralls
d4a1fb92a6 [c++ options] strptime.h must be included as extern "C". 2023-01-08 16:08:04 -08:00
John Ralls
40c55899bc [c++options] Convert remaining reports and tests to new API. 2022-12-23 10:01:52 -08:00
John Ralls
30b2c0bcac [options] Provide gnc:register-multichoice-callback-option.
Compatibility function for passing symbols or numbers as the default
value.

Note that this isn't used by GnuCash code and so isn't exercised or
tested, it's provided only to simplify user-written code migration.
2022-12-22 13:53:44 -08:00
John Ralls
b8c0673526 Merge branch 'maint' 2022-12-19 12:11:32 -08:00
Christopher Lam
6e6d44f567 [options.scm] typo fix - no commas needed in guile
also the following symbols are also not accessible from scheme.

GncOptionUIType-TAX_TABLE
GncOptionUIType-DATE_FORMAT
2022-12-17 21:23:54 +08:00
John Ralls
b4bab92da2 Bug 798664 - Result of 'gnucash --nofile' is marked dirty
Don't create a new book in the new-user dialog unless the user says to.
Don't automatically create a new book when retrieving default commodities
because the retrieve might be requested in a context like the Preferences
dialog when there is no book.

Some report tests relied on requesting the default commodity creating
the book, so in those tests ensure that the book is created first.
2022-12-12 11:30:59 -08:00
Christopher Lam
bfc325f63c Merge branch 'maint' 2022-11-27 16:12:46 +08:00
Christopher Lam
3d8a28898d [gnc-budget] gnc_budget_get_account_period_note returns a const
to harmonize with all other char getters
2022-11-19 10:35:49 +08:00
John Ralls
939a77407c Merge branch 'price-quotes-cpp' 2022-10-14 11:25:14 -07:00
Mike Alexander
3c306eae65 Merge branch 'maint' 2022-10-09 22:27:55 -04:00
Mike Alexander
2d3e80ea08 Compatibility with XCode's "new build system"
With XCode 14 or newer CMake tries to use the "new build system" which has a
requirement that if two targets depend on the same generated file one of them
must depend on the other.  This commit adds reduntant dependencies to satisfy
this requirement.
2022-10-09 01:10:06 -04:00
Geert Janssens
7765e13704 Bindings - move log wrappers into the swig interface files
They are only used for guile (and possibly python, so there's
no need to carry them around in core-utils.
2022-10-02 11:50:26 -07:00
Geert Janssens
e5c6f6026b Remove support code that was only used by price-quotes.scm 2022-10-02 11:50:26 -07:00
Geert Janssens
e97fc3e408 Drop price-quotes.scm, gnc-fq-helper.in and gnc-fq-check.in - no longer used 2022-10-02 11:50:26 -07:00
John Ralls
a6e2842ea0 More distcheck fixes. 2022-10-02 09:47:35 -07:00
Christopher Lam
c78bb3c22c [test-gnc-option-scheme-output.scm] more scheme typos
Addendum to 11d395185
2022-09-27 21:36:05 +08:00
John Ralls
11d395185c Fix spelling of xaccAccountGetType. 2022-09-26 09:31:47 -07:00
Christopher Lam
161b07b241 Merge branch 'maint' 2022-09-09 21:23:40 +08:00
luz paz
ba94730a23 Fix various typos
Found via `codespell`
2022-09-06 10:44:29 -04:00
John Ralls
95361ad060 [options] Move gnc-options test to engine/test/CMakeLists.txt. 2022-08-29 17:05:33 -07:00
John Ralls
4ae17d12c7 [options] Move options from app-utils to engine.
Options is required for book options that are stored as part of the data
 file and so belongs in engine.
2022-08-25 22:09:56 -07:00
Christopher Lam
3e02859277 Merge branch 'maint' 2022-08-25 23:47:18 +08:00
John Ralls
e29ab5336f [options] Remove key and doc_string from gnc_register_query_option.
It's always used as an internal option with no UI component so it doesn't
use them.
2022-08-06 17:17:32 -07:00
John Ralls
6faaf3b427 [options] Provide a const char* value flavor for register_commodity
And register_currency_option
2022-08-06 17:17:32 -07:00
John Ralls
da0eff2cac [options] Implement widget-changed callbacks.
Enables full functionality for complex-boolean and multichoice-callback
options.

Note that setter-function callback isn't used in any GnuCash code so it
is not implemented and is not present in the register-callback functions.
2022-08-06 17:17:26 -07:00