[Gnucash-changes] r14198 - gnucash/trunk - Merge 'misc-backend' -r 14160:14184 into trunk.

Chris Shoemaker c.shoemaker at cox.net
Fri May 26 17:17:55 EDT 2006


On Fri, May 26, 2006 at 11:29:22AM -0400, Derek Atkins wrote:
> Chris,
> 
> Chris Shoemaker <chris at cvs.gnucash.org> writes:
> 
> >  gnc_engine_init(int argc, char ** argv)
> >  {
> > +  static gchar *names[] = {
> > +      GNC_LIB_NAME, QSF_BACKEND_LIB, "gnc-backend-postgres", 
> > +      NULL};
> > +  gchar **np;
> [snip]
> > @@ -96,12 +98,11 @@
> >    /* Now register our core types */
> >    cashobjects_register();
> >  
> > -  g_return_if_fail((qof_load_backend_library 
> > -		(QOF_LIB_DIR, QSF_BACKEND_LIB, QSF_MODULE_INIT)));
> > -  g_return_if_fail((qof_load_backend_library
> > -		(GNC_LIBDIR, GNC_LIB_NAME, GNC_LIB_INIT)));
> > +  for (np = names; *np; np++) {
> > +      if (qof_load_backend_library(GNC_LIBDIR, *np))
> > +          engine_is_initialized = 1;
> > +  }
> 
> This is going to be problematic.  You're now trying to load the QSF
> Backend out of GNC_LIBDIR, which is NOT necessarily where it lives!
> It lives in QOF_LIB_DIR != GNC_LIB_DIR.

I'm pretty sure that for all working configs, these are identical.
They are both libdir.

Not that it matters that much, since the only difference between
loading qsf and not is the extra schema failure error messages that
qsf throws, but...

If you really want to change this, the _real_ problem, IMO, is that
qsf has an identity-crisis.  If it's a qof module, then it should live
in QOF's libdir and be loaded by qof, not gnucash.  If it's a gnucash
backend/module, it should live in gnucash's libdir and be loaded by
gnucash.  Gnucash should have has no business poking around in qof's
libdir.

> I'll go ahead and fix this by changing the list of names into a list
> of structures where we can define the library name and the directory..

I'm pretty sure that can't make any difference, and in the long term,
we probably shouldn't be keeping a list of libdirs.

-chris

> 
> -derek
> 
> -- 
>        Derek Atkins, SB '93 MIT EE, SM '95 MIT Media Laboratory
>        Member, MIT Student Information Processing Board  (SIPB)
>        URL: http://web.mit.edu/warlord/    PP-ASEL-IA     N1NWH
>        warlord at MIT.EDU                        PGP key available
> _______________________________________________
> gnucash-devel mailing list
> gnucash-devel at gnucash.org
> https://lists.gnucash.org/mailman/listinfo/gnucash-devel


More information about the gnucash-devel mailing list