r20375 - gnucash/trunk/src/import-export - Minor code cleanup: Move gconf section name into header; clarify argument name.

Christian Stimming cstim at code.gnucash.org
Sat Mar 5 06:40:53 EST 2011


Author: cstim
Date: 2011-03-05 06:40:53 -0500 (Sat, 05 Mar 2011)
New Revision: 20375
Trac: http://svn.gnucash.org/trac/changeset/20375

Modified:
   gnucash/trunk/src/import-export/import-commodity-matcher.c
   gnucash/trunk/src/import-export/import-commodity-matcher.h
   gnucash/trunk/src/import-export/import-settings.c
   gnucash/trunk/src/import-export/import-settings.h
Log:
Minor code cleanup: Move gconf section name into header; clarify argument name.

Modified: gnucash/trunk/src/import-export/import-commodity-matcher.c
===================================================================
--- gnucash/trunk/src/import-export/import-commodity-matcher.c	2011-03-04 21:05:55 UTC (rev 20374)
+++ gnucash/trunk/src/import-export/import-commodity-matcher.c	2011-03-05 11:40:53 UTC (rev 20375)
@@ -52,7 +52,7 @@
 
 
 gnc_commodity * gnc_import_select_commodity(const char * cusip,
-                                            gboolean auto_create,
+        gboolean ask_on_unknown,
         const char * default_fullname,
         const char * default_mnemonic)
 {
@@ -110,7 +110,7 @@
     g_list_free(commodity_list);
     g_list_free(namespace_list);
 
-    if (retval == NULL && auto_create != 0)
+    if (retval == NULL && ask_on_unknown != 0)
     {
         const gchar *message =
             _("Please select a commodity to match the following exchange "

Modified: gnucash/trunk/src/import-export/import-commodity-matcher.h
===================================================================
--- gnucash/trunk/src/import-export/import-commodity-matcher.h	2011-03-04 21:05:55 UTC (rev 20374)
+++ gnucash/trunk/src/import-export/import-commodity-matcher.h	2011-03-05 11:40:53 UTC (rev 20375)
@@ -40,7 +40,7 @@
   ticker is NOT appropriate, unless you have no other option. Must be
   non-NULL.
 
-  @param auto_create If the cusip value is unknown and this parameter
+  @param ask_on_unknown If the cusip value is unknown and this parameter
   is false (zero), the function returns NULL. Otherwise the user will
   be asked to select an existing or create a new commodity.
 
@@ -59,7 +59,7 @@
 
 */
 gnc_commodity * gnc_import_select_commodity(const char * cusip,
-        gboolean auto_create,
+        gboolean ask_on_unknown,
         const char * default_fullname,
         const char * default_mnemonic);
 

Modified: gnucash/trunk/src/import-export/import-settings.c
===================================================================
--- gnucash/trunk/src/import-export/import-settings.c	2011-03-04 21:05:55 UTC (rev 20374)
+++ gnucash/trunk/src/import-export/import-settings.c	2011-03-05 11:40:53 UTC (rev 20375)
@@ -36,7 +36,6 @@
  * If you modify the value of any of these, you must do the same in *
  * generic-import.scm                                               *
 \********************************************************************/
-#define GCONF_SECTION "dialogs/import/generic_matcher"
 
 static const int DEFAULT_ACTION_ADD_ENABLED = TRUE;
 static const int DEFAULT_ACTION_CLEAR_ENABLED = TRUE;
@@ -84,20 +83,20 @@
 
 
     settings->action_skip_enabled =
-        gnc_gconf_get_bool(GCONF_SECTION, "enable_skip", NULL);
+        gnc_gconf_get_bool(GCONF_IMPORT_SECTION, "enable_skip", NULL);
     settings->action_update_enabled =
-        gnc_gconf_get_bool(GCONF_SECTION, "enable_update", NULL);
+        gnc_gconf_get_bool(GCONF_IMPORT_SECTION, "enable_update", NULL);
     settings->action_add_enabled = DEFAULT_ACTION_ADD_ENABLED;
     settings->action_clear_enabled = DEFAULT_ACTION_CLEAR_ENABLED;
     settings->clear_threshold =
-        gnc_gconf_get_float(GCONF_SECTION, "auto_clear_threshold", NULL);
+        gnc_gconf_get_float(GCONF_IMPORT_SECTION, "auto_clear_threshold", NULL);
     settings->add_threshold =
-        gnc_gconf_get_float(GCONF_SECTION, "auto_add_threshold", NULL);
+        gnc_gconf_get_float(GCONF_IMPORT_SECTION, "auto_add_threshold", NULL);
     settings->display_threshold =
-        gnc_gconf_get_float(GCONF_SECTION, "match_threshold", NULL);
+        gnc_gconf_get_float(GCONF_IMPORT_SECTION, "match_threshold", NULL);
 
     settings->fuzzy_amount =
-        gnc_gconf_get_float(GCONF_SECTION, "atm_fee_threshold", NULL);
+        gnc_gconf_get_float(GCONF_IMPORT_SECTION, "atm_fee_threshold", NULL);
 
     settings->match_date_hardlimit = 42; /* 6 weeks */
     return settings;

Modified: gnucash/trunk/src/import-export/import-settings.h
===================================================================
--- gnucash/trunk/src/import-export/import-settings.h	2011-03-04 21:05:55 UTC (rev 20374)
+++ gnucash/trunk/src/import-export/import-settings.h	2011-03-05 11:40:53 UTC (rev 20375)
@@ -34,6 +34,8 @@
  *   Getter/Setter Functions for the Data Types.
  ************************************************************************/
 
+/** The GConf section of the importer */
+#define GCONF_IMPORT_SECTION "dialogs/import/generic_matcher"
 
 
 /** Allocates a new GNCImportSettings object, and initialize it with



More information about the gnucash-changes mailing list