Commit Graph
15974 Commits
Author SHA1 Message Date
lmat 30fac05e35 Corrected uses of guid_to_string.
Previously, guid_to_string had been marked deprecated with a note about
it not being thread-safe. It was much worse than "not thread safe", it
was only safe in a particular situation, and its safety was being violated
throughout the code. It was clear that users of guid_to_string did not
understand what it was purporting to do because of its varied uses. Most
uses simply treated it like a Garbage-Collected Java String (use and forget).
I actually found at least one instance where the string was being freed. (!!!)

I made the method have a particular easy-to-understand semantic: it returns
a pointer to a string which must be freed by the caller. I then tried to
track down all uses of this function and correct them. Mostly, I just changed
the usage to guid_to_string_buff with a stack-allocated string to avoid the
the malloc/free cycle.
2014-07-25 17:30:55 -04:00
lmat 2a408ab9ef Cleared up GUID construction and allocation
To allocate a GUID, use guid_malloc. To allocate and construct a guid
(which is actually unique), use guid_new (and be sure to free it using
guid_free).
2014-07-25 14:14:09 -04:00
lmat 9c82a1e9bc Rename guid_new to guid_replace
`new` implies some allocation. Since guid_new was actually constructing
a guid in place rather than allocating it, it makes much more sense to
call it guid_replace (or guid_construct). We went with guid_replace.
2014-07-25 08:26:54 -04:00
lmat 26a49f9644 Implement GUID using boost's implementation
Since we're maintaining a C api, the implementation is sometimes less than
intuitive from either a C or C++ perspective. I am trying to use as much
boost as possible while making all the guarantees that the C code makes.

