Commit Graph

2019 Commits

Author SHA1 Message Date
John Ralls
8a7c539258 Bug 798748 - Transaction Notes field's value does not appear in...
reverse transaction.

The proximate cause was that xaccTransBeginEdit put the KVP cache
variable of the new transaction in a state that prevented the value
from being copied. More generally the KVP cache variables didn't
handle any invalidating events.

With the change to GValue usage in qof_instance_get_kvp it's now
a simple memory dereference with no copying except for POD types
so caching is no longer useful. This commit removes caching from
Transaction, eliminating the notes problem.
2023-02-27 14:54:46 -08:00
John Ralls
ddc3f28899 [kvp] Use static strings and boxed in gvalue_from_kvp_value.
Saves allocating and copying complex values, avoiding potential
memory leaks.
2023-02-27 14:54:02 -08:00
Richard Cohen
9f06859390 Remove references to old boost versions
we already require 1.67
2023-02-27 11:48:09 +00:00
Richard Cohen
3d995de2ab Refactor: use default GncOptionValue copy constructor 2023-02-27 11:46:39 +00:00
Richard Cohen
1b0af4246a Refactor: remove extra template parameter from member functions 2023-02-27 11:46:34 +00:00
Richard Cohen
87c52f53fa Update some references to hello-world.scm 2023-02-27 11:36:04 +00:00
Richard Cohen
ec169e6e24 Fix some non-translatable typos 2023-02-27 11:32:12 +00:00
Christopher Lam
47b85d3b2f [gnc-xml-backend.cpp] g_free char* from g_path_get_dirname 2023-02-27 09:18:01 +08:00
Christopher Lam
89e2bef427 Merge branch 'maint' 2023-02-26 13:51:33 +08:00
Christopher Lam
89e63ef672 Bug 798754 - Build fails with gcc 13 and glib > 2.76, ter 2023-02-26 08:30:14 +08:00
John Ralls
6ab7b16d62 [c++options] Restore the ability to set plot sizes in pixels.
Enable and fix the previously untested GtkOptionGtkUIItem::PLOTSIZE.

This has the potentially unfortunate side effect that integer range
options are assumed to be plot sizes. That's correct for now, but
if some report comes along that needs an integer range option for
something else it will have to be differentiated.
2023-02-25 16:25:36 -08:00
Christopher Lam
abcce5000c Bug 798754 - Build fails with gcc 13 and glib > 2.76, bis 2023-02-25 13:12:35 +08:00
Geert Janssens
26482f397b Bug 797033 - The CSV Importer should not obey with the "automatic digital point" setting
Expose variations of xaccParseAmount and
xaccParseAmountExtended that will ignore the
automatic decimal point user preference.
This preference is really only useful for manual number
entering in the register.

