[Gnucash-changes] Add the 'bayesian matching' preference that was hidden in the code.

David Hampton hampton at cvs.gnucash.org
Sun Oct 2 20:10:32 EDT 2005


Log Message:
-----------
Add the 'bayesian matching' preference that was hidden in the code.

Tags:
----
gnucash-gnome2-dev

Modified Files:
--------------
    gnucash:
        ChangeLog
    gnucash/src/import-export:
        import-backend.c
        import-settings.c
    gnucash/src/import-export/schemas:
        apps_gnucash_import_generic_matcher.schemas

Revision Data
-------------
Index: ChangeLog
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/ChangeLog,v
retrieving revision 1.1487.2.303
retrieving revision 1.1487.2.304
diff -LChangeLog -LChangeLog -u -r1.1487.2.303 -r1.1487.2.304
--- ChangeLog
+++ ChangeLog
@@ -1,5 +1,19 @@
 2005-10-02  David Hampton  <hampton at employees.org>
 
+	* src/import-export/import-backend.c:
+	* src/import-export/import-settings.c:
+	* src/import-export/schemas/apps_gnucash_import_generic_matcher.schemas:
+	Add the 'bayesian matching' preference that was hidden in the
+	code.
+
+	* src/import-export/generic-import.glade: Forgot to name the
+	widgets properly so that the preferences dialog would time them in
+	with their gconf settings.  Add the 'bayesian matching'
+	preference.
+
+	* src/app-utils/prefs.scm: Remove unreferenced "Fancy Date Format"
+	option.
+
 	* src/app-utils/prefs.scm:
 	* src/gnome/Makefile.am:
 	* src/gnome/gnc-network.[ch]:
Index: import-settings.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/import-settings.c,v
retrieving revision 1.4.4.3
retrieving revision 1.4.4.4
diff -Lsrc/import-export/import-settings.c -Lsrc/import-export/import-settings.c -u -r1.4.4.3 -r1.4.4.4
--- src/import-export/import-settings.c
+++ src/import-export/import-settings.c
@@ -41,22 +41,6 @@
 \********************************************************************/
 #define GCONF_SECTION "dialogs/import/generic_matcher"
 
-/** Transaction who's best match probability is equal or higher than
-   this will reconcile their best match by default */
-#define DEFAULT_CLEAR_THRESHOLD 6
-/** Transaction who's best match probability is below or equal to 
-   this will be added as new by default */
-#define DEFAULT_ADD_THRESHOLD 3
-/** Transaction's match probability must be at least this much to be
-   displayed in the match list.  Dont set this to 0 except for 
-   debugging purposes, otherwise all transactions of every accounts 
-   will be shown in the list */
-#define DEFAULT_DISPLAY_THRESHOLD 1
-
-#define DEFAULT_ATM_FEE_THRESHOLD 2.00
-
-static const int DEFAULT_ACTION_SKIP_ENABLED = TRUE;
-static const int DEFAULT_ACTION_EDIT_ENABLED = FALSE;
 static const int DEFAULT_ACTION_ADD_ENABLED = TRUE;
 static const int DEFAULT_ACTION_CLEAR_ENABLED = TRUE;
 
Index: import-backend.c
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/import-backend.c,v
retrieving revision 1.19.2.7
retrieving revision 1.19.2.8
diff -Lsrc/import-export/import-backend.c -Lsrc/import-export/import-backend.c -u -r1.19.2.7 -r1.19.2.8
--- src/import-export/import-backend.c
+++ src/import-export/import-backend.c
@@ -34,6 +34,7 @@
 
 #include <stdlib.h> 
 #include <math.h>
+#include "gnc-gconf-utils.h"
 #include "import-backend.h"
 #include "import-utilities.h"
 #include "Account.h"
@@ -45,8 +46,8 @@
 
 #include "gnc-ui-util.h"
 
-#define IMPORT_PAGE	"Online Banking & Importing" /* from app-utils/prefs.scm */
-#define BAYES_OPTION	"Use Bayesian Matching?"
+#define GCONF_SECTION "dialogs/import/generic_matcher"
+#define BAYES_OPTION  "use_bayes"
 
 /********************************************************************\
  *   Constants   *
@@ -461,7 +462,7 @@
 	     (xaccSplitGetAccount
 	      (gnc_import_TransInfo_get_fsplit (info))));
 
-  useBayes = gnc_lookup_boolean_option(IMPORT_PAGE, BAYES_OPTION, TRUE);
+  useBayes = gnc_gconf_get_bool(GCONF_SECTION, BAYES_OPTION, NULL);
   if(useBayes)
     {
       /* get the tokens for this transaction* */
@@ -530,7 +531,7 @@
 		   (gnc_import_TransInfo_get_fsplit (trans_info))));
 
   /* see what matching system we are currently using */
-  useBayes = gnc_lookup_boolean_option(IMPORT_PAGE, BAYES_OPTION, TRUE);
+  useBayes = gnc_gconf_get_bool(GCONF_SECTION, BAYES_OPTION, NULL);
   if(useBayes)
     {
       /* tokenize this transaction */
Index: apps_gnucash_import_generic_matcher.schemas
===================================================================
RCS file: /home/cvs/cvsroot/gnucash/src/import-export/schemas/Attic/apps_gnucash_import_generic_matcher.schemas,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -Lsrc/import-export/schemas/apps_gnucash_import_generic_matcher.schemas -Lsrc/import-export/schemas/apps_gnucash_import_generic_matcher.schemas -u -r1.1.2.1 -r1.1.2.2
--- src/import-export/schemas/apps_gnucash_import_generic_matcher.schemas
+++ src/import-export/schemas/apps_gnucash_import_generic_matcher.schemas
@@ -35,6 +35,18 @@
     </schema>
 
     <schema>
+      <key>/schemas/apps/gnucash/dialogs/import/generic_matcher/use_bayes</key>
+      <applyto>/apps/gnucash/dialogs/import/generic_matcher/use_bayes</applyto>
+      <owner>gnucash</owner>
+      <type>bool</type>
+      <default>FALSE</default>
+      <locale name="C">
+        <short>Use bayesian matching.</short>
+        <long>Use bayesian matching.</long>
+      </locale>
+    </schema>
+
+    <schema>
       <key>/schemas/apps/gnucash/dialogs/import/generic_matcher/match_threshold</key>
       <applyto>/apps/gnucash/dialogs/import/generic_matcher/match_threshold</applyto>
       <owner>gnucash</owner>


More information about the gnucash-changes mailing list