[Gnucash-changes] r12881 - gnucash/trunk/src/app-utils - move some
app-util function hooks from guile to C
Chris Shoemaker
chris at cvs.gnucash.org
Thu Jan 19 00:18:28 EST 2006
Author: chris
Date: 2006-01-19 00:18:27 -0500 (Thu, 19 Jan 2006)
New Revision: 12881
Trac: http://svn.gnucash.org/trac/changeset/12881
Modified:
gnucash/trunk/src/app-utils/app-utils.scm
gnucash/trunk/src/app-utils/gncmod-app-utils.c
Log:
move some app-util function hooks from guile to C
Modified: gnucash/trunk/src/app-utils/app-utils.scm
===================================================================
--- gnucash/trunk/src/app-utils/app-utils.scm 2006-01-19 04:54:37 UTC (rev 12880)
+++ gnucash/trunk/src/app-utils/app-utils.scm 2006-01-19 05:18:27 UTC (rev 12881)
@@ -266,21 +266,3 @@
(load-from-path "date-utilities.scm")
(load-from-path "simple-obj.scm")
-
-
-(gnc:hook-add-dangler gnc:*startup-hook*
- (lambda ()
- (begin
- ;; Initialize the expression parser.
- ;; Must come after the C side options initialization.
- (gnc:exp-parser-init))))
-
-;; add a hook to shut down the expression parser
-(gnc:hook-add-dangler gnc:*shutdown-hook*
- (lambda ()
- (begin
- ;; Shutdown the expression parser
- (gnc:exp-parser-shutdown)
-
- ;; This saves options. E.G. Stylesheets.
- (gnc:hook-run-danglers gnc:*save-options-hook*))))
Modified: gnucash/trunk/src/app-utils/gncmod-app-utils.c
===================================================================
--- gnucash/trunk/src/app-utils/gncmod-app-utils.c 2006-01-19 04:54:37 UTC (rev 12880)
+++ gnucash/trunk/src/app-utils/gncmod-app-utils.c 2006-01-19 05:18:27 UTC (rev 12881)
@@ -14,6 +14,8 @@
#include "gnc-module-api.h"
#include "gnc-component-manager.h"
+#include "gnc-hooks.h"
+#include "gnc-exp-parser.h"
/* version of the gnc module system interface we require */
int libgncmod_app_utils_LTX_gnc_module_system_interface = 0;
@@ -48,6 +50,13 @@
g_free(form);
}
+static void
+app_utils_shutdown(void)
+{
+ gnc_exp_parser_shutdown();
+ gnc_hook_run(HOOK_SAVE_OPTIONS, NULL);
+}
+
int
libgncmod_app_utils_LTX_gnc_module_init(int refcount)
{
@@ -66,6 +75,9 @@
lmod("(g-wrapped gw-app-utils)");
lmod("(gnucash app-utils)");
+ gnc_hook_add_dangler(HOOK_STARTUP, (GFunc)gnc_exp_parser_init, NULL);
+ gnc_hook_add_dangler(HOOK_SHUTDOWN, (GFunc)app_utils_shutdown, NULL);
+
if (refcount == 0)
gnc_component_manager_init ();
More information about the gnucash-changes
mailing list