Iterative destination account matching

BenoitGrégoire bock at
Thu Feb 6 20:57:14 CST 2003

Following our conversation on IRC about,  

Here is what I think you have to do to implement this (I'm busy with real 
work, so I may have forgotten something, but this should help you not get 

*Note that the backend doesn't hold a list of transactions, only the data 
itself.  The only list is in the gui.

--1--Write a refresh function in the backend that will look something like 
gnc_import_TransInfo_refresh_destacc (GNCImportTransInfo *transaction_info, 
GncImportMatchMap *matchmap)
  g_assert (transaction_info);
  g_assert (matchmap);

 Account * orig_destacc = gnc_import_TransInfo_get_destacc (info)
Account * new_destacc = NULL;

  /* Try to find a previously selected destination account
     string match for the ADD action */
new_destacc = matchmap_find_destination (matchmap, transaction_info)
  gnc_import_TransInfo_set_destacc (transaction_info,

{/*account has changed*/
 return TRUE;
return FALSE;


In import-main-matcher.c, you need a refresh function that will iterate over 
each transaction in the window, call gnc_import_TransInfo_refresh_destacc, 
and trigger a screen refresh if it returns TRUE.

That function should be triggered in run_account_picker_dialog(), when the 
account changes.

Your refresh function must be configurable so the user can select if ALL the 
transactions are to be refreshed (default) or only the transactions AFTER the 
current one (So that those users that receive all there transactions with the 
same memo don't kill us).  If you don't want to figure out how  
import-settings.c and generic-import.scm work, just define a constant at the 
top of the file, I'll plug it in later.

Good luck,

Benoit Grégoire

More information about the gnucash-devel mailing list