Commit Graph

220 Commits

Author SHA1 Message Date
Andreas Köhler
cb5b3ab59c Bug #539947: Replace __FUNCTION__ by G_STRFUNC.
Patch from Halton Huo.
BP

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17585 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-09-21 15:18:50 +00:00
Charles Day
ad6df218a0 gnc_numeric: Support reciprocals (negative denominators) in gnc_numeric_to_decimal().
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17554 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-09-18 08:33:27 +00:00
Andreas Köhler
44a07ec81c Optimize gnc_numeric_check() by G_LIKELY-fying that the denominator is non-zero.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17534 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-09-16 23:00:01 +00:00
Charles Day
eb29fc8e6d Make gnc_numeric values of zero always convertible to decimal form.
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17456 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-08-07 18:18:00 +00:00
Phil Longstaff
9173035d57 Merge gda-dev2 branch into trunk.
This introduces the dbi backend and the --enable-dbi configure option.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17444 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-08-01 16:02:07 +00:00
Charles Day
399a1eb989 Add a new function to the gnc_numeric library that converts denominators to exact powers of ten.
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17421 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-07-27 15:33:23 +00:00
Derek Atkins
ef25c17cd4 Get GnuCash building again.
- move the #include of g18n.h from gnc-date.h to gnc-date.c
- add gnc-date.c to POTFILES.in

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17250 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-06-24 23:28:31 +00:00
Charles Day
fe554f7fd9 Bug #532405: Make the default strftime format use %#d instead of %e on win32 platforms.
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17249 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-06-24 22:28:40 +00:00
Charles Day
669470ad48 Bug #539829: Make sure msg gets assigned before it can get dereferenced.
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17248 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-06-24 22:08:12 +00:00
Phil Longstaff
3370604c8d Fix memory leak in qof_session_save() - "msg" is never freed.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17228 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-06-13 00:21:35 +00:00
Derek Atkins
8d532f650c Match NULL and guid_null() for NULL GUID Matches
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17160 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-05-17 17:46:40 +00:00
Andreas Köhler
733d0dfe70 Fix two memory leaks in QOF. Add qof_backend_destroy().
Backends should call this function to make sure they free the kvp frame
for the backend configuration.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17058 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-03-29 01:20:01 +00:00
Andreas Köhler
7d5e0985f4 A few doxygen fixes.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17041 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-03-23 00:01:05 +00:00
Andreas Köhler
a53fecde93 Pass better size parameter to qof_strftime() to make use of whole buffer.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17005 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-03-04 00:20:07 +00:00
Andreas Köhler
2cbd6ccdd6 Improve performance of qof_query_invert().
Prepend terms and reverse once at the end instead of "reverse, prepend,
reverse" for each term.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@17001 57a11ea4-9604-0410-9ed3-97b8803252fd
2008-03-02 22:12:00 +00:00
Andreas Köhler
5d303b9c2d #506074: Handle fractional timezone offsets correctly in gnc_timespec_to_iso8601_buff().
Patch from Daniel Harding
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16776 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-31 13:52:24 +00:00
Phil Longstaff
0ed4af2ef1 Make some parameters const
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16764 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-29 19:40:28 +00:00
Andreas Köhler
9c1785f933 Fix two memory leaks.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16756 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-12-28 21:44:25 +00:00
Andreas Köhler
15039eaaa9 Remove deprecated qof wrappers.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16579 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-11-03 01:56:28 +00:00
Andreas Köhler
fcfb7bdb95 #438360: Replace str{,n}casestr and strcasecmp by qof_utf8_{substr_nocase,strcasecmp}.
The functions used did not work for non-ascii characters.  The new
implementations use g_utf8_casefold and g_utf8_normalize to improve case
insensitive searches and comparisons.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16547 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-10-03 01:18:13 +00:00
Joshua Sled
86f3842984 Move g_strdup inside of set_log_level to be a slightly better citizen and fix a serious bug. :/
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16402 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-08-08 04:19:22 +00:00
Joshua Sled
f5923ae956 Remove FreqSpec.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16387 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-08-05 21:24:16 +00:00
Joshua Sled
1a9a4fb4de Bug#361604: patch from Mike Alexander <mta umich edu> to fix datatype for gnc-date.h to allow ranging negative, which is important in a few places.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16370 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-07-29 16:00:06 +00:00
Christian Stimming
ea0d0c6274 Add warning when overwriting an already installed dirty-callback.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16228 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-30 11:38:33 +00:00
Andreas Köhler
dcfda18f7c Revert some qof_instance_get_guid() calls to qof_entity_get_guid().
Those two functions were merged into one, qof_instance_get_guid(), in
r15773, but they returned different values if the parameter was NULL.
Some code depends on the return value being guid_null(), or maybe even
NULL, so revert the changes entity->instance, where the entity is not
guaranteed to be non-NULL.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16212 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-25 17:18:28 +00:00
Andreas Köhler
fa28f0e4f0 Avoid a global static variable by using g_list_sort_with_data.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16211 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-25 17:18:11 +00:00
Andreas Köhler
4251bd7f84 Return NULL on qof_instance_get_guid(NULL) again, #448853.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16201 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-22 17:42:52 +00:00
Andreas Köhler
dfde8ebcb7 Do not register qof backend modules on first load, #433779.
Qof backend modules used to call qof_backend_register_provider() and
g_module_make_resident() directly in g_module_check_init(), i.e. they
could not be unloaded after the gnucash module crawler detected them.
Probably after the renaming of libgnc-backend-file the QSF backend
module started to register itself before the gnc file backend, spitting
a validation error on virtually every data file load.

