Stop writing commodity namespaces to xml files in gnucash 1.8 compatible way

Gnucash will still be able to read the old ISO4217 tags, but no longer write them
This commit is contained in:
Geert Janssens 2017-06-20 22:23:59 +02:00
parent 12d85ff647
commit f3eeda3a9e
5 changed files with 3 additions and 33 deletions

View File

@ -76,7 +76,7 @@ gnc_commodity_dom_tree_create (const gnc_commodity* com)
xmlSetProp (ret, BAD_CAST "version", BAD_CAST commodity_version_string);
xmlAddChild (ret, text_to_dom_tree (cmdty_namespace,
gnc_commodity_get_namespace_compat (com)));
gnc_commodity_get_namespace (com)));
xmlAddChild (ret, text_to_dom_tree (cmdty_id,
gnc_commodity_get_mnemonic (com)));

View File

@ -120,7 +120,7 @@ commodity_ref_to_dom_tree (const char* tag, const gnc_commodity* c)
{
return NULL;
}
name_space = g_strdup (gnc_commodity_get_namespace_compat (c));
name_space = g_strdup (gnc_commodity_get_namespace (c));
mnemonic = g_strdup (gnc_commodity_get_mnemonic (c));
xmlNewTextChild (ret, NULL, BAD_CAST "cmdty:space",
checked_char_cast (name_space));

View File

@ -70,7 +70,7 @@ node_and_commodity_equal (xmlNodePtr node, const gnc_commodity* com)
else if (g_strcmp0 ((char*)mark->name, "cmdty:space") == 0)
{
if (!equals_node_val_vs_string (
mark, gnc_commodity_get_namespace_compat (com)))
mark, gnc_commodity_get_namespace (com)))
{
return "namespaces differ";
}

View File

@ -1020,22 +1020,6 @@ gnc_commodity_get_namespace(const gnc_commodity * cm)
return gnc_commodity_namespace_get_name(GET_PRIVATE(cm)->name_space);
}
const char *
gnc_commodity_get_namespace_compat(const gnc_commodity * cm)
{
CommodityPrivate* priv;
if (!cm) return NULL;
priv = GET_PRIVATE(cm);
if (!priv->name_space) return NULL;
if (priv->name_space->iso4217)
{
/* Data files are still written with ISO4217. */
return GNC_COMMODITY_NS_ISO;
}
return gnc_commodity_namespace_get_name(priv->name_space);
}
gnc_commodity_namespace *
gnc_commodity_get_namespace_ds(const gnc_commodity * cm)
{

View File

@ -340,20 +340,6 @@ const char * gnc_commodity_get_mnemonic(const gnc_commodity * cm);
*/
const char * gnc_commodity_get_namespace(const gnc_commodity * cm);
/** Retrieve the namespace for the specified commodity. This will be
* a pointer to a null terminated string of the form "AMEX",
* "NASDAQ", etc. The only difference between function and
* gnc_commodity_get_namespace() is that this function returns
* ISO4217 instead of CURRENCY for backward compatibility with the
* 1.8 data files.
*
* @param cm A pointer to a commodity data structure.
*
* @return A pointer to the namespace for this commodity. This string
* is owned by the engine and should not be freed by the caller.
*/
const char * gnc_commodity_get_namespace_compat(const gnc_commodity * cm);
/** Retrieve the namespace data strucure for the specified commodity.
* This will be a pointer to another data structure.
*