Commit Graph

26843 Commits

Author SHA1 Message Date
Robert Fewell
57f874bd3f Change the behaviour of the gseettings migration
function

In the pref_transformations.xml file, when the release version is
greater than the current GnuCash version, do not process those changes.
2023-02-17 10:14:09 +00:00
Robert Fewell
ac0532bf5c Change the alignment of a function in gnc_gsettings.cpp 2023-02-16 14:23:52 +00:00
Robert Fewell
308c609904 Fix comment typo in gnc-gsettings.cpp 2023-02-16 14:23:51 +00:00
Robert Fewell
97dd119dd4 Separate out pref changes for 'invoice-printreport' in
pref_transformations.xml
2023-02-16 14:23:51 +00:00
Geert Janssens
286e1afa41 Bug 798749 - Fails to read gsettings on startup
Only cache GSettings objects we need to keep
track of callback functions.
This means a bit more overhead per GSettings
interaction, but as typical interactions are
only a few objects at once at best, this
overhead is unnoticeable.
2023-02-16 22:40:36 +01:00
John Ralls
ec6d38ae15 Merge Richard Cohen's 'fix-unused-1' into master. 2023-02-16 12:29:05 -08:00
Richard Cohen
3a3cf05ab5 Turn on -Wunused 2023-02-16 09:20:59 +00:00
Richard Cohen
9c6ad222a9 [-Wunused-function] - remove 2023-02-16 09:20:59 +00:00
Richard Cohen
05975aa510 [-Wunused-function] - remove commented out reduce_tests() and dependents 2023-02-16 09:20:59 +00:00
Richard Cohen
f702709422 [-Wunused-function] - make glade callbacks public 2023-02-16 09:20:59 +00:00
Richard Cohen
1204083fdc [-Wunused-variable] - mark window limit as potentially unused (only on Mac) 2023-02-16 09:20:59 +00:00
Richard Cohen
0aad569679 [-Wunused-variable] - mark QofLogModule as unused 2023-02-16 09:20:59 +00:00
Richard Cohen
083166b5ff [-Wunused-variable] - move into the #ifdef where it is used 2023-02-16 09:20:59 +00:00
Richard Cohen
4eb022c7a2 [-Wunused-variable] - remove 2023-02-16 09:20:59 +00:00
Richard Cohen
8a20bcadb0 [-Wunused-variable] - remove unused translatable string 2023-02-16 09:20:59 +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
Richard Cohen
f63dddcc84 [-Wunused-but-set-variable] (clang) - remove 2023-02-16 09:20:59 +00:00
Richard Cohen
dda1bb8374 [-Wunused-but-set-variable] (clang) - use 2023-02-16 09:20:59 +00:00
Richard Cohen
fe57fc4183 [-Wunused-but-set-variable] - remove 2023-02-16 09:20:59 +00:00
Richard Cohen
0dd406de10 [-Wunused-lambda-capture] (clang) - remove 2023-02-16 09:20:59 +00:00
Richard Cohen
0f3813e0fd [-Wunused-private-field] (clang) - remove
In file included from gnucash/gnome-utils/dialog-options.cpp:34:
gnucash/gnome-utils/dialog-options.hpp:55:10: warning: private field 'toplevel' is not used [-Wunused-private-field]
    bool toplevel;
         ^

In file included from gnucash/import-export/csv-imp/gnc-imp-props-price.cpp:42:
gnucash/import-export/csv-imp/gnc-imp-props-price.hpp:113:10: warning: private field 'created' is not used [-Wunused-private-field]
    bool created = false;
         ^

libgnucash/backend/dbi/gnc-dbisqlconnection.cpp:53:29: warning: private field 'm_conn' is not used [-Wunused-private-field]
    const GncSqlConnection* m_conn = nullptr;
                            ^
libgnucash/backend/sql/test/utest-gnc-backend-sql.cpp:81:33: warning: private field 'm_conn' is not used [-Wunused-private-field]
    const GncMockSqlConnection* m_conn;
                                ^
2023-02-16 09:20:18 +00:00
Richard Cohen
d4dfe4e279 [-Wunused-local-typedef] - remove
libgnucash/engine/test/utest-Account.cpp:2414:11: warning: typedef ‘using AcctTypeType = struct std::underlying_type<GNCAccountType>’ locally defined but not used [-Wunused-local-typedefs]
 2414 |     using AcctTypeType = std::underlying_type<GNCAccountType>;
      |           ^~~~~~~~~~~~
