gnucash maint: Change the document link KVP symbol to original name

Robert Fewell bobit at code.gnucash.org
Sun Sep 13 06:02:17 EDT 2020


Updated	 via  https://github.com/Gnucash/gnucash/commit/7c102678 (commit)
	from  https://github.com/Gnucash/gnucash/commit/63ec05d0 (commit)



commit 7c1026783be72f336cedc33a6b6e7415f2b99b7b
Author: Robert Fewell <14uBobIT at gmail.com>
Date:   Sun Sep 13 10:56:17 2020 +0100

    Change the document link KVP symbol to original name
    
    To maintain compatibility with any existing document link entries the
    old 'assoc-head' and 'asooc_uri' entries will be used for the gsetting
    and KVP entries.

diff --git a/gnucash/gnome-utils/dialog-doclink-utils.c b/gnucash/gnome-utils/dialog-doclink-utils.c
index 48d290161..ca7e7c078 100644
--- a/gnucash/gnome-utils/dialog-doclink-utils.c
+++ b/gnucash/gnome-utils/dialog-doclink-utils.c
@@ -166,9 +166,12 @@ static gchar *
 doclink_get_path_head_and_set (gboolean *path_head_set)
 {
     gchar *ret_path = NULL;
-    gchar *path_head = gnc_prefs_get_string (GNC_PREFS_GROUP_GENERAL, "doclink-head");
+    gchar *path_head = gnc_prefs_get_string (GNC_PREFS_GROUP_GENERAL, "assoc-head");
     *path_head_set = FALSE;
 
+    /* Note, assoc-head is the old name for the document link head which has been
+       kept for compatability */
+
     if (path_head && *path_head) // not default entry
     {
         *path_head_set = TRUE;
@@ -191,11 +194,11 @@ doclink_get_path_head_and_set (gboolean *path_head_set)
         ret_path = g_strdup (folder_with_slash);
         g_free (folder_with_slash);
 
-        if (*path_head_set) // prior to 3.5, doclink-head could be with or without a trailing '/'
+        if (*path_head_set) // prior to 3.5, assoc-head could be with or without a trailing '/'
         {
-            if (!gnc_prefs_set_string (GNC_PREFS_GROUP_GENERAL, "doclink-head", ret_path))
+            if (!gnc_prefs_set_string (GNC_PREFS_GROUP_GENERAL, "assoc-head", ret_path))
                 PINFO ("Failed to save preference at %s, %s with %s",
-                       GNC_PREFS_GROUP_GENERAL, "doclink-head", ret_path);
+                       GNC_PREFS_GROUP_GENERAL, "assoc-head", ret_path);
         }
     }
     g_free (path_head);
diff --git a/gnucash/gschemas/org.gnucash.gschema.xml.in b/gnucash/gschemas/org.gnucash.gschema.xml.in
index cf3538bb7..fd3461e16 100644
--- a/gnucash/gschemas/org.gnucash.gschema.xml.in
+++ b/gnucash/gschemas/org.gnucash.gschema.xml.in
@@ -20,7 +20,7 @@
       <summary>Character to use as separator between account names</summary>
       <description>This setting determines the character that will be used between components of an account name. Possible values are any single non-alphanumeric unicode character, or any of the following strings: "colon", "slash", "backslash", "dash" and "period".</description>
     </key>
-    <key name="doclink-head" type="s">
+    <key name="assoc-head" type="s">
       <default>''</default>
       <summary>Transaction Linked Files head path</summary>
       <description>This is the path head for the Transaction Linked Files with relative paths</description>
diff --git a/libgnucash/engine/Transaction.c b/libgnucash/engine/Transaction.c
index 13eb3e0f4..6cd2e855a 100644
--- a/libgnucash/engine/Transaction.c
+++ b/libgnucash/engine/Transaction.c
@@ -175,7 +175,7 @@ const char *void_reason_str = "void-reason";
 const char *void_time_str = "void-time";
 const char *void_former_notes_str = "void-former-notes";
 const char *trans_is_closing_str = "book_closing";
-const char *doclink_uri_str = "doclink_uri";
+const char *doclink_uri_str = "assoc_uri"; // this is the old name for the document link, kept for compatability
 
 /* KVP entry for date-due value */
 #define TRANS_DATE_DUE_KVP       "trans-date-due"
diff --git a/libgnucash/engine/gncInvoice.c b/libgnucash/engine/gncInvoice.c
index 7ce51a54c..4cd55fadf 100644
--- a/libgnucash/engine/gncInvoice.c
+++ b/libgnucash/engine/gncInvoice.c
@@ -84,7 +84,7 @@ static QofLogModule log_module = GNC_MOD_BUSINESS;
 #define _GNC_MOD_NAME     GNC_ID_INVOICE
 
 #define GNC_INVOICE_IS_CN "credit-note"
-#define GNC_INVOICE_DOCLINK "doclink_uri"
+#define GNC_INVOICE_DOCLINK "assoc_uri" // this is the old name for the document link, kept for compatability
 
 #define SET_STR(obj, member, str) { \
     char * tmp; \



Summary of changes:
 gnucash/gnome-utils/dialog-doclink-utils.c  | 11 +++++++----
 gnucash/gschemas/org.gnucash.gschema.xml.in |  2 +-
 libgnucash/engine/Transaction.c             |  2 +-
 libgnucash/engine/gncInvoice.c              |  2 +-
 4 files changed, 10 insertions(+), 7 deletions(-)



More information about the gnucash-changes mailing list