gnucash maint: Multiple changes pushed

Robert Fewell bobit at code.gnucash.org
Tue Jan 19 08:59:01 EST 2021


Updated	 via  https://github.com/Gnucash/gnucash/commit/1c83eba2 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/c9922c7e (commit)
	from  https://github.com/Gnucash/gnucash/commit/960917e8 (commit)



commit 1c83eba2ea26013ded8d0882354775ea1c1f8266
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Jan 19 13:57:06 2021 +0000

    Change some internal CSV account export references to reflect header name changes

diff --git a/gnucash/import-export/csv-imp/assistant-csv-account-import.c b/gnucash/import-export/csv-imp/assistant-csv-account-import.c
index bfceccedc..469838cf9 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-account-import.c
+++ b/gnucash/import-export/csv-imp/assistant-csv-account-import.c
@@ -124,11 +124,11 @@ void create_regex (GString *regex_str, const gchar *sep)
             "(?<description>\"(?:[^\"]|\"\")*\"|[^%s]*)%s"
             "(?<color>\"(?:[^\"]|\"\")*\"|[^%s]*)%s"
             "(?<notes>\"(?:[^\"]|\"\")*\"|[^%s]*)%s"
-            "(?<commoditym>\"(?:[^\"]|\"\")*\"|[^%s]*)%s"
-            "(?<commodityn>\"(?:[^\"]|\"\")*\"|[^%s]*)%s"
+            "(?<symbol>\"(?:[^\"]|\"\")*\"|[^%s]*)%s"
+            "(?<namespace>\"(?:[^\"]|\"\")*\"|[^%s]*)%s"
             "(?<hidden>[^%s]*)%s"
             "(?<tax>[^%s]*)%s"
-            "(?<place_holder>[^%s[:cntrl:]]*)(?:\\R*)",
+            "(?<placeholder>[^%s[:cntrl:]]*)(?:\\R*)",
             sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep,
             sep, sep, sep, sep, sep, sep, sep, sep, sep, sep, sep);
 
@@ -707,8 +707,8 @@ csv_import_assistant_create (CsvImportInfo *info)
     CREATE_COLUMN ("Description", DESCRIPTION);
     CREATE_COLUMN ("Account Color", COLOR);
     CREATE_COLUMN ("Notes", NOTES);
-    CREATE_COLUMN ("Symbol", COMMODITYM);
-    CREATE_COLUMN ("Namespace", COMMODITYN);
+    CREATE_COLUMN ("Symbol", SYMBOL);
+    CREATE_COLUMN ("Namespace", NAMESPACE);
     CREATE_COLUMN ("Hidden", HIDDEN);
     CREATE_COLUMN ("Tax Info", TAX);
     CREATE_COLUMN ("Placeholder", PLACE_HOLDER);
diff --git a/gnucash/import-export/csv-imp/assistant-csv-account-import.h b/gnucash/import-export/csv-imp/assistant-csv-account-import.h
index 15eb2891f..1c74fa221 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-account-import.h
+++ b/gnucash/import-export/csv-imp/assistant-csv-account-import.h
@@ -33,7 +33,7 @@
 enum tree_import_model_columns
 {
     TYPE, FULL_NAME, NAME, CODE, DESCRIPTION, COLOR,
-    NOTES, COMMODITYM, COMMODITYN, HIDDEN, TAX, PLACE_HOLDER, ROW_COLOR,
+    NOTES, SYMBOL, NAMESPACE, HIDDEN, TAX, PLACE_HOLDER, ROW_COLOR,
     N_COLUMNS
 };
 
