Commit Graph

143 Commits

Author SHA1 Message Date
Derek Atkins
12461c5b30 * Merge QofEntity into QofInstance
- QofEntity -> QofInstance
  - qof_entity -> qof_instance
  - QOF_ENTITY -> QOF_INSTANCE
* remove references to instance.entity
* keep qof_entity_init() and qof_entity_release() for now


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/gobject-engine-dev-warlord@15773 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-01 22:18:50 +00:00
Derek Atkins
4e43ae10f3 Preparation for QofEntity -> QofInstance:
- Convert (QofEntity*)x to QOF_ENTITY(x)
- Move qof_entity_init() and friends into qof_instance and rename
- Move QofEntity contents into QofInstance
(note:  this doesn't compile)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/gobject-engine-dev-warlord@15772 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-04-01 22:18:30 +00:00
Joshua Sled
09d90de350 Unused identifier cleanup.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15718 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-03-15 00:56:52 +00:00
David Hampton
5246632fb4 ISO 8601 requires a four digit year.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15708 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-03-13 01:18:42 +00:00
David Hampton
6fbada92ec Remove all traces of the AccountGroup data structure. Accounts now
point directly to their parent and have a simple GList of children.
(The old method was alternating data structures in the form Account,
AccountGroup, Account, AccountGroup, etc.)


git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15647 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-23 01:23:31 +00:00
Joshua Sled
016afcf3da More doc updates.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15579 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-14 01:34:02 +00:00
Joshua Sled
41e5b3540f Update qoflog documentation.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15576 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-14 00:59:40 +00:00
Joshua Sled
5cc69350f4 Better handling of NULL filename.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15556 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-10 20:05:56 +00:00
Joshua Sled
ff3405f4c8 Fix parsing of log config file without [output] sections.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15553 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-10 18:52:39 +00:00
Joshua Sled
1e1077078f use correct datatype.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15552 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-10 16:28:24 +00:00
Joshua Sled
8ebec0de11 Support for ~/.gnucash/log.conf, a key-value file of logging settings; see comment-doc for qof_log_parse_log_config(...) for the file format.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15545 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-10 01:29:29 +00:00
Joshua Sled
f9863e3ba9 Add G_LOG_DOMAIN for qof.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15544 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-10 01:28:10 +00:00
Joshua Sled
d372dbb81a Restore enter/leave indentation. Cleanup some deprecated and (nearly-)unused qoflog code. Audit fraction enter/leave pairs. :/
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15539 57a11ea4-9604-0410-9ed3-97b8803252fd
2007-02-09 21:52:09 +00:00
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
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
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
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
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