One function was declared deprecated because it "wasn't thread safe". This
was straightforward to repair, and is no longer marked deprecated, and there
are now two ways to convert GUID to String: passing your own character
buffer, and having one returned to you that you need to free.
2014-07-25 08:17:28 -04:00
John Ralls 34a7e8d62c Add Boost requirement to CMake. 2014-06-16 11:03:45 -07:00
John Ralls 273648ea80 Allow C/C++ extensions
MinGW declares any standard functions not part of the ISO C standard
in #ifndef __STRICT_ANSI__ blocks; Gcc defines __STRICT_ANSI__ with
-std=c++11; Pass 'ext' to the C++11 macro to get -std=gnu++ll, which allows
all those extensions we use.
2014-06-15 14:42:49 -07:00
lmat 949702d04d Added a GUID test suite
The plan is to change gnc guid to use boost's guid implementation. There were
no tests for guid before, but we need them to ensure that we don't have regressions
when that work begins.
2014-06-15 14:42:47 -07:00
John Ralls ce409753b8 Disable C++11 deprecation warning for register storage class
It's used in GLib, so we're stuck with it for the short term.
2014-06-15 14:42:46 -07:00
John Ralls b36a98149b Better test for conflict between optimization and FORTIFY_SOURCE 2014-06-15 14:42:45 -07:00
John Ralls 33aa8a13a7 Don't override CFLAGS, CPPFLAGS, etc.
Doing so gives the hardcoded values precedence over the user's environment.
Use AM_CFLAGS, AM_CPPFLAGS, etc. instead.
2014-06-15 14:42:43 -07:00
John Ralls 8e25412d20 Add optional use of Google Profiler.
See https://code.google.com/p/gperftools
2014-06-15 14:42:42 -07:00
John Ralls 8a899fc47a Add dependency on Boost. 2014-06-15 14:42:41 -07:00
John Ralls ae93f2b9c9 Check for C++11 support, fail if it's not there. 2014-06-15 14:42:39 -07:00
John Ralls bd93cb26dd Fix reaches end of function error 2014-06-15 13:48:42 -07:00
Christoph Holtermann b68e261c79 Some adjustments, new IPython version 2014-06-06 17:00:53 +02:00
Geert Janssens eb4fc0002d Merge branch 'maint' into master
* Bug 719457 - Template for Home Mortgage Loan isn't properly nested.
* Always use the price we display to calculate the current value of an account.
* Bug 728717 - Ubuntu 14.04 - GNUcash crashes on close
* Bug 725054 - Re-numbering sub accounts crashes the program
* More fix-ups for the renumber subaccounts dialog.
* 722200 - configure script does not pick the correct am_cv_scanf version
* Python bindings.  Add function gncVendorNextID, complementary to gncCustomerNextID
* Bug 730255 - Python bindings: Assigns bill entries to non-existant invoice.
* Relax requirements for booleans in invoice line.
* Add some date format checking and make sure generated dates are the correct user selected format, not always locale format.
* Fix broken win32 build; MinGW needs our strptime.
* Fix broken build on 64-bit systems
* New/revised version of the Brazilian Portuguese translation file, For version 2.6.3. Translator: Miguel Rozsas <miguel@rozsas.eng.br>
* Bug 720934 - Barcharts with many data points have overlapping x-axis labels
* Python bindings - no instance necessary anymore
2014-06-06 16:54:44 +02:00
Christoph Holtermann 840feccbf7 Python bindings - no instance necessary anymore 2014-06-06 16:51:43 +02:00
Carsten Rinke 88bfbb19a0 Bug 720934 - Barcharts with many data points have overlapping x-axis labels
Use jqplot.cursor.js (enanbles zooming) and jqplot.dateAxisRenderer.js instead of jqplot.categoryAxisRenderer.js
2014-06-06 16:51:42 +02:00
Jeff Earickson 549ede1168 New/revised version of the Brazilian Portuguese translation file, For version 2.6.3. Translator: Miguel Rozsas <miguel@rozsas.eng.br> 2014-06-06 16:51:42 +02:00
John Ralls c9c498a85c Fix broken build on 64-bit systems
Where G_GUINT64_FORMAT is %ld, so GCC complains about long long.
2014-06-05 13:15:52 -07:00
John Ralls 8ac8c70cf1 722200 - configure script does not pick the correct am_cv_scanf version
Wrap SCANF_FOO_CHECK calls with CFLAGs including -Wall -Werror so
that the tests fail to compile and %lld fails as it does during the
build.
2014-06-03 11:18:39 -07:00
John Ralls c5de3a9c46 Fix broken win32 build; MinGW needs our strptime. 2014-06-02 17:38:49 -07:00
John Ralls b08799314e 722200 - configure script does not pick the correct am_cv_scanf version
Different tack: Use G_GUINT64_FORMAT in guid.c instead of messing with
defining __USE_MINGW_ANSI_STDIO
2014-06-02 16:46:47 -07:00
John Ralls 33c4facfc7 Revert "722200 - configure script does not pick the correct am_cv_scanf version"
This reverts commit f9548652de.
2014-06-02 13:41:00 -07:00
John Ralls dbd8a5638c Revert "722200 - configure script does not pick the correct am_cv_scanf version"
This reverts commit f3e76fb9df.
2014-06-02 13:40:26 -07:00
Mike Evans 620114af49 Merge branch 'maint' of https://github.com/Gnucash/gnucash into maint 2014-06-02 17:22:29 +01:00
John Ralls f3e76fb9df 722200 - configure script does not pick the correct am_cv_scanf version
Add -Wall -Werror to CFLAGS to try to force failure.
2014-06-02 17:21:34 +01:00
Mike Evans 72911a7caa Add some date format checking and make sure generated dates are the
correct user selected format, not always locale format.
2014-06-02 17:13:32 +01:00
Mike Evans 5336a43118 Relax requirements for booleans in invoice line.
Accept 'y' as well as 'yes', 't' as well as true.
2014-06-02 13:15:09 +01:00
John Ralls 8a45ce41bc 722200 - configure script does not pick the correct am_cv_scanf version
Add -Wall -Werror to CFLAGS to try to force failure.
2014-06-01 11:39:31 -07:00
Mike Evans 7c003f23e4 Bug 730255 - Python bindings: Assigns bill entries to non-existant invoice.
Add type checking to ensure entry type matches invoice (or bill) type.
2014-06-01 13:27:07 +01:00
Mike Evans d85725c080 Python bindings. Add function gncVendorNextID, complementary to
gncCustomerNextID.
2014-06-01 11:09:49 +01:00
John Ralls f9548652de 722200 - configure script does not pick the correct am_cv_scanf version
On 64-bit Windows system.