So g_module_check_init() has been renamed to qof_backend_module_init()
and is now called by qof_load_backend_library().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16200 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-22 13:31:29 +00:00
Andreas Köhler
0bca303440 Correct use of xmlNodeGetContent in qsf backend module.
Its return value is a char pointer, not a char.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16199 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-22 13:31:23 +00:00
Andreas Köhler
c892d648b9 Do not call setlocale &friends from within the file backend library.
The only valid call would be to bindtextdomain, but the library does not
use a different locale directory anyway.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16198 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-22 13:31:18 +00:00
Andreas Köhler
8c5d2fe40b Avoid stripping the win drive letter on qsf export. Fixes #448900.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16184 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-18 21:08:30 +00:00
Andreas Köhler
c24fca6d1e Check for QOF_LIB_DIR environment variable and try to load qof backends from there first.
This is a minimally invasive way to make qof backends relocatable and
needed for the Windows port.  Avoiding qofla-dir.h completely is
probably desirable anyway.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16141 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-06-01 22:44:33 +00:00
Derek Atkins
b378cd8898 Fix space->tab issue in a Makefile (need tabs, not spaces)
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16113 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-20 20:56:19 +00:00
Andreas Köhler
1413a11989 Add some delimiters for parsing CJK dates, #437898.
On Windows, the short date formats are used, containing standard
delimiters.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16081 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-13 15:02:40 +00:00
Andreas Köhler
c402307aba Further improve date parsing on Windows. Revert parts of r16049 on Unix.
The recursive parsing of %x by strptime seems to work only for complete
strings, e.g. 4.6. in de_DE or 4/6 in en_UK will not be parsed
correctly.  Therefore, readd LANGINFO_D_FMT_CHECK and use
qof_win32_get_time_format(QOF_WIN32_PICTURE_{DATE,TIME,DATETIME} on
Windows for printing and scanning.  Make get_win32_locale_string and
translate_win32_picture accessible by QOF.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16073 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-12 16:50:49 +00:00
Christian Stimming
439ad78323 Fix memory leak where a free was forgotten
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16058 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-06 21:47:16 +00:00
David Hampton
5990e0be74 Fix several problems with the QOF book merge code. Use unique error
codes in the qof_book_merge_commit() function.  Fixes 343730.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16055 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-06 00:27:43 +00:00
Andreas Köhler
9f44e3155d Do not use langinfo to determine date format spec, but %x, %X or %c.
Remove check for HAVE_LANGINFO_D_FMT.  Rather use standard strftime and
(standard?) strptime format specifiers %x (date), %X (time) and %c
(date&time, all in national representation).


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16049 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-05 21:02:56 +00:00
David Hampton
9ec864163d Collapse the various "idata" fields into a single field attached to
the QofInstance object.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16042 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-03 03:56:31 +00:00
David Hampton
cad2164810 Collapse the various "version" and "version_check" fields into a
single pair of fields attached to the QofInstance object.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16041 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-03 02:56:56 +00:00
David Hampton
62dce55fb8 Fix a problem copying a guid from an object to a local variable.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16040 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-03 02:56:15 +00:00
David Hampton
285a5216b3 Move QofInstance guid property from its public data structure to its
private data structure.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16039 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-02 05:42:41 +00:00
David Hampton
4f6fd1b090 Move QofInstance book properties from its public data structure to its
private data structure.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16038 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-02 03:18:46 +00:00
David Hampton
7d3c6b9a38 More a large number of the QofInstance properties from the public data
structure to a private data structure, with access to them as properties
of the object.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16037 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-05-02 01:57:49 +00:00
David Hampton
fd26e126ec Remove the macro versions of qof_begin_edit and qof_commit_edit_part<x>.
The function call versions of these routines should be used instead.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16033 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-30 17:06:48 +00:00
David Hampton
ce65024722 Start putting an API in place for access to the members of the
QofInstance object.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16025 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-30 05:33:33 +00:00
David Hampton
80a0403ebb Collapse two functions into their only caller. Move a third function
to the same file.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@16003 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-28 02:40:54 +00:00
David Hampton
2b16fa1f41 Use GNC_TYPE_NUMERIC instead of GNC_NUMERIC.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15967 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-21 20:07:23 +00:00
David Hampton
c6a609b8f7 Move more account properties from the public data structure to a
private data structure, with access to them as properties of the
object.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15921 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-18 04:50:34 +00:00
Andreas Köhler
70af105a88 Add qof-gobject.h to qofinclude_HEADERS.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15890 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-14 22:30:11 +00:00