diff --git a/gnucash/import-export/csv-imp/csv-account-import.c b/gnucash/import-export/csv-imp/csv-account-import.c
index a757a0b5e..867cf8c47 100644
--- a/gnucash/import-export/csv-imp/csv-account-import.c
+++ b/gnucash/import-export/csv-imp/csv-account-import.c
@@ -129,7 +129,8 @@ csv_import_read_file (GtkWindow *window, const gchar *filename,
     g_regex_match (regexpat, contents, 0, &match_info);
     while (g_match_info_matches (match_info))
     {
-        // fill in the values
+        // fill in the values, pattern match names must match those defined in
+        // regular expression
         gtk_list_store_append (store, &iter);
         fill_model_with_match (match_info, "type", store, &iter, TYPE);
         fill_model_with_match (match_info, "full_name", store, &iter, FULL_NAME);
@@ -138,11 +139,11 @@ csv_import_read_file (GtkWindow *window, const gchar *filename,
         fill_model_with_match (match_info, "description", store, &iter, DESCRIPTION);
         fill_model_with_match (match_info, "color", store, &iter, COLOR);
         fill_model_with_match (match_info, "notes", store, &iter, NOTES);
-        fill_model_with_match (match_info, "commoditym", store, &iter, COMMODITYM);
-        fill_model_with_match (match_info, "commodityn", store, &iter, COMMODITYN);
+        fill_model_with_match (match_info, "symbol", store, &iter, SYMBOL);
+        fill_model_with_match (match_info, "namespace", store, &iter, NAMESPACE);
         fill_model_with_match (match_info, "hidden", store, &iter, HIDDEN);
         fill_model_with_match (match_info, "tax", store, &iter, TAX);
-        fill_model_with_match (match_info, "place_holder", store, &iter, PLACE_HOLDER);
+        fill_model_with_match (match_info, "placeholder", store, &iter, PLACE_HOLDER);
         gtk_list_store_set (store, &iter, ROW_COLOR, NULL, -1);
 
         if (row == 0)
@@ -192,7 +193,7 @@ csv_account_import (CsvImportInfo *info)
     GdkRGBA       testcolor;
     GtkTreeIter    iter;
     gchar         *type, *full_name, *name, *code, *description, *color;
-    gchar         *notes, *commoditym, *commodityn, *hidden, *tax, *place_holder;
+    gchar         *notes, *symbol, *namespace, *hidden, *tax, *place_holder;
     int            row;
 
     ENTER("");
@@ -216,8 +217,8 @@ csv_account_import (CsvImportInfo *info)
                             DESCRIPTION, &description,
                             COLOR, &color,
                             NOTES, &notes,
-                            COMMODITYM, &commoditym,
-                            COMMODITYN, &commodityn,
+                            SYMBOL, &symbol,
+                            NAMESPACE, &namespace,
                             HIDDEN, &hidden,
                             TAX, &tax,
                             PLACE_HOLDER, &place_holder, -1);
@@ -260,7 +261,7 @@ csv_account_import (CsvImportInfo *info)
 
                 /* Do we have a valid commodity */
                 table = gnc_commodity_table_get_table (book);
-                commodity = gnc_commodity_table_lookup (table, commodityn, commoditym);
+                commodity = gnc_commodity_table_lookup (table, namespace, symbol);
 
                 if (commodity)
                 {
@@ -302,7 +303,7 @@ csv_account_import (CsvImportInfo *info)
                 else
                 {
                     gchar *err_string = g_strdup_printf (gettext("Row %u, commodity %s / %s not found\n"), row + 1,
-                                                         commoditym, commodityn);
+                                                         symbol, namespace);
                     info->error = g_strconcat (info->error, err_string, NULL);
                     g_free (err_string);
                     PINFO("Unable to import Row %u for account %s, commodity!", row, full_name);
@@ -349,8 +350,8 @@ csv_account_import (CsvImportInfo *info)
         g_free (description);
         g_free (color);
         g_free (notes);
-        g_free (commoditym);
-        g_free (commodityn);
+        g_free (symbol);
+        g_free (namespace);
         g_free (hidden);
         g_free (tax);
         g_free (place_holder);

commit c9922c7e4afd7915e01cf657df8146d8885220da
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Tue Jan 19 13:54:08 2021 +0000

    Change the CSV export account tree header line
    
    Change the headings of the CSV account export header line to be more
    friendly which uses existing translations.

diff --git a/gnucash/import-export/csv-exp/csv-tree-export.c b/gnucash/import-export/csv-exp/csv-tree-export.c
index 9eee2f312..a8ad62e06 100644
--- a/gnucash/import-export/csv-exp/csv-tree-export.c
+++ b/gnucash/import-export/csv-exp/csv-tree-export.c
@@ -152,10 +152,10 @@ void csv_tree_export (CsvExportInfo *info)
         }
 
         /* Header string, 'eol = end of line marker' */
-        header = g_strconcat (end_sep, _("type"), mid_sep, _("full_name"), mid_sep, _("name"), mid_sep,
-                                _("code"), mid_sep, _("description"), mid_sep, _("color"), mid_sep,
-                                _("notes"), mid_sep, _("commoditym"), mid_sep, _("commodityn"), mid_sep,
-                                _("hidden"), mid_sep, _("tax"), mid_sep, _("placeholder"), end_sep, EOLSTR, NULL);
+        header = g_strconcat (end_sep, _("Type"), mid_sep, _("Full Account Name"), mid_sep, _("Account Name"), mid_sep,
+                                _("Account Code"), mid_sep, _("Description"), mid_sep, _("Account Color"), mid_sep,
+                                _("Notes"), mid_sep, _("Symbol"), mid_sep, _("Namespace"), mid_sep,
+                                _("Hidden"), mid_sep, _("Tax Info"), mid_sep, _("Placeholder"), end_sep, EOLSTR, NULL);
         DEBUG("Header String: %s", header);
 
         /* Write header line */
@@ -215,7 +215,7 @@ void csv_tree_export (CsvExportInfo *info)
             part1 = g_strconcat (part2, str_temp, mid_sep, NULL);
             g_free (str_temp);
             g_free (part2);
-            /* Commodity Mnemonic */
+            /* Commodity Symbol */
             currentSel = gnc_commodity_get_mnemonic (xaccAccountGetCommodity (acc));
             str_temp = csv_test_field_string (info, currentSel);
             part2 = g_strconcat (part1, str_temp, mid_sep, NULL);
diff --git a/gnucash/import-export/csv-imp/assistant-csv-account-import.c b/gnucash/import-export/csv-imp/assistant-csv-account-import.c
index 4d5171f21..bfceccedc 100644
--- a/gnucash/import-export/csv-imp/assistant-csv-account-import.c
+++ b/gnucash/import-export/csv-imp/assistant-csv-account-import.c
@@ -700,18 +700,18 @@ csv_import_assistant_create (CsvImportInfo *info)
   gtk_tree_view_column_set_resizable (column, TRUE); \
   gtk_tree_view_append_column (GTK_TREE_VIEW(info->tree_view), column); \
   g_free (mnemonic_desc);
-    CREATE_COLUMN ("type", TYPE);
-    CREATE_COLUMN ("full_name", FULL_NAME);
-    CREATE_COLUMN ("name", NAME);
-    CREATE_COLUMN ("code", CODE);
-    CREATE_COLUMN ("description", DESCRIPTION);
-    CREATE_COLUMN ("color", COLOR);
-    CREATE_COLUMN ("notes", NOTES);
-    CREATE_COLUMN ("commoditym", COMMODITYM);
-    CREATE_COLUMN ("commodityn", COMMODITYN);
-    CREATE_COLUMN ("hidden", HIDDEN);
-    CREATE_COLUMN ("tax", TAX);
-    CREATE_COLUMN ("place_holder", PLACE_HOLDER);
+    CREATE_COLUMN ("Type", TYPE);
+    CREATE_COLUMN ("Account Full Name", FULL_NAME);
+    CREATE_COLUMN ("Account Name", NAME);
+    CREATE_COLUMN ("Account Code", CODE);
+    CREATE_COLUMN ("Description", DESCRIPTION);
+    CREATE_COLUMN ("Account Color", COLOR);
+    CREATE_COLUMN ("Notes", NOTES);
+    CREATE_COLUMN ("Symbol", COMMODITYM);
+    CREATE_COLUMN ("Namespace", COMMODITYN);
+    CREATE_COLUMN ("Hidden", HIDDEN);
+    CREATE_COLUMN ("Tax Info", TAX);
+    CREATE_COLUMN ("Placeholder", PLACE_HOLDER);
 
     /* Finish Page */
     info->finish_label = GTK_WIDGET(gtk_builder_get_object (builder, "end_page"));
diff --git a/gnucash/import-export/csv-imp/csv-account-import.c b/gnucash/import-export/csv-imp/csv-account-import.c
index 804f11928..a757a0b5e 100644
--- a/gnucash/import-export/csv-imp/csv-account-import.c
+++ b/gnucash/import-export/csv-imp/csv-account-import.c
@@ -150,7 +150,7 @@ csv_import_read_file (GtkWindow *window, const gchar *filename,
             gchar *str_type;
             gtk_tree_model_get (GTK_TREE_MODEL(store), &iter, TYPE, &str_type, -1);
 
-            if (g_strcmp0 (_("type"), str_type) == 0)
+            if (g_strcmp0 (_("Type"), str_type) == 0)
                 match_found = TRUE;
             g_free (str_type);
         }



Summary of changes:
 gnucash/import-export/csv-exp/csv-tree-export.c    | 10 ++++----
 .../csv-imp/assistant-csv-account-import.c         | 30 +++++++++++-----------
 .../csv-imp/assistant-csv-account-import.h         |  2 +-
 gnucash/import-export/csv-imp/csv-account-import.c | 25 +++++++++---------
 4 files changed, 34 insertions(+), 33 deletions(-)



More information about the gnucash-changes mailing list