QSF Import of gncCustomer and gncAddress Issues (and partial success)

Derek Atkins warlord at MIT.EDU
Tue May 30 14:21:55 EDT 2006


Please CC gnucash-devel on all replies!!!

Quoting Georgi Mirchev <manager at mirchevideas.com>:

> Well, if the QSF doesn't "set" an address, then it should set the 
> address properties instead. But that would mean adding a lot of 
> additional params together with their setters/getters to gncCustomer, 
> gncVendor and gncEmployee.

Not necessarily.

> To me "setting" address seems right. Why do you think this "setting" 
> isn't right?

Why does the "set address" API have to replace the "address" object in the
customer/vendor/employee?  Why not have the qof setter copy the address
values into the actual object?

E.g.:

  qofFooSetXAddress(QofInstance* inst, GncAddress* addr)
  {
     ...
     gncAddressSet(object->addr, addr);
     qof_instance_destroy(addr);
     ...
   }

  gncAddressSet(GncAddress* dest, const GncAddress* src)
  {
      // copy src values to dest
      CACHE_REPLACE(dest->name, src->name);
      ...
   }

> Since a gncAddress can only live in one book, it seems right for it 
> to deregister itself from the book in it's destructor.

I didn't disagree with that.  The QOFization of gncAddress clearly wasn't
fully pondered before it was half-implemented.  Unfortunately you got
caught in the quagmire.

-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



More information about the gnucash-devel mailing list