Skip to content

Commit

Permalink
Change the document link KVP symbol to original name
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
Bob-IT committed Sep 13, 2020
1 parent 63ec05d commit 7c10267
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 7 deletions.
11 changes: 7 additions & 4 deletions gnucash/gnome-utils/dialog-doclink-utils.c
Expand Up @@ -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;
Expand All @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion gnucash/gschemas/org.gnucash.gschema.xml.in
Expand Up @@ -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>
Expand Down
2 changes: 1 addition & 1 deletion libgnucash/engine/Transaction.c
Expand Up @@ -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"
Expand Down
2 changes: 1 addition & 1 deletion libgnucash/engine/gncInvoice.c
Expand Up @@ -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; \
Expand Down

0 comments on commit 7c10267

Please sign in to comment.