2023-02-16 09:19:19 +00:00
Richard Cohen
0798bce2a6 [-Wunused-value] - remove
borrowed/jenny/jenny.c: In function ‘next_builder’:
borrowed/jenny/jenny.c:1164:5: warning: statement with no effect [-Wunused-value]
 1164 |     for (i; i<n-1; ++i) {            /* reset all less significant positions */
      |     ^~~
borrowed/jenny/jenny.c:1172:5: warning: statement with no effect [-Wunused-value]
 1172 |     for (i; i<n-1; ++i) {            /* reset all less significant positions */
      |     ^~~
borrowed/jenny/jenny.c: In function ‘confirm’:
borrowed/jenny/jenny.c:1797:7: warning: statement with no effect [-Wunused-value]
 1797 |       for (i; i<n-1; ++i) {          /* reset all less significant positions */
      |       ^~~
borrowed/jenny/jenny.c:1805:7: warning: statement with no effect [-Wunused-value]
 1805 |       for (i; i<n-1; ++i) {          /* reset all less significant positions */
      |       ^~~

libgnucash/backend/xml/io-gncxml-v2.cpp: In function ‘gboolean qof_session_load_from_xml_file_v2_full(GncXmlBackend*, QofBook*, sixtp_push_handler, gpointer, QofBookFileType)’:
libgnucash/backend/xml/io-gncxml-v2.cpp:806:40: warning: value computed is not used [-Wunused-value]
  806 |                 g_thread_join (thread) != nullptr;
      |                 ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~

libgnucash/engine/Account.cpp: In function ‘void xaccFreeAccount(Account*)’:
libgnucash/engine/Account.cpp:1428:17: warning: statement has no effect [-Wunused-value]
 1428 |     priv->color == nullptr;
      |     ~~~~~~~~~~~~^~~~~~~~~~
libgnucash/engine/Account.cpp:1429:22: warning: statement has no effect [-Wunused-value]
 1429 |     priv->sort_order == nullptr;
      |     ~~~~~~~~~~~~~~~~~^~~~~~~~~~
libgnucash/engine/Account.cpp:1430:17: warning: statement has no effect [-Wunused-value]
 1430 |     priv->notes == nullptr;
      |     ~~~~~~~~~~~~^~~~~~~~~~
libgnucash/engine/Account.cpp:1431:18: warning: statement has no effect [-Wunused-value]
 1431 |     priv->filter == nullptr;
      |     ~~~~~~~~~~~~~^~~~~~~~~~

libgnucash/engine/gnc-int128.cpp: In function ‘void decimal_from_binary(uint64_t*, uint64_t, uint64_t)’:
libgnucash/engine/gnc-int128.cpp:898:36: warning: right operand of comma operator has no effect [-Wunused-value]
  898 |     d[3] = (hi >> 32) & bin_mask, 0;
      |                                    ^
2023-02-16 09:19:19 +00:00
Geert Janssens
9efbdc15cf CsvImp - use std::optional instead of boost::optional 2023-02-15 18:30:17 +01:00
Geert Janssens
c5109c67e5 MacOS - try with non-const key for map 2023-02-15 11:57:49 +01:00
Geert Janssens
1a09665333 Add proper include 2023-02-15 11:23:02 +01:00
Geert Janssens
4c5cc9f4a9 Attempt to fix build on MacOS 2023-02-15 11:00:40 +01:00
Geert Janssens
a982b60f17 Merge branch 'CsvTransImpExp' 2023-02-14 18:21:24 +01:00
Geert Janssens
6993fed229 CsvTransExp - fix info message to match state of simple format button 2023-02-14 17:58:05 +01:00
Geert Janssens
dae07fba99 CsvTransExp - treat single account as list of accounts with one element
That allows to remove another tracking variable.
2023-02-14 17:32:52 +01:00
Geert Janssens
1d971c1578 CsvTransExp - remove redundant counter num_accounts
Simply use length of account list instead
2023-02-14 17:24:11 +01:00
Geert Janssens
545f27c550 CsvTransExp - limit scope of variable to actual use 2023-02-14 16:52:13 +01:00
Geert Janssens
aa0a68fd1c CsvTransExp - repeat transaction details on every line in multi-line mode
The GnuCash Csv Importer can deal with both cases,
but there has been user feedback that the format
with only the first line displaying transaction
details is confusing and/or not readily usable
in external tools.
2023-02-14 16:47:23 +01:00
Geert Janssens
be0579dc0c CsvTransExport - more generic code cleanup
- declare variables on use
- more concise tests and loops
- drop unused includes
- gboolean->bool
2023-02-14 16:40:51 +01:00
Geert Janssens
9df059e9a5 CsvTransExport - omit trading splits unless exporting from a trading account 2023-02-14 14:52:59 +01:00
Geert Janssens
c6a93903b3 CsvTransExport - generic code cleanup
- declare variables on use
- more concise tests and loops
2023-02-14 13:10:32 +01:00
Geert Janssens
003f379d88 Bug 798600 - CSV import of multi-split security transactions fails to load capital gain - part 2
Update csv transaction export format to include split values.
In the csv importer the 'GnuCash Export Format' option will
now include values. For compatibility with filex exported
from older gnucash versions the previous preset is still
available under the name 'GnuCash Export Format (4.x and older)'.
2023-02-14 11:57:28 +01:00
Geert Janssens
9e1268d934 Bug 798600 - CSV import of multi-split security transactions fails to load capital gain - part 1
Transactions with capital gains processing can have
splits in transaction currency with a zero amount
and a non-zero value. To properly import those,
prefer the value column even if transaction
currency equals account commodity.
Previous (wrong) assumption was that in case
of a same-currency split, the amount would
always be the value.
2023-02-14 10:41:28 +01:00
Frank H. Ellenberger
232dd76562 Merge branch 'maint' 2023-02-13 19:15:12 +01: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
mocsa
10b73de133
Translation update by mocsa <csaba@feltoltve.hu> using Weblate
po/hu.po: 60.8% (3285 of 5401 strings; 1196 fuzzy)
553 failing checks (10.2%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by mocsa <csaba@feltoltve.hu> using Weblate

po/hu.po: 60.7% (3280 of 5401 strings; 1203 fuzzy)
556 failing checks (10.2%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by mocsa <csaba@feltoltve.hu> using Weblate

po/hu.po: 61.9% (3345 of 5401 strings; 1212 fuzzy)
562 failing checks (10.4%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by mocsa <csaba@feltoltve.hu> using Weblate

po/hu.po: 61.9% (3344 of 5401 strings; 1213 fuzzy)
548 failing checks (10.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by mocsa <csaba@feltoltve.hu> using Weblate

po/hu.po: 61.9% (3344 of 5401 strings; 1213 fuzzy)
534 failing checks (9.8%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by mocsa <csaba@feltoltve.hu> using Weblate

po/hu.po: 61.9% (3344 of 5401 strings; 1213 fuzzy)
516 failing checks (9.5%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by mocsa <csaba@feltoltve.hu> using Weblate

po/hu.po: 61.9% (3344 of 5401 strings; 1213 fuzzy)
507 failing checks (9.3%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Translation update  by mocsa <csaba@feltoltve.hu> using Weblate

po/hu.po: 61.9% (3344 of 5401 strings; 1213 fuzzy)
496 failing checks (9.1%)
Translation: GnuCash/Program (Hungarian)
Translate-URL: https://hosted.weblate.org/projects/gnucash/gnucash/hu/

Co-authored-by: mocsa <csaba@feltoltve.hu>
2023-02-13 16:28:25 +01:00
Christopher Lam
851b51d547 [new-owner-report] use let* to access split->owner
oops
2023-02-13 23:27:38 +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
Geert Janssens
3f3460fec9 Bug 782141 - Import CSV - Multi-currency support can cause rounding errors
This commit introduces new column types 'Value' and 'Value (Negated)'
which can be used to indicate what the value of a split's amount
is in the transaction currency. These will only be used if the
transaction currency is different from the account commodity
of the given split. Otherwise the amount will simply be
used as value.
2023-02-13 13:08:08 +01:00
Geert Janssens
6ada3822f2 CsvTransImp - drop obsolete sanity check
Incomplete transfer split data will now be used by
the generic import matcher to create the balancing split.
2023-02-13 13:08:08 +01:00
Geert Janssens
625978cc33 CsvTransImp - rework verification code to prevent new cases of invalid transactions
With the added multi-currency support it would be possible
to create imbalanced splits. A new check is added to detect
this beforehand and prevent users from continuing.
This required much of the verification logic to be revisited.
2023-02-13 13:08:08 +01:00
Geert Janssens
57c525fb19 Remove unused function 2023-02-13 13:08:08 +01:00
Geert Janssens
4737665289 Don't use boost::optional for gnc_commodity pointers
These pointers can simply be checked for null to determine
whether they are set or not.
2023-02-13 13:08:08 +01:00
Geert Janssens
9384308b05 Remove unneeded forward declaration 2023-02-13 13:08:08 +01:00