Test for need of and if needed define __USE_MINGW_ANSI_STDIO
2014-05-31 09:23:16 -07:00
Christoph Holtermann ec98be5b90 no instance necessary anymore 2014-05-29 23:44:36 +02:00
John Ralls 1f303f7b81 More fix-ups for the renumber subaccounts dialog.
Add more invariant checks for safety.
Suppress the '-' in the account-number format if the prefix is empty.
Set the value for the interval GtkSpinButton so that it won't be 0 on startup.
Fix the step-increment and page-increment property names in the builder file
so that they have an effect.
2014-05-27 14:19:47 -07:00
John Ralls 7daad042d0 Bug 725054 - Re-numbering sub accounts crashes the program
g_strdup_printf ("%s-%0*d", prefix, num_digits, interval) calls malloc()
with the number of required characters, which includes num_digits characters
for the numeric. If the interval is 0, log10(num_children * interval) is
log10(0), which returns NAN (not a number), which when cast to size_t is
MAXINT. That generates a malloc error, which crashes GnuCash.

So don't let the interval be 0.
2014-05-27 14:19:47 -07:00
John Ralls 75114b7c62 Bug 728717 - Ubuntu 14.04 - GNUcash crashes on close
Root cause is initializing twice with a static dbi_instance. Prevent
that.
2014-05-26 13:41:49 -07:00
Mike Alexander 81fb773856 Merge branch 'maint' 2014-05-25 19:10:03 -04:00
Mike Alexander f8139efad1 Always use the price we display to calculate the current value of an account. 2014-05-25 19:09:32 -04:00
Michalis Kamprianis 985fecb032 Bug 719457 - Template for Home Mortgage Loan isn't properly nested.
Several account templates containted accounts with two parents, resulting to incorrect nesting.

	modified:   accounts/C/acctchrt_homeloan.gnucash-xea
	modified:   accounts/C/acctchrt_otherloan.gnucash-xea
	modified:   accounts/C/acctchrt_retiremt.gnucash-xea
	modified:   accounts/C/acctchrt_spouseretire.gnucash-xea
	modified:   accounts/en_GB/acctchrt_homeloan.gnucash-xea
	modified:   accounts/en_GB/acctchrt_otherloan.gnucash-xea
	modified:   accounts/en_GB/acctchrt_retiremt.gnucash-xea
	modified:   accounts/en_GB/acctchrt_spouseretire.gnucash-xea
2014-05-20 23:22:51 +02:00
Geert Janssens cac3b5c215 Rename xaccAccountGetNrSplits to xaccAccountCountSplits for api consistency 2014-05-20 16:21:09 +02:00
Michalis Kamprianis e76ba2a0f0 Bug 541541 - RFE: auto-hide unused accounts
Add a checkbox on Filter by -> Others to show (default)
or hide accounts that don't have any transactions.
If an account does not have any transactions, but it's children do
it will still be shown (unlike the zero total amount).
2014-05-20 16:21:08 +02:00
Geert Janssens 1a967e46db Merge branch 'maint'
* Bug 610202 - gnucash silently closes when no X11/$DISPLAY is present
* added context to ambigous i18n keys for scheduled transaction add/edit dialog
* Bug 509263 Since Last Run dialog won't allow resizing of Status column
* Bug 728103 - Invoice opened does not contain the Job under circumstances
* Bug 723145 - Currency display does not respect locale
2014-05-20 16:20:16 +02:00
Frédéric Perrin 733e6e91da Bug 723145 - Currency display does not respect locale
Use the system-provided symbol for the locale currency
2014-05-20 16:18:21 +02:00
Michalis Kamprianis 1992e5fb1f Bug 728103 - Invoice opened does not contain the Job under circumstances
corrected the saving of the page, so that it mentions the Job as
the owner if there is a job, instead of the customer or the vendor.

	modified:   src/business/business-gnome/dialog-invoice.c
2014-05-20 12:47:03 +02:00
Michalis Kamprianis e1a5889b45 Bug 509263 Since Last Run dialog won't allow resizing of Status column
Added resizable=true in the column definition

	modified:   src/gnome/dialog-sx-since-last-run.c
2014-05-20 12:30:54 +02:00
Geert Janssens 5af8d2318d Backport John's fix for a truly ancient bug 2014-05-20 10:31:12 +02:00
Geert Janssens c742110c11 Merge branch 'scheduled_tx_i18n_prefix' of https://github.com/zeldigas/gnucash into maint 2014-05-20 10:05:29 +02:00
John Ralls eabaee8eb5 A truly ancient bug, discovered with an Xcode-5.1 compiler warning. 2014-05-19 16:07:26 -07:00
Geert Janssens 3cd2fc5653 Bug 610202 - gnucash silently closes when no X11/$DISPLAY is present 2014-05-19 21:37:10 +02:00