[GNC] gncJobNextID in gncJob.c not in gncJob.h

john jralls at ceridwen.us
Mon Aug 8 13:44:08 EDT 2022


The intended end-user process is to use the program, not the bindings.

As to why the job-creating functions don't increment the counters, I think because the design allows the user to override the counter-based ids in the GUI. Derek wrote the code so he's the authority on the why's and wherefores.

As a general statement GnuCash is not designed as a library around which you can implement your own program. Consequently it's a huge steaming pile of spaghetti with a lot of functionality implemented in the wrong places and many parts lack a carefully thought-out API. We're working on fixing that but we don't have a lot of resources so it's going to take a long time. We decided on the overall framework almost 10 years ago and haven't gotten very far.

Regards,
John Ralls


> On Aug 8, 2022, at 5:45 AM, Robert Simmons <rsimmons0 at gmail.com> wrote:
> 
> If these functions are not public, why don't the proper functions for
> creating Jobs and other objects increment the counters?
> 
> If I'm understanding correctly, Python bindings provide no way to increment
> counters (since exposing some of those incrementX functions were mistakenly
> not in the private headers)? After running code based on Python bindings,
> the user is expected to manually increment the counters in the UI?
> 
> I just want to establish what the intended end user process is supposed to
> be.
> 
> On Sun, Aug 7, 2022 at 10:56 PM john <jralls at ceridwen.us> wrote:
> 
>> All of the incrementFooID functions are declared in the respective private
>> headers, so that functionality is not intended to be public API. The why is
>> lost to history, those functions were created in a drive-by contribution.
>> 
>> Your workaround of writing directly to the database is ill-advised unless
>> your script is going to create jobs and immediately exit. The engine loads
>> the database into memory once at the beginning of the session and doesn't
>> read it again, so any changes you make direct to the database like that are
>> invisible to the current session.
>> 
>> Regards,
>> John Ralls
>> 
>> 
>>> On Aug 7, 2022, at 1:14 PM, Robert Simmons <rsimmons0 at gmail.com> wrote:
>>> 
>>> Little error there. I improved the query while writing: "This sets the
>> Job
>>> ID counter to 3, but you would change that 3 to whatever the ID you
>> want."
>>> should be "This increments the Job ID to the next"
>>> _______________________________________________
>>> gnucash-user mailing list
>>> gnucash-user at gnucash.org
>>> To update your subscription preferences or to unsubscribe:
>>> https://lists.gnucash.org/mailman/listinfo/gnucash-user
>>> -----
>>> Please remember to CC this list on all your replies.
>>> You can do this by using Reply-To-List or Reply-All.
>> 
>> 
> _______________________________________________
> gnucash-user mailing list
> gnucash-user at gnucash.org
> To update your subscription preferences or to unsubscribe:
> https://lists.gnucash.org/mailman/listinfo/gnucash-user
> -----
> Please remember to CC this list on all your replies.
> You can do this by using Reply-To-List or Reply-All.



More information about the gnucash-user mailing list