Register-rewrite update

Jeff Green jmgreen7 at gmail.com
Wed Jul 18 01:06:57 EDT 2007


I have been focusing on the crashes that were caused by adding
autocompletion, since I realized that I couldn't adequately test any other
functionality if I could only add one new transaction without crashing the
program or closing and reopening the account. I spent some quality time with
gdb and narrowed down the crashes to being caused by setting up the
autocompletion using the real model associated with the transaction register
treeview. So I tried making a copy of the data for the column that needs
autocompletion (just the Description column for now) and using that for the
autocompletion. This solved all the crashes.

Unfortunately on the first implementation, autocompletion only worked for
the first new transaction. This was an issue with TreeViewIters and creating
a copy of the treeview model on each "editing-started" signal. So I made a
new function to make a copy of the completion data when the cellrenderers
are initialized (in cdf) and then use that copy for all completions. With
this change autocompletion worked for all new transactions, the only problem
being that the descriptions of the new transactions were not added to the
copy of the completion data. This can be solved by adding the new text
entered into the cell to the copy when the "edited" signal is received. This
is where I'm at currently.

I also noticed when looking into creating a callback or using an existing
one for the "edited" signal (the existing callback is "gtvt_edited_cb") that
I had unnecessarily created the "editing_started_cb" callback for the
"editing-started" signal ("get_editable_start_editing_cb" was already being
connected to that signal), so now I am working on integrating my code with
the existing callbacks. Once the callbacks are integrated there should be no
problems with autocompletion for the description field. It might also turn
out that there is no need for the copy of the data from the treeview model,
but that will have to wait until tomorrow. I'm running on very little sleep
and I need to get to bed before my keyboard becomes my pillow.

Jeff


More information about the gnucash-devel mailing list