Commit Graph

260 Commits

Author SHA1 Message Date
Joshua Sled
c91cb881bd Overhaul gnc/qof logging: Add default log handler that implements a "log4x"-style log level hierarchy. Correctly use G_LOG_DOMAIN, raw glib logging. Cleanup tests that are too loud afterwards.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15537 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-09 17:35:00 +00:00
Joshua Sled
b39d84252c Remove basically-unused qof date manipulation code better provided by GDate.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15499 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-04 16:50:27 +00:00
Andreas Köhler
c71c7ecd24 Add lib/libc/pow.h to avoid calculation errors on Windows.
If the return value of pow is not saved in a double but rather used for
other calculations or casts, results can be bad, like pow(10, 2) being
99 instead of 100. Wrap pow and store the return value first before
continuing.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15484 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-01 01:08:05 +00:00
Derek Atkins
9160a39948 Make sure we properly add the glib28 sources to EXTRA_DIST
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15450 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-28 14:13:27 +00:00
Andreas Köhler
f0d6aab958 Replace mkstemp and rename by g_mkstemp and g_rename.
Mkstemp is unavailable on Windows and g_rename is preferred. Completes
r15435 on trunk and must not be backported.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15449 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-28 13:40:54 +00:00
David Hampton
0927d97115 Fix glib28 utils on non-win32 system.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15447 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-28 06:19:45 +00:00
Andreas Köhler
5d79c1a22f Add a few functions from GLib 2.8 in lib/glib28.
Remove empty directory lib/glib26. Add lib/glib28 instead with the
necessary sources and headers to have the following functions even on a
GLib 2.6 system (!defined(HAVE_GLIB_2_8))
- g_access, g_chmod,
- g_file_set_contents,
- g_win32_locale_filename_from_utf8.
Make use of them, improving r15429 and r15430.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15445 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-28 05:13:54 +00:00
Derek Atkins
a929bcdf33 /tmp/qof.trace or /tmp/gnucash.trace is opened for writing directly.
This could be a security issue if someone else, say, makes a symlink
to somewhere else.  Instead, create a tempfile and then rename it
into place which is safe against the symlink attack.
Patch by Bill Nottingham <notting@redhat.com>
BP



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15435 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-28 03:16:39 +00:00
Andreas Köhler
5c126dea86 Use g_open, g_fopen, g_stat and g_unlink.
Replace open, fopen, stat and unlink by their GLib wrappers so that
files on Windows will be handled with the wide character api.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15407 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-21 16:38:42 +00:00
Andreas Köhler
6783775210 Use g_dir_{open,read_name,close}.
Replace opendir, readdir and closedir by their GLib wrappers so that
files on Windows will be retrieved with the wide character api.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15403 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-20 18:37:35 +00:00
Andreas Köhler
35f43c0a1a Raise dependencies: GLib 2.6, Pango 1.8, GTK+ 2.6.
Ask for GLib 2.6 and GTK+ 2.6. Let the included GOffice 0.0.4 and LibGSF
1.12.3 use their native base dependencies. Remove all #ifdefs and
compatibility code that were necessary to make GnuCash, GOffice and
LibGSF compile on an older setup (GLib 2.4, Pango 1.6, GTK+ 2.4).


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15400 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-20 15:21:35 +00:00
Andreas Köhler
b34a1c9f3f Unify library names and installation directories.
Rename libcore-utils        to libgnc-core-utils
Rename libgncgnome          to libgnc-gnome
Rename libgncmodule         to libgnc-module
Rename libgncqof            to libgnc-qof
Rename libgnc-backend-file  to libgncmod-backend-file
Move libgnc-business-ledger to $prefix/lib
Move libgncqof-backend-qsf  to $prefix/lib/gnucash
Move libgncmod-backend-file to $prefix/lib/gnucash


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15321 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-07 07:04:23 +00:00
Andreas Köhler
96e1ed071d Call g_module_make_resident in qof backend provider modules.
If the GncModule system finds a QofBackendProvider module M before that
has been initialized by QOF, M will register itself with QOF but does
not mark itself as resident, so the module system will unload it again,
leaving bogus pointers in QOF. Now it does.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15320 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-07 07:04:17 +00:00
Derek Atkins
7a763898d3 Use G_GINT64_MODIFIER for qofmath test.
Fixes the problem Andreas noticed on amd64.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15304 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-03 00:12:19 +00:00
Derek Atkins
d122eddbb6 Fix the printf routines in the qofmath tests.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15303 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-02 18:37:16 +00:00
Derek Atkins
078d3d0cd8 Uncomment the test-qofmath to make it easier to use.
Change it to check_PROGRAMS
use <prog>_CPPFLAGS instead of DEFS -- this works great!


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15302 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-02 18:00:13 +00:00
Christian Stimming
def1a50c61 For convenience, add commented-out build rules for testing the qofmath128 test program
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15301 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-02 17:26:18 +00:00
Christian Stimming
bf3e8f4c1b Make math128 test program compilable again
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15300 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-01-02 17:18:19 +00:00
Christian Stimming
320c1af625 Code cleanup: Move variable declaration into block where it is used.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15209 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-12-12 11:34:42 +00:00
Christian Stimming
a95ff05967 Check for return value of regcomp() and return NULL on failure, as suggested by Jon Arney.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15208 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-12-12 11:33:03 +00:00
Andreas Köhler
47f406a9b7 Fix some printf's of NULL in DEBUG, ENTER and LEAVE macro invocations.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15188 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-12-06 20:03:30 +00:00
Chris Shoemaker
60e5a01dfd Fix bug #353450 - Crash on quit during save.
Add a lock to the QofSession object, and use it in qof_session_save() to 
protect against re-entrance.