The xaccParseAmountImport variant replaces xaccParseAmountPosSign
which was used exclusively by the csv importers.
Like xaccParseAmountPosSign, this replacement has the flag
to ignore or parse the positive number indicator.
2023-02-24 23:02:15 +01:00
Frank H. Ellenberger
fcbda57a6b Merge branch 'maint' 2023-02-24 19:19:12 +01:00
John Ralls
184669f517 Bug 798754 - Build fails with gcc 13 and glib > 2.76
GLib 2.76 introduced a no-discard warning on g_string_free
if the second parameter is FALSE. This revealed a string
leak and a correct usage that didn't use the return value.
2023-02-23 09:47:37 -08:00
Geert Janssens
549c93e005 Fix test for import-backend
Another split function needed mocking
2023-02-23 12:33:31 +01:00
Richard Cohen
bddb4468fa Import GLIB2 as a target, and use it to simplify the CMakeLists 2023-02-21 12:59:42 +00:00
Robert Fewell
ec7cc27d6d Add tests for default invoice report book property 2023-02-21 10:48:34 +00:00
Robert Fewell
76f0e3a97e Add some PWARN messages to the default invoice report
book functions
2023-02-21 10:44:07 +00:00
Geert Janssens
8a23304283 GncGSettings - use bool as return type for static function 2023-02-17 18:10:35 +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
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
Richard Cohen
9c6ad222a9 [-Wunused-function] - remove 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
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
Richard Cohen
bd8e81f35c Move an unused variable into an #ifdef where it is used 2023-02-06 14:20:31 +00:00
Richard Cohen
1c6679720b Use some unused variables 2023-02-06 14:20:31 +00: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
c819b03a17 Remove some unused variables - leave the side effect 2023-02-06 14:19:29 +00:00
Richard Cohen
ea2d3be217 Remove some unused variables with obviously no side effects 2023-02-06 14:19:22 +00:00
Richard Cohen
4e25bbfc43 Mark some QofLogModules as potentially unused
- __attribute__((unused)) for C
- [[maybe_unused]] for cpp
2023-02-06 14:12:31 +00:00
Robert Fewell
45a07463fb Change max timeout to 20 seconds for default invoice report 2023-02-05 10:21:56 +00:00
Christopher Lam
85c2491664 Merge branch 'maint' 2023-02-05 12:09:38 +08:00
Geert Janssens
60209a766f Merge branch 'csv_import' 2023-02-04 19:13:16 +01:00
Geert Janssens
2d8bb6f62f Bug 796955 - Import CSV - Single-line two-currency transactions can't be imported
Behaviour is as follows:
If
  single line provides a price
And
  at some point in the import process we get into a
  situation where the base account and transfer
  account have a different commodity
Then
  transfer_acct amount = base_acct amount * price

If on the other hand base_acct and transfer_acct turn
out to have the same commodity, price is ignored.
2023-02-04 18:56:02 +01:00
Geert Janssens
99506d331a Reduce GncImportMatchMap to just the account
There is no added value in storing the book and account together
The book is easily retrieved from the account (as was
illustrated in the gnc_account_imap_new function).

I looked through the commit history to understand why this struct
was originally created and a long time ago it also had
a reference to a kvp frame.
2023-02-04 16:53:20 +01:00
Geert Janssens
51706f289c Minor corrections in comments 2023-02-04 16:43:46 +01:00
John Ralls
7bb14b9caa Merge Richard Cohen's 'use-reference-for-loop' into master 2023-02-02 14:32:14 -08:00
Robert Fewell
07f3f536cc Allow to select saved report on print invoice button
This change was inspired by mildred's #PR1247 and uses the new
GncReportCombo to allow selection of 'Saved Invoice reports' when the
invoice print button is used or when printing multiple invoices.

This change presents a dialog with the default for the report combo set
to the properties setting. This dialog has a timeout which is
adjustable under properties and will stop if a key is pressed or combo
popped so that a different report template can be selected and used.
There is also an 'OK' button that stops the time out and prints and a
'Cancel' button which cancels the print.
2023-02-02 14:05:53 +00:00
Robert Fewell
019214f1c2 Bug753307 - Custom Report be selectable as default Report for Printing
This commit changes the preference in Business->'Report for Printing'
to be saved as a book property and allow the selection of any Invoice
Report to be used as the default.
2023-02-01 16:29:11 +00:00
Richard Cohen
d8f45f2443 Use const references for for-loops to avoid unnecessary copies
Found by clazy - clazy-range-loop-reference
2023-01-31 14:44:57 +00:00
John Ralls
ce3447e6ea Bug 798740 - Build fails with gcc 13
Protect against passing an lseek failure rv to read().
2023-01-30 16:48:16 -08:00
Christopher Lam
119356752f Merge branch 'maint' 2023-01-30 09:56:13 +08:00
Geert Janssens
894f8241e1 Revisit invoice payment in multi-currency context
- Show proper amount in dialog when applying or editing an existing transaction as payment
- Be more careful not to waste the existing payment split
- If the user changed the payment amount while starting from an existing transaction
  unreconcile the changed payment split
