From 6131631a7826f681eeb0f8429b3fcad18affd57b Mon Sep 17 00:00:00 2001 From: Christian Stimming Date: Sat, 1 Feb 2003 22:43:26 +0000 Subject: [PATCH] 2003-02-01 Christian Stimming * src/import-export/import-backend.c: Reduced the MATCH_DATE_NOT_THRESHOLD to 21 days. Yeah, this should rather be a user preference, but IMHO three weeks should already cover the basic problem. * src/import-export/import-account-matcher.c, import-backend.c, import-main-matcher.c, import-match-picker.c: Comment out stderr debugging output. git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@7912 57a11ea4-9604-0410-9ed3-97b8803252fd --- ChangeLog | 9 +++++++++ src/import-export/import-account-matcher.c | 8 ++++---- src/import-export/import-backend.c | 18 +++++++++--------- src/import-export/import-main-matcher.c | 4 ++-- src/import-export/import-match-picker.c | 15 ++++++++------- 5 files changed, 32 insertions(+), 22 deletions(-) diff --git a/ChangeLog b/ChangeLog index bafcc21d9d..d85f8c729f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,14 @@ 2003-02-01 Christian Stimming + * src/import-export/import-backend.c: Reduced the + MATCH_DATE_NOT_THRESHOLD to 21 days. Yeah, this should rather be a + user preference, but IMHO three weeks should already cover the + basic problem. + + * src/import-export/import-account-matcher.c, import-backend.c, + import-main-matcher.c, import-match-picker.c: Comment out + stderr debugging output. + * src/import-export/generic-import.scm: Move transaction matcher preferences to "Online Banking & Import" preference page. diff --git a/src/import-export/import-account-matcher.c b/src/import-export/import-account-matcher.c index 70a1fa9613..cd76d2f64b 100644 --- a/src/import-export/import-account-matcher.c +++ b/src/import-export/import-account-matcher.c @@ -162,7 +162,7 @@ static void gnc_ui_generic_account_picker_new_cb(GtkButton * w, gpointer user_data) { struct _accountpickerdialog * picker = user_data; GList * valid_types = NULL; - DEBUG("Begin"); + /*DEBUG("Begin"); */ if(picker->new_account_default_type!=NO_TYPE) { @@ -242,7 +242,7 @@ Account * gnc_import_select_account(char * account_online_id_value, picker->new_account_default_type = new_account_default_type; picker->selected_acct=default_selection; - DEBUG("Looking for account with online_id: %s", account_online_id_value); + /*DEBUG("Looking for account with online_id: %s", account_online_id_value);*/ if(account_online_id_value!=NULL) { retval = xaccGroupForEachAccount(picker->acct_group, @@ -308,9 +308,9 @@ Account * gnc_import_select_account(char * account_online_id_value, { ok_pressed_retval=TRUE; /* There was no dialog involved, so the computer "pressed" ok */ } - printf("WRITEME: gnc_import_select_account() Here we should check if account type is compatible, currency matches, etc.\n"); + /*FIXME: DEBUG("WRITEME: gnc_import_select_account() Here we should check if account type is compatible, currency matches, etc.\n"); */ g_free(picker); - DEBUG("Return value: %p%s%s%s",retval,", account name:",xaccAccountGetName(retval),"\n"); + /*DEBUG("Return value: %p%s%s%s",retval,", account name:",xaccAccountGetName(retval),"\n");*/ if(ok_pressed!=NULL) { *ok_pressed=ok_pressed_retval; diff --git a/src/import-export/import-backend.c b/src/import-export/import-backend.c index 5bdb05718f..f43c79ddbd 100644 --- a/src/import-export/import-backend.c +++ b/src/import-export/import-backend.c @@ -55,7 +55,7 @@ static short module = MOD_IMPORT; \********************************************************************/ static const int MATCH_DATE_THRESHOLD=4; /*within 4 days*/ -static const int MATCH_DATE_NOT_THRESHOLD = 25; +static const int MATCH_DATE_NOT_THRESHOLD = 21; /**Transaction's who have an online_id kvp frame have been downloaded online can probably be skipped in the match list, since it is very unlikely that they would match a transaction downloaded at a later @@ -444,7 +444,7 @@ static void split_find_match (GNCImportTransInfo * trans_info, xaccSplitGetAmount(split))) { prob = prob+3; - DEBUG("heuristics: probability + 3 (amount)"); + /*DEBUG("heuristics: probability + 3 (amount)");*/ } else if (fabs (downloaded_split_amount - match_split_amount) <= fuzzy_amount_difference) @@ -453,7 +453,7 @@ static void split_find_match (GNCImportTransInfo * trans_info, So you withdraw 100$ and get charged 101,25$ in the same transaction */ prob = prob+2; - DEBUG("heuristics: probability + 2 (amount)"); + /*DEBUG("heuristics: probability + 2 (amount)");*/ } else { @@ -478,19 +478,19 @@ static void split_find_match (GNCImportTransInfo * trans_info, if (datediff_day == 0) { prob = prob+3; - DEBUG("heuristics: probability + 3 (date)"); + /*DEBUG("heuristics: probability + 3 (date)");*/ } else if (datediff_day <= MATCH_DATE_THRESHOLD) { prob = prob+2; - DEBUG("heuristics: probability + 2 (date)"); + /*DEBUG("heuristics: probability + 2 (date)");*/ } else if (datediff_day > MATCH_DATE_NOT_THRESHOLD) { /* Extra penalty if that split lies awfully far away from the given one. */ prob = prob-10; - DEBUG("heuristics: probability - 10 (date)"); + /*DEBUG("heuristics: probability - 10 (date)"); */ } @@ -513,7 +513,7 @@ static void split_find_match (GNCImportTransInfo * trans_info, number some banks seem to include in the memo but someone should write something more sophisticated */ prob = prob+1; - DEBUG("heuristics: probability + 1 (memo)"); + /*DEBUG("heuristics: probability + 1 (memo)"); */ } /* Description heuristics */ @@ -524,7 +524,7 @@ static void split_find_match (GNCImportTransInfo * trans_info, { /*An exact match of Description gives a +2 */ prob = prob+2; - DEBUG("heuristics: probability + 2 (description)"); + /*DEBUG("heuristics: probability + 2 (description)");*/ } else if((strncmp(xaccTransGetDescription (gnc_import_TransInfo_get_trans (trans_info)), @@ -538,7 +538,7 @@ static void split_find_match (GNCImportTransInfo * trans_info, number some banks seem to include in the memo but someone should write something more sophisticated */ prob = prob+1; - DEBUG("heuristics: probability + 1 (description)"); + /*DEBUG("heuristics: probability + 1 (description)"); */ } if ((gnc_import_get_trans_online_id(xaccSplitGetParent(split))!=NULL) && diff --git a/src/import-export/import-main-matcher.c b/src/import-export/import-main-matcher.c index e3197bff6d..9b952dd2c8 100644 --- a/src/import-export/import-main-matcher.c +++ b/src/import-export/import-main-matcher.c @@ -285,7 +285,7 @@ clist_select_row_cb (GtkCList *clist, GNCImportMainMatcher *gui = user_data; GNCImportTransInfo *trans_info; gboolean should_refresh = TRUE; - DEBUG("row_number: %d%s%d",row_number,", column: ",column); + /*DEBUG("row_number: %d%s%d",row_number,", column: ",column);*/ trans_info = gtk_clist_get_row_data (clist, row_number); if (trans_info == NULL) return; @@ -531,7 +531,7 @@ refresh_clist_row (GNCImportMainMatcher *gui, gchar *tmp,*imbalance; g_assert (gui); g_assert (info); - DEBUG("Begin"); + /*DEBUG("Begin");*/ gnc_gen_trans_list_freeze(gui); for (i = 0; i < NUM_COLUMNS_DOWNLOADED_CLIST; i++) diff --git a/src/import-export/import-match-picker.c b/src/import-export/import-match-picker.c index 3804721dbe..21d7ba5bfb 100644 --- a/src/import-export/import-match-picker.c +++ b/src/import-export/import-match-picker.c @@ -57,7 +57,8 @@ static const int MATCHER_CLIST_AMOUNT = 2; static const int MATCHER_CLIST_DESCRIPTION = 3; static const int MATCHER_CLIST_MEMO = 4; -static short module = MOD_IMPORT; +/* Needs to be commented in again if any DEBUG() macro is used here. */ +/*static short module = MOD_IMPORT;*/ /********************************************************************\ * Constants, should idealy be defined a user preference dialog * @@ -89,7 +90,7 @@ downloaded_transaction_append(GNCImportMatchPicker * matcher, g_assert(matcher); g_assert(transaction_info); - DEBUG("Begin"); + /*DEBUG("Begin");*/ row_number = gtk_clist_find_row_from_data(matcher->downloaded_clist, transaction_info); @@ -150,7 +151,7 @@ downloaded_transaction_select_cb (GtkCList *clist, GList * list_element; gint row_number; const char * clist_text[NUM_COLUMNS_MATCHER_CLIST]; - DEBUG("row: %d%s%d",row,", column: ",column); + /*DEBUG("row: %d%s%d",row,", column: ",column);*/ matcher->selected_trans_info = gtk_clist_get_row_data(clist, row); @@ -243,7 +244,7 @@ match_transaction_select_cb (GtkCList *clist, GdkEventButton *event, gpointer user_data) { GNCImportMatchPicker * matcher = user_data; - DEBUG("row: %d%s%d",row,", column: ",column); + /*DEBUG("row: %d%s%d",row,", column: ",column);*/ matcher->selected_match_info = gtk_clist_get_row_data(clist, row); } @@ -255,7 +256,7 @@ match_transaction_unselect_cb(GtkCList *clist, GdkEventButton *event, gpointer user_data) { GNCImportMatchPicker * matcher = user_data; - DEBUG("row: %d%s%d",row,", column: ",column); + /*DEBUG("row: %d%s%d",row,", column: ",column);*/ matcher->selected_match_info=NULL; } @@ -358,10 +359,10 @@ gnc_import_match_picker_run_and_close (GNCImportTransInfo *transaction_info) old = gnc_import_TransInfo_get_selected_match(transaction_info); /* Let this dialog run and close. */ - DEBUG("Right before run and close"); + /*DEBUG("Right before run and close");*/ result = gnome_dialog_run_and_close (GNOME_DIALOG (matcher->transaction_matcher)); - DEBUG("Right after run and close"); + /*DEBUG("Right after run and close");*/ /* DEBUG("Result was %d.", result); */ if (result == 0 && matcher->selected_match_info != old) { /* OK was pressed */