The lock always starts at 1 and is 0 while inside qof_session_save().  
If another call is made to qof_session_save() while one is in progress, 
the lock will momentarily drop below 0 before returning to zero.

Note: The per-session nature of the lock would make it appear that we support
concurrent saving of different sessions.  In fact, we do not, because the 
file backend blocks the main process until the forked gzip process is 
finished, and it only knows how to keep track of one child pid at a time. 



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15168 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-12-02 22:13:13 +00:00
Christian Stimming
f60c817a45 Remove unneeded extra Makefile variable
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15150 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-11-27 13:32:32 +00:00
Chris Shoemaker
31e926c486 Merge swig-redo branch back into trunk.
g-wrap is gone.  I, for one, welcome our new swig overlords.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15024 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-10-15 19:02:05 +00:00
Derek Atkins
57cc5debe9 Don't pass a pointer to a pointer. It's just expecting the pointer.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14908 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-27 20:36:56 +00:00
Derek Atkins
21f2f4e93e Missed one patch hunk in r14903.
We need stdlib.h for strtol().


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14904 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-27 13:46:50 +00:00
Derek Atkins
c7c9199800 Add the ability to override the default sort (#150799).
Override the Transaction Number to sort numerically.
	* lib/libqof/qof/qofclass.h:
	* lib/libqof/qof/qofquery.c:
	* lib/libqof/qof/qofquerycore-p.h:
	* lib/libqof/qof/qofquerycore.[ch]:
	  - Publish the QofCompareFunc prototype.
	  - Add a new QofParam param_compfcn parameter
	  - Change QofQuery to use the param_compfcn over the
	    default type compare function.
	  - create (and publish) a qof API to compare strings
	    as numbers:  qof_string_number_compare_func()
	* src/engine/Transaction.c:
	  Assign TRANS_NUM to use qof_string_numer_compare_func()



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14903 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-27 13:39:32 +00:00
Derek Atkins
8bf369217a Revert r14892 in order to try a different approach.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14902 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-27 13:30:05 +00:00
Derek Atkins
f82c369b0e Implement SubQuery functionality in QOF: qof_query_run_subquery()
Now you can run one query off of the results of another query.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14901 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-26 23:47:09 +00:00
Derek Atkins
2bb357def4 Add a new QOF_TYPE_NUMSTRING to add numeric sorts. (#150799).
This new type is like QOF_TYPE_STRING but it sorts numerically
	  (first) and then sorts alphanumerically (by the tail of the
	  number).  Added the QOF Type, the gnome-search support, and
	  modified TRANS_NUM to use the new type.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14892 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-26 00:36:30 +00:00
Christian Stimming
0415051267 On Windows/mingw32, scanf only accepts %I64d for long long integers.
Reference that gave me this hint: http://acm.pku.edu.cn/JudgeOnline/faq.htm

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14806 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-06 11:46:36 +00:00
Christian Stimming
03cf6d7d01 Fix missing include config.h. Also fix still-used deprecated typedef.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14799 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-05 17:31:13 +00:00
Christian Stimming
042ec5de5e Error out if none of the two SCANF formats are defined in config.h.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14798 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-05 15:50:29 +00:00
Christian Stimming
9495945584 For windows, clean up error conditions before trying again to load the session.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14796 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-05 13:38:41 +00:00
Christian Stimming
3675e7470e If the file type wasn't recognized, check whether this failed because
of no read permission and give appropriate user feedback if yes.
Feel free to adjust the wording.
BP



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14791 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-03 20:14:07 +00:00
Christian Stimming
455f96a355 Fix typo
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14786 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-02 19:19:45 +00:00
Christian Stimming
6e568f1d91 For windows, fall back to the file backend if a colon was in the URL name.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14785 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-09-02 19:18:27 +00:00
Derek Atkins
e16fdddd01 and one more file needs strptime.h.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14751 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-28 16:31:35 +00:00
Derek Atkins
27f50aa954 need to include strptime.h so we get the declaration.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14750 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-28 16:20:12 +00:00
Derek Atkins
352d39d412 libqof/backend/file needs lib/libc for the missing libc functions.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14749 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-28 16:05:56 +00:00
Christian Stimming
1fa413f54d First round of Makefile symlink cleanup.
Scheme files are now symlinked or copied into subdirectories gnucash/ and g-wrapped/. This will work on a platform without symlinks just fine.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14746 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-28 14:51:25 +00:00
Christian Stimming
44ddca68cd Add REGEX_LIBS linker flag that is needed on win32 platform
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14743 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-28 09:31:29 +00:00
Christian Stimming
2648783526 Replace : as sed's replacement command delimiter by # because on Windows, fully qualified filenames might contain the colon.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14711 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-22 19:41:18 +00:00
David Hampton
e0244824a0 Add some 'const' declarations.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14690 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-18 04:48:18 +00:00
Christian Stimming
337bb207d4 Move #include "qofla-dir.h" into qofsession.c because this is the only place where it is used.
Removes an often regenerated dependency from qof.h.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14688 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-08-17 10:43:19 +00:00
Derek Atkins
3ad22b5eb5 Allow proper compile/install from tarball using separate builddir.
- Don't distribute (most) generated files.
  - Be (more) consistent about when generated files are cleaned.
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14555 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-07-25 13:25:26 +00:00
Chris Shoemaker
f0d64c1185 Avoid SIGFPE due to modulo-by-zero is the requested number of significant
figures is greater than log10(2^63).
BP


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14512 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-07-15 19:47:02 +00:00
Andreas Köhler
4762dbf429 String fixes that have been delayed due to the string freeze.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14493 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-07-13 22:58:55 +00:00
Derek Atkins
3366829dc2 Move the GLIB26 compatibility checks to configure.in.
Just modify GLIB_LIBS and GLIB_CFLAGS so everyone properly
	  links against the glib26 compatibility library when necessary.



git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14330 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-06-05 03:39:54 +00:00
Chris Shoemaker
564958f000 Add -avoid-version to LDFLAGS of gmodule backends.
Hopefully this will solve the problem Macs are having dlopen'ing them.


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@14210 57a11ea4-9604-0410-9ed3-97b8803252fd
2006-05-27 14:19:48 +00:00