Commit Graph

27207 Commits

Author SHA1 Message Date
Christopher Lam
5acf686c76 [eguile-utilities.scm] fmtnumeric: use xaccPrintAmount
fmtnumeric is used to render Quantity, Discount percent. Previously it
would render 1/3 as 0.333333333. Use xaccPrintAmount to show exact
fractions for Qty and Discount, where appropriate.
2023-02-18 13:13:54 +08:00
Christopher Lam
2acba0ea18 [taxinvoice.scm] use fmtnumeric to render discount percentage 2023-02-18 13:10:50 +08:00
Jeff
87ff5f1191 [taxinvoice.eguile.scm] subtotal discount column appropriately 2023-02-18 13:08:46 +08:00
Christopher Lam
498799a749 [receipt.eguile.scm] remove commented-out line 2023-02-18 13:08:33 +08:00
Geert Janssens
8a23304283 GncGSettings - use bool as return type for static function 2023-02-17 18:10:35 +01:00
Geert Janssens
ea60687524 CsvPriceImp - change a few translatable strings to match the once in CsvTxImp
Saves translators a few cycles.
2023-02-17 14:15:59 +01:00
Geert Janssens
64329414e9 GncGSettings - cosmetic: NULL->nullptr 2023-02-17 14:08:20 +01:00
Geert Janssens
32ae47980c GncGSettings - some minor cleanups
- remove unused macros
- avoid manual counters
2023-02-17 14:02:34 +01:00
Geert Janssens
03aff5642a GncGSettings - rework signal handler manipulation
Use ref-counting to manage GSettings object lifecycle
Use g_signal_handler_handlers_[un]block_matched to
block or unblock handlers rather than tracking them in
our own hash table.
2023-02-17 14:02:34 +01:00
Geert Janssens
4761aa414c GncGSettings - reduce code duplication
Most getters and setters are identical with the exception of
the actual function to call into GSettings. Extract
boilerplate in two template functions and make all
getters/setters wrappers of these two functions.
2023-02-17 11:48:41 +01:00
Geert Janssens
edab41f23a GncGSettings - basic c++ cleanups
- declare at first use
- gboolean->bool (TRUE/true, FALSE/false)
2023-02-17 11:48:41 +01:00
Robert Fewell
a1d17518a8 Add a function to dump the schema entries when in debug
mode.
2023-02-17 10:15:23 +00:00
Robert Fewell
2306ef8ca6 On a new install, the gnc_gsettings_version_upgrade
would not run

When doing a new install, set the GNC_PREF_VERSION to the current
version.
2023-02-17 10:14:42 +00:00
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