mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Remove separate object initialization in engine/gncBusiness.c and move this into one common initialization function cashobjects_register in <engine/cashobjects.h>.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19360 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
f8007880fd
commit
4bd4d41c05
@ -67,7 +67,7 @@ libgncmod_business_core_gnc_module_init(int refcount)
|
|||||||
|
|
||||||
if (refcount == 0)
|
if (refcount == 0)
|
||||||
{
|
{
|
||||||
gnc_module_init_business_core_init();
|
/* Object initialization already finished in the engine. */
|
||||||
}
|
}
|
||||||
|
|
||||||
scm_init_sw_business_core_module();
|
scm_init_sw_business_core_module();
|
||||||
|
@ -160,7 +160,6 @@ int main (int argc, char ** argv)
|
|||||||
|
|
||||||
qof_init();
|
qof_init();
|
||||||
cashobjects_register();
|
cashobjects_register();
|
||||||
gnc_module_init_business_core_init();
|
|
||||||
qof_load_backend_library ("../../../../backend/dbi/.libs/", GNC_LIB_NAME);
|
qof_load_backend_library ("../../../../backend/dbi/.libs/", GNC_LIB_NAME);
|
||||||
init_business_sql();
|
init_business_sql();
|
||||||
|
|
||||||
|
@ -138,7 +138,6 @@ SET (libgncmod_engine_SOURCES
|
|||||||
gncAddress.c
|
gncAddress.c
|
||||||
gncBillTerm.c
|
gncBillTerm.c
|
||||||
gncBusGuile.c
|
gncBusGuile.c
|
||||||
gncBusiness.c
|
|
||||||
gncCustomer.c
|
gncCustomer.c
|
||||||
gncEmployee.c
|
gncEmployee.c
|
||||||
gncEntry.c
|
gncEntry.c
|
||||||
|
@ -47,7 +47,6 @@ libgncmod_engine_la_SOURCES = \
|
|||||||
gncBusGuile.c \
|
gncBusGuile.c \
|
||||||
gncAddress.c \
|
gncAddress.c \
|
||||||
gncBillTerm.c \
|
gncBillTerm.c \
|
||||||
gncBusiness.c \
|
|
||||||
gncCustomer.c \
|
gncCustomer.c \
|
||||||
gncEmployee.c \
|
gncEmployee.c \
|
||||||
gncEntry.c \
|
gncEntry.c \
|
||||||
|
@ -2,8 +2,11 @@
|
|||||||
* cashobjects.c
|
* cashobjects.c
|
||||||
*
|
*
|
||||||
* Mon Aug 22 09:49:52 2005
|
* Mon Aug 22 09:49:52 2005
|
||||||
* Copyright 2005 Neil Williams
|
* Copyright 2005 Neil Williams linux@codehelp.co.uk
|
||||||
* linux@codehelp.co.uk
|
*
|
||||||
|
* Copyright (C) 2002 Derek Atkins
|
||||||
|
* Copyright (C) 2010 Christian Stimming
|
||||||
|
*
|
||||||
****************************************************************************/
|
****************************************************************************/
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -34,6 +37,35 @@
|
|||||||
#include "gnc-lot-p.h"
|
#include "gnc-lot-p.h"
|
||||||
#include "gnc-budget.h"
|
#include "gnc-budget.h"
|
||||||
|
|
||||||
|
#include "gncAddressP.h"
|
||||||
|
#include "gncBillTermP.h"
|
||||||
|
#include "gncCustomerP.h"
|
||||||
|
#include "gncEmployeeP.h"
|
||||||
|
#include "gncEntryP.h"
|
||||||
|
#include "gncInvoiceP.h"
|
||||||
|
#include "gncJobP.h"
|
||||||
|
#include "gncOrderP.h"
|
||||||
|
#include "gncOwnerP.h"
|
||||||
|
#include "gncTaxTableP.h"
|
||||||
|
#include "gncVendorP.h"
|
||||||
|
|
||||||
|
static void
|
||||||
|
business_core_init(void)
|
||||||
|
{
|
||||||
|
/* initialize known types */
|
||||||
|
gncInvoiceRegister ();
|
||||||
|
gncJobRegister ();
|
||||||
|
gncBillTermRegister ();
|
||||||
|
gncCustomerRegister ();
|
||||||
|
gncAddressRegister ();
|
||||||
|
gncEmployeeRegister ();
|
||||||
|
gncEntryRegister ();
|
||||||
|
gncOrderRegister ();
|
||||||
|
gncOwnerRegister ();
|
||||||
|
gncTaxTableRegister ();
|
||||||
|
gncVendorRegister ();
|
||||||
|
}
|
||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
cashobjects_register(void)
|
cashobjects_register(void)
|
||||||
{
|
{
|
||||||
@ -46,6 +78,10 @@ cashobjects_register(void)
|
|||||||
g_return_val_if_fail(gnc_pricedb_register(), FALSE);
|
g_return_val_if_fail(gnc_pricedb_register(), FALSE);
|
||||||
g_return_val_if_fail (gnc_budget_register(), FALSE);
|
g_return_val_if_fail (gnc_budget_register(), FALSE);
|
||||||
g_return_val_if_fail ( gnc_lot_register (), FALSE);
|
g_return_val_if_fail ( gnc_lot_register (), FALSE);
|
||||||
|
|
||||||
|
/* And the business objects */
|
||||||
|
business_core_init();
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1,57 +0,0 @@
|
|||||||
/*
|
|
||||||
* gncBusiness.c -- Business helper functions
|
|
||||||
* Copyright (C) 2002 Derek Atkins
|
|
||||||
* Author: Derek Atkins <warlord@MIT.EDU>
|
|
||||||
*
|
|
||||||
* This program is free software; you can redistribute it and/or
|
|
||||||
* modify it under the terms of the GNU General Public License as
|
|
||||||
* published by the Free Software Foundation; either version 2 of
|
|
||||||
* the License, or (at your option) any later version.
|
|
||||||
*
|
|
||||||
* This program is distributed in the hope that it will be useful,
|
|
||||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
* GNU General Public License for more details.
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License
|
|
||||||
* along with this program; if not, contact:
|
|
||||||
*
|
|
||||||
* Free Software Foundation Voice: +1-617-542-5942
|
|
||||||
* 51 Franklin Street, Fifth Floor Fax: +1-617-542-2652
|
|
||||||
* Boston, MA 02110-1301, USA gnu@gnu.org
|
|
||||||
*/
|
|
||||||
|
|
||||||
#include "config.h"
|
|
||||||
|
|
||||||
#include "gncBusiness.h"
|
|
||||||
|
|
||||||
#include <glib.h>
|
|
||||||
|
|
||||||
#include "gncAddressP.h"
|
|
||||||
#include "gncBillTermP.h"
|
|
||||||
#include "gncCustomerP.h"
|
|
||||||
#include "gncEmployeeP.h"
|
|
||||||
#include "gncEntryP.h"
|
|
||||||
#include "gncInvoiceP.h"
|
|
||||||
#include "gncJobP.h"
|
|
||||||
#include "gncOrderP.h"
|
|
||||||
#include "gncOwnerP.h"
|
|
||||||
#include "gncTaxTableP.h"
|
|
||||||
#include "gncVendorP.h"
|
|
||||||
|
|
||||||
void
|
|
||||||
gnc_module_init_business_core_init(void)
|
|
||||||
{
|
|
||||||
/* initialize known types */
|
|
||||||
gncInvoiceRegister ();
|
|
||||||
gncJobRegister ();
|
|
||||||
gncBillTermRegister ();
|
|
||||||
gncCustomerRegister ();
|
|
||||||
gncAddressRegister ();
|
|
||||||
gncEmployeeRegister ();
|
|
||||||
gncEntryRegister ();
|
|
||||||
gncOrderRegister ();
|
|
||||||
gncOwnerRegister ();
|
|
||||||
gncTaxTableRegister ();
|
|
||||||
gncVendorRegister ();
|
|
||||||
}
|
|
@ -47,8 +47,8 @@
|
|||||||
#define GNC_TAXTABLE_MODULE_NAME GNC_ID_TAXTABLE
|
#define GNC_TAXTABLE_MODULE_NAME GNC_ID_TAXTABLE
|
||||||
#define GNC_VENDOR_MODULE_NAME GNC_ID_VENDOR
|
#define GNC_VENDOR_MODULE_NAME GNC_ID_VENDOR
|
||||||
|
|
||||||
void
|
/* The initialization of the business objects is done in
|
||||||
gnc_module_init_business_core_init(void);
|
* cashobjects_register() of <engine/cashobjects.h>. */
|
||||||
|
|
||||||
#ifndef DI
|
#ifndef DI
|
||||||
# ifdef _MSC_VER
|
# ifdef _MSC_VER
|
||||||
|
@ -48,7 +48,6 @@ extern "C"
|
|||||||
#include "swig-runtime.h"
|
#include "swig-runtime.h"
|
||||||
|
|
||||||
#include "backend/xml/gnc-backend-xml.h"
|
#include "backend/xml/gnc-backend-xml.h"
|
||||||
#include "engine/gncBusiness.h"
|
|
||||||
#include "business/business-core/xml/gncmod-business-backend-xml.h"
|
#include "business/business-core/xml/gncmod-business-backend-xml.h"
|
||||||
#ifdef WITH_SQL
|
#ifdef WITH_SQL
|
||||||
# include "backend/dbi/gnc-backend-dbi.h"
|
# include "backend/dbi/gnc-backend-dbi.h"
|
||||||
@ -180,7 +179,6 @@ main(int argc, char ** argv)
|
|||||||
#ifdef WITH_SQL
|
#ifdef WITH_SQL
|
||||||
gnc_module_init_backend_dbi();
|
gnc_module_init_backend_dbi();
|
||||||
#endif
|
#endif
|
||||||
gnc_module_init_business_core_init();
|
|
||||||
gnc_module_init_business_core_xml_init();
|
gnc_module_init_business_core_xml_init();
|
||||||
gnc_ui_util_init();
|
gnc_ui_util_init();
|
||||||
gnc_exp_parser_init();
|
gnc_exp_parser_init();
|
||||||
|
@ -187,7 +187,6 @@ gnc_engine_init_static(0, no_args);
|
|||||||
|
|
||||||
gnc_module_init_backend_xml();
|
gnc_module_init_backend_xml();
|
||||||
gnc_module_init_backend_dbi();
|
gnc_module_init_backend_dbi();
|
||||||
gnc_module_init_business_core_init();
|
|
||||||
gnc_module_init_business_core_xml_init();
|
gnc_module_init_business_core_xml_init();
|
||||||
gnc_module_init_business_core_sql_init();
|
gnc_module_init_business_core_sql_init();
|
||||||
%}
|
%}
|
||||||
|
Loading…
Reference in New Issue
Block a user