- Avoid needlessly changing transaction currency (only do so if the user chose
  a new transfer account and the old currency is neither the new transfer account's
  currency nor the post account's currency)
2023-01-29 23:09:06 +01:00
John Ralls
44f4b55927 Merge Richard Cohen's 'fix-memleaks' into master. 2023-01-26 12:52:21 -08:00
Richard Cohen
846e75146a Fix some typos so that the correct tests are run
- test_gnc_txn_to_float_txn_cut_semantics
- test_dbi_business_store_and_reload
2023-01-26 15:42:13 +00:00
Richard Cohen
a2ffc7fe75 Fix memory leak in binreloc function _br_find_exe()
Ironically, it seems to be in a code path that
is only followed when using valgrind
2023-01-26 14:36:43 +00:00
luzpaz
67ab9e90d2 Fix some typos 2023-01-26 13:48:58 +01:00
Christopher Lam
17820ec261 Merge branch 'maint' 2023-01-26 18:40:44 +08:00
John Ralls
f4c6d65395 Merge Bob Fewell's 'nofree' into maint. 2023-01-24 13:25:02 -08:00
John Ralls
f6919e60a7 Merge Richard Cohen's 'cleanup' into master. 2023-01-24 12:05:47 -08:00
John Ralls
46f9fb01c9 Simplify gnc_commodity equality and compare functions.
gnc_commodity_compare is used for sorting and so needs to have a less-than
return value. The only place it's used presents nothing to the UI; a GncGUID
ordering is fast and stable.

GnuCash allows only one commodity per book for any namespace/mnemonic pair, so
the exhaustive string comparisons are superflous. While the current engine
design allows only one instance of any object, meaning that a pointer comparison
is sufficient to determine equality, that may not be true in the future, but the
GncGUID is guaranteed to sufficiently identify a single commodity. Note that
gnc_commodity_equiv is used to enforce that single-commodity rule and so cannot
use GncGUID comparison.
2023-01-24 10:46:01 -08:00
Richard Cohen
6927535a0a Remove unused test function get_object_is_initialized in qofobject.cpp 2023-01-24 13:36:37 +00:00
Richard Cohen
925fcbc3fd Remove unused gnc-jalali.{c,h} 2023-01-24 13:36:23 +00:00
Richard Cohen
e83c91050c Remove unneeded dummy.cpp 2023-01-24 13:36:02 +00: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
3360a6d13b Remove extra semicolons
Courtesy of gcc -pedantic
2023-01-24 13:22:18 +00:00
John Ralls
046e4a156e Silence Clang deprecation warnings about sprintf. 2023-01-23 12:54:25 -08:00
John Ralls
dd2497416c Merge Richard Cohen's 'internal-extern-c' into master. 2023-01-23 11:27:05 -08:00
John Ralls
60c06debce [c++options] Don't crash when find_option returns nullopt. 2023-01-23 11:22:35 -08: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
Richard Cohen
19bbde7000 Fix some typos 2023-01-23 15:01:46 +00:00
John Ralls
432f2d4bb8 Merge Richard Cohen's suppress-boost-warning into master. 2023-01-22 10:50:11 -08:00
John Ralls
9a1a90d8d0 Merge branch 'maint' 2023-01-22 10:49:29 -08:00
richardcohen
f3cc223f5f Fix some bad code formatting 2023-01-22 10:39:48 -08:00
richardcohen
8044f79f75
Silence the boost (<1.76) warning message
from .../gnucash-4.8/libgnucash/app-utils/gnc-quotes.cpp:33:
/usr/include/boost/bind.hpp:36:1: note: ‘#pragma message:

    The practice of declaring the Bind placeholders (_1, _2, ...) in the
    global namespace is deprecated.
    Please use <boost/bind/bind.hpp> + using namespace boost::placeholders,
    or define BOOST_BIND_GLOBAL_PLACEHOLDERS to retain the current behavior.’
    
The issue was fixed in boost 1.76, but, e.g ubuntu 22.04 has boost 1.74
2023-01-22 17:50:34 +00:00
Christopher Lam
fd007a0af1 Merge branch 'maint' 2023-01-13 07:45:31 +08:00
Robert Fewell
6df866f876 Add tests for the reconcile account functions 2023-01-12 14:38:08 +00:00
Robert Fewell
fd37ee997d Fix getting xaccAccountGetReconcilePostponeBalance
Change the G_VALUE from a INT64 to BOXED.
2023-01-12 14:38:08 +00:00
John Ralls
fb9947b7b6 Rename GncDateTime's ymd to gnc_ymd to avoid a name conflict with Carbon. 2023-01-09 14:36:06 -08:00
John Ralls
fed4daf4e7 [c++ quotes] Make sure to include all of the required Boost libraries.
Also Boost-iostreams needs winsock but doesn't tell Cmake, so explicitly
add it to the link list.
2023-01-08 16:11:58 -08:00
Christopher Lam
c65b36490a Merge branch 'master-progress' 2023-01-06 16:33:46 +08:00
Frank H. Ellenberger
506a1b3c5e Merge branch 'maint' 2023-01-06 01:31:13 +01:00
Alex Aycinena
1085d8920b Update Form/Schedule line references for 2022 for the US Income Tax Report 2023-01-04 16:58:57 -08:00
John Ralls
b922cfd78d Bug 798679 - Unicode normalization should be used for comparison but not stored.
Change to NFC normalization for all comparisons because the Unicode
meaning of compatible might collide with the user's intent.
2023-01-04 13:19:36 -08:00
John Ralls
31d79e3004 Merge Bob Fewell's 'bug798673' into master. 2022-12-30 16:00:12 -08:00
John Ralls
5c17950a59 Merge Bob Fewell's 'mainwin2' into master. 2022-12-30 13:56:54 -08:00
Christopher Lam
259881f940 [gnc-optiondb] add some more renamed options
following ab13b01f8c Replace ... with … in all translatable strings.
2022-12-24 22:14:35 +08:00
John Ralls
ab13b01f8c Replace ... with … in all translatable strings.
Also a few other places like translator comments and report options.

Replaces https://github.com/Gnucash/gnucash/pull/1033.
2022-12-23 12:43:54 -08:00
Geert Janssens
734f90bd36 Replace string literal 'gnucash' with PROJECT_NAME parameter where it makes sense
The idea behind this is to not assume the project is always built
as "gnucash" exactly.
One example where it can be useful to use a different project name
would be when building multiple development versions of the project
on the same system and don't want these different versions share
the same settings in GSettings or the same stored passwords.
2022-12-19 22:18:12 +01:00
John Ralls
b8c0673526 Merge branch 'maint' 2022-12-19 12:11:32 -08:00
Robert Fewell
7536fcaf2f Change the balance limit icon if both limits are zero
When higher and lower limits are zero, when used for a a suspense
account, change the icon to 'dialog-warning'. This type of use is to
indicate that a non zero balance exists.
2022-12-17 11:44:45 +00:00
John Ralls
091d4aff22 Bug 798657 - Import Summary language is wrong
Root cause is using boost::locale::translate because it ignores
the LANGUAGES environment variable and doesn't support different
values for LC_MESSAGES, LC_DATE, LC_MONETARY, and LC_NUMERIC.
That makes it impossible to configure a user environment that
presents translated strings in a different locale from the one
applied to formatting dates and numbers.

To correct this replace all use of boost::locale::translate
with GNU gettext.
2022-12-16 15:34:10 -08:00
Robert Fewell
3be25ff0a9 Add some tests for the account functions 2022-12-16 15:16:58 +00:00
Robert Fewell
a15c6f81b3 Allow the balances of sub accounts to be used in limits 2022-12-16 15:16:53 +00:00
Robert Fewell
60ab654d2b Add account balance test functions to gnc-ui-balance 2022-12-16 15:16:16 +00:00
John Ralls
73a134730f Bug 798680 - Not able to match a reverse transaction of a...
previously matched transaction.

Cloned transactions and copied splits shouldn't keep the online-id
slot.
2022-12-13 13:13:13 -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
John Ralls
fae5de80d3 Undo unintended change in Bug 798679 commit. 2022-12-11 19:54:35 -08:00
John Ralls
fd2761bd68 Bug 798679 - Fullwidth characters cannot be pasted as-is in register fields
Control character check doesn't need normalization, the control character
codepoints aren't graphic and so can't be composed nor have compatible
equivalents.
2022-12-11 13:00:40 -08:00
Robert Fewell
518ecfe041 Add some functions that would allow adding a balance limit to accounts 2022-12-10 13:37:41 +00:00
Geert Janssens
98251d59a6 Bug 798672 - Preferences are not saved nor loaded, ERROR <GLib-GIO> g_settings_new_full: assertion 'schema != NULL' failed
Apparently it was a failure on our side to properly look up
requested gsettings schema.
2022-11-29 12:27:21 +01:00
Christopher Lam
bfc325f63c Merge branch 'maint' 2022-11-27 16:12:46 +08:00
Marco Scardovi
6fe2028bca
Fix test
Signed-off-by: Marco Scardovi <mscardovi@icloud.com>
2022-11-24 23:20:07 +01:00
Robert Fewell
59d95a4ce6 Bug 798545 - Crash when updating document link on vendor bill
There were two issues here, the first one was that the copied doclink
was pointing to the original doclink which lead to a double-free. The
second is the setting of the doclink on the copied invoice needs to be
done with gncInvoiceSetDocLink otherwise on closure the doclink value
will disappear.
2022-11-24 11:16:01 +00: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
Christopher Lam
2ee0c98200 [gnc-budget] use operator[] instead of find() and insert()
- avoid hashing Account* twice. one call to operator[] is sufficient.
- don't need use std::move with better constructors
- sanity check - can't have a budget with num_periods = 0
- remove unused headers
2022-11-19 10:35:43 +08:00
Christopher Lam
3e5fcc8709 Merge branch 'maint' 2022-11-15 22:20:54 +08:00
Robert Fewell
4f8643674b Remove all references to GncDisplayItem 2022-11-05 17:04:12 +00:00
Robert Fewell
078d7875d3 Change all references to plugin_class->actionsb
Change all references to plugin_class->actionsb and n_actionsb to
plugin_class->actions and n_actions
2022-11-05 17:04:11 +00:00
Christopher Lam
6f80c548e6 [gtest-qofevent.cpp] comprehensive tests for qofevent 2022-11-05 09:25:24 +08:00
Christopher Lam
05ffd3d4eb [budget-feature] move unset_feature call to gnc_budget_gui_delete_budget
because gnc_budget_gui_delete_budget is a more general function to
delete a budget.
2022-10-31 12:03:58 +08:00
Christopher Lam
b87aa004f9 [test-qofbook] add tests for unknown features
tests that gnc_features_test_unknown returns a suitable error message
2022-10-31 10:40:12 +08:00
Robert Fewell
0f70143c55 Initial change to plugin source files 2022-10-30 13:16:34 +00:00
John Ralls
b9077bccd3 Bug 798640 - Segfault when running saved report 2022-10-29 17:45:35 -07:00
Christopher Lam
fc94b41c81 Merge branch 'maint' 2022-10-29 21:53:57 +08:00
Christopher Lam
4716af24e4 Merge branch 'maint' 2022-10-29 21:16:34 +08:00
Christopher Lam
ba44f720c1 Merge branch 'maint' 2022-10-29 21:15:41 +08:00
Christopher Lam
f2354d6b2a [test-qofbook.c] add test for gnc_features_set_unused 2022-10-29 21:01:08 +08:00
Christopher Lam
1516bb18b0 [gnc-features.cpp] backport gnc_features_set_unused from master 2022-10-29 21:01:01 +08:00
Christopher Lam
a078921a33 [qofbook.cpp] backport qof_book_unset_feature from master 2022-10-29 21:00:54 +08:00
John Ralls
cf088f2a70 Merge John Ralls's 'Bug798614' into maint. 2022-10-28 15:27:28 -07:00
Christopher Lam
093aa81ed1 [qofbook.cpp] deprecate qof_book_get_features 2022-10-28 21:57:15 +08:00
Christopher Lam
8192deff37 [gnc-features.cpp] convert to cpp
- don't need to create/destroy GHashTable for each feature query
- plugs leak: g_hash_table_unref (features_used) not always called properly
- to check 1 feature, don't need to traverse whole GHashTable
2022-10-28 20:50:35 +08:00
Christopher Lam
6f6d2fef48 [test-qofbook] basic features test
sets a feature and tests it's set. it's impossible to design a book
with unknown features using the API.
2022-10-27 20:10:49 +08:00
John Ralls
14a0ea4ed3 [price-quotes] Sort and format source list. 2022-10-17 11:13:55 -07:00
John Ralls
1a906b00aa [price-quotes] Enable gnucash-cli to retrieve preferences on macOS.
By embedding a minimal Info.plist with a bundle ID into the executable.
This necessitated a change to binreloc because the unix-style install
depended on there being a bundle ID only when the program was run from
an application bundle.
2022-10-17 10:06:21 -07:00
John Ralls
2767587874 [price-quotes] Fix setting alphavantage API key. 2022-10-14 15:47:07 -07:00
John Ralls
939a77407c Merge branch 'price-quotes-cpp' 2022-10-14 11:25:14 -07:00
John Ralls
7f2a09a69f [price-quotes] Handle short error strings from finance-quote-wrapper.
This keeps the translation work in GnuCash and improves the error
signalling in gnc-quotes.
2022-10-14 10:26:51 -07:00
John Ralls
fe9b23ff2b [price quotes] Pass short errors to gnc-quotes.
And wordier but not translated messages when STDERR is a tty.
2022-10-14 10:26:51 -07:00
John Ralls
88d658fef0 [price-quotes] Date::Manip is no longer required. 2022-10-13 14:58:27 -07:00
John Ralls
50c72b4f88 [price-quotes] Remove m_ready and usable() from GncQuoteSource.
GncQuoteSource ctor throws if something is wrong so usable is always true.
2022-10-13 14:28:17 -07:00
John Ralls
7d93774dd2 [price-quotes] Throw instead of returning if there aren't any commodities to quote.
So that the user gets sees an error instead of silent failure.
2022-10-13 13:51:37 -07:00
John Ralls
81d4ea9550 [price-quotes] Remove F::Q version format check.
We don't care what the version string looks like as long as there is one.
2022-10-13 12:58:09 -07:00
John Ralls
c78fe37ff7 [price-quotes] General typo fixes and code cleanup. 2022-10-13 12:52:36 -07:00
John Ralls
70c9d4c9e3 [price-quotes] Fix version retrieval.
Plus there's no need for a "not found" version string because GncQuotes
construction will throw if Finance::Quote isn't correctly installed. No
object, nothing to call version() on.
2022-10-13 12:20:59 -07:00
John Ralls
97e730b8d8 [price-quotes] Reformat test quote response strings to one line per quote. 2022-10-13 11:24:49 -07:00
John Ralls
f24c2c8bdd Instrument failure to set the account when creating a split. 2022-10-11 14:05:45 -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
John Ralls
c7d1b6ab26 Bug 798633 - 4.12 build failure on 32-bit Linux: "No code for module" 2022-10-04 09:12:10 -04:00
John Ralls
673a925554 [price-quotes] Remove superseded gnc-fq-dump and Quotes-example.pl 2022-10-02 11:50:26 -07:00
John Ralls
e817091de1 [price-quotes] Warn only once if the AlphaVantage Key isn't set.
And check the environment if it's not in preferences.
2022-10-02 11:50:26 -07:00
John Ralls
d97ea77762 [price quotes] Add report member function to display quote information to stdout.
Instead of creating price instances in the database.
2022-10-02 11:50:26 -07:00
John Ralls
6ffb0bb633 [price-quotes] Report quote fetch failures to the user. 2022-10-02 11:50:26 -07:00
John Ralls
4c47e91180 [price-quotes] Implement error codes for currency and quote failures. 2022-10-02 11:50:26 -07:00