gnucash master: Multiple changes pushed

Geert Janssens gjanssens at code.gnucash.org
Sun Sep 10 13:21:06 EDT 2017


Updated	 via  https://github.com/Gnucash/gnucash/commit/556f7037 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/82bd4f69 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/600f0104 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/f0f53d99 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/4250f53f (commit)
	 via  https://github.com/Gnucash/gnucash/commit/bbdb7151 (commit)
	 via  https://github.com/Gnucash/gnucash/commit/121dd8cf (commit)
	from  https://github.com/Gnucash/gnucash/commit/f0fe1e99 (commit)



commit 556f7037adf4c8e5324c61faa33efec600f5e4c9
Merge: 82bd4f6 600f010
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 10 19:16:38 2017 +0200

    Merge branch 'maint'

diff --cc libgnucash/engine/business-core.i
index 5aee7a5,0000000..5ceb8e5
mode 100644,000000..100644
--- a/libgnucash/engine/business-core.i
+++ b/libgnucash/engine/business-core.i
@@@ -1,193 -1,0 +1,194 @@@
 +/********************************************************************\
 + * This program is free software; you can redistribute it and/or    *
 + * modify it under the terms of the GNU General Public License as   *
 + * published by the Free Software Foundation; either version 2 of   *
 + * the License, or (at your option) any later version.              *
 + *                                                                  *
 + * This program is distributed in the hope that it will be useful,  *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
 + * GNU General Public License for more details.                     *
 + *                                                                  *
 + * You should have received a copy of the GNU General Public License*
 + * along with this program; if not, contact:                        *
 + *                                                                  *
 + * Free Software Foundation           Voice:  +1-617-542-5942       *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 + *                                                                  *
 +\********************************************************************/
 +
 +#if defined(SWIGGUILE)
 +%{
 +/* Disable -Waddress.  GCC 4.2 warns (and fails to compile with -Werror) when
 + * passing the address of a guid on the stack to QOF_BOOK_LOOKUP_ENTITY via
 + * gncInvoiceLookup and friends.  When the macro gets inlined, the compiler
 + * emits a warning that the guid null pointer test is always true.
 + */
 +#if (__GNUC__ >= 4 && __GNUC_MINOR__ >= 2)
 +#    pragma GCC diagnostic warning "-Waddress"
 +#endif
 +%}
 +#endif
 +
 +%rename(gncOwnerReturnGUID) gncOwnerRetGUID;
 +
 +%inline %{
 +static GncGUID gncTaxTableReturnGUID(GncTaxTable *x)
 +{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }
 +
 +static GncGUID gncInvoiceReturnGUID(GncInvoice *x)
 +{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }
 +
 +static GncGUID gncJobReturnGUID(GncJob *x)
 +{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }
 +
 +static GncGUID gncVendorReturnGUID(GncVendor *x)
 +{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }
 +
 +static GncGUID gncCustomerReturnGUID(GncCustomer *x)
 +{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }
 +
 +static GncGUID gncEmployeeReturnGUID(GncEmployee *x)
 +{ return (x ? *(qof_instance_get_guid(QOF_INSTANCE(x))) : *(guid_null())); }
 +
 +static GncTaxTable * gncTaxTableLookupFlip(GncGUID g, QofBook *b)
 +{ return gncTaxTableLookup(b, &g); }
 +
 +static GncInvoice * gncInvoiceLookupFlip(GncGUID g, QofBook *b)
 +{ return gncInvoiceLookup(b, &g); }
 +
 +static GncJob * gncJobLookupFlip(GncGUID g, QofBook *b)
 +{ return gncJobLookup(b, &g); }
 +
 +static GncVendor * gncVendorLookupFlip(GncGUID g, QofBook *b)
 +{ return gncVendorLookup(b, &g); }
 +
 +static GncCustomer * gncCustomerLookupFlip(GncGUID g, QofBook *b)
 +{ return gncCustomerLookup(b, &g); }
 +
 +static GncEmployee * gncEmployeeLookupFlip(GncGUID g, QofBook *b)
 +{ return gncEmployeeLookup(b, &g); }
 +
 +%}
 +
 +GLIST_HELPER_INOUT(GncInvoiceList, SWIGTYPE_p__gncInvoice);
 +GLIST_HELPER_INOUT(EntryList, SWIGTYPE_p__gncEntry);
++GLIST_HELPER_INOUT(GncTaxTableGetTables, SWIGTYPE_p__gncTaxTable);
 +GLIST_HELPER_INOUT(GncTaxTableEntryList, SWIGTYPE_p__gncTaxTableEntry);
 +GLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);
 +
 +#if defined(SWIGGUILE)
 +%typemap(in) GncAccountValue * "$1 = gnc_scm_to_account_value_ptr($input);"
 +%typemap(out) GncAccountValue * "$result = gnc_account_value_ptr_to_scm($1);"
 +%typemap(in) AccountValueList * {
 +  SCM list = $input;
 +  GList *c_list = NULL;
 +
 +  while (!scm_is_null(list)) {
 +        GncAccountValue *p;
 +
 +        SCM p_scm = SCM_CAR(list);
 +        if (scm_is_false(p_scm) || scm_is_null(p_scm))
 +           p = NULL;
 +        else
 +           p = gnc_scm_to_account_value_ptr(p_scm);
 +
 +        c_list = g_list_prepend(c_list, p);
 +        list = SCM_CDR(list);
 +  }
 +
 +  $1 = g_list_reverse(c_list);
 +}
 +%typemap(out) AccountValueList * {
 +  SCM list = SCM_EOL;
 +  GList *node;
 +
 +  for (node = $1; node; node = node->next)
 +    list = scm_cons(gnc_account_value_ptr_to_scm(node->data), list);
 +
 +  $result = scm_reverse(list);
 +}
 +#endif
 +
 +
 +/* Parse the header files to generate wrappers */
 +%include <gncAddress.h>
 +%include <gncBillTerm.h>
 +%include <gncBusiness.h>
 +%include <gncCustomer.h>
 +%include <gncEmployee.h>
 +%include <gncEntry.h>
 +%include <gncInvoice.h>
 +%include <gncJob.h>
 +%include <gncOrder.h>
 +%include <gncOwner.h>
 +%include <gncTaxTable.h>
 +%include <gncVendor.h>
 +#if defined(SWIGGUILE)
 +%include <gncBusGuile.h>
 +#endif
 +/* Import query bindings for the below invoice query functions (but
 + * don't generate bindings for them). */
 +%import <qofquery.h>
 +
 +#define URL_TYPE_CUSTOMER GNC_ID_CUSTOMER
 +#define URL_TYPE_VENDOR GNC_ID_VENDOR
 +#define URL_TYPE_EMPLOYEE GNC_ID_EMPLOYEE
 +#define URL_TYPE_JOB GNC_ID_JOB
 +#define URL_TYPE_INVOICE GNC_ID_INVOICE
 +// not exactly clean
 +#define URL_TYPE_OWNERREPORT "owner-report"
 +
 +%inline %{
 +static QofQuery * qof_query_create_for_invoices(void) {
 +  return qof_query_create_for(GNC_ID_INVOICE);
 +}
 +
 +static GncInvoiceList * qof_query_run_for_invoices(QofQuery *q) {
 +    return qof_query_run(q);
 +}
 +%}
 +
 +#if defined(SWIGGUILE)
 +%init {
 +  {
 +    char tmp[100];
 +
 +#define SET_ENUM(e) snprintf(tmp, 100, "(set! %s (%s))", (e), (e));  \
 +    scm_c_eval_string(tmp);
 +
 +    SET_ENUM("GNC-OWNER-CUSTOMER");
 +    SET_ENUM("GNC-OWNER-VENDOR");
 +    SET_ENUM("GNC-OWNER-EMPLOYEE");
 +    SET_ENUM("GNC-OWNER-JOB");
 +    SET_ENUM("GNC-AMT-TYPE-VALUE");
 +    SET_ENUM("GNC-AMT-TYPE-PERCENT");
 +
 +    SET_ENUM("URL-TYPE-CUSTOMER");
 +    SET_ENUM("URL-TYPE-VENDOR");
 +    SET_ENUM("URL-TYPE-EMPLOYEE");
 +    SET_ENUM("URL-TYPE-JOB");
 +    SET_ENUM("URL-TYPE-INVOICE");
 +    SET_ENUM("URL-TYPE-OWNERREPORT");
 +
 +    SET_ENUM("INVOICE-FROM-TXN");
 +    SET_ENUM("INVOICE-FROM-LOT");
 +    SET_ENUM("INVOICE-OWNER");
 +    SET_ENUM("INVOICE-BILLTO");
 +    SET_ENUM("OWNER-PARENTG");
 +    SET_ENUM("OWNER-FROM-LOT");
 +
 +    SET_ENUM("GNC-INVOICE-UNDEFINED");
 +    SET_ENUM("GNC-INVOICE-CUST-INVOICE");
 +    SET_ENUM("GNC-INVOICE-VEND-INVOICE");
 +    SET_ENUM("GNC-INVOICE-EMPL-INVOICE");
 +    SET_ENUM("GNC-INVOICE-CUST-CREDIT-NOTE");
 +    SET_ENUM("GNC-INVOICE-VEND-CREDIT-NOTE");
 +    SET_ENUM("GNC-INVOICE-EMPL-CREDIT-NOTE");
 +
 +#undef SET_ENUM
 +  }
 +
 +}
 +#endif
diff --cc libgnucash/engine/gncTaxTable.c
index 636c13e,0000000..148a4c0
mode 100644,000000..100644
--- a/libgnucash/engine/gncTaxTable.c
+++ b/libgnucash/engine/gncTaxTable.c
@@@ -1,1045 -1,0 +1,1045 @@@
 +/********************************************************************\
 + * gncTaxTable.c -- the Gnucash Tax Table interface                 *
 + *                                                                  *
 + * This program is free software; you can redistribute it and/or    *
 + * modify it under the terms of the GNU General Public License as   *
 + * published by the Free Software Foundation; either version 2 of   *
 + * the License, or (at your option) any later version.              *
 + *                                                                  *
 + * This program is distributed in the hope that it will be useful,  *
 + * but WITHOUT ANY WARRANTY; without even the implied warranty of   *
 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the    *
 + * GNU General Public License for more details.                     *
 + *                                                                  *
 + * You should have received a copy of the GNU General Public License*
 + * along with this program; if not, contact:                        *
 + *                                                                  *
 + * Free Software Foundation           Voice:  +1-617-542-5942       *
 + * 51 Franklin Street, Fifth Floor    Fax:    +1-617-542-2652       *
 + * Boston, MA  02110-1301,  USA       gnu at gnu.org                   *
 + *                                                                  *
 +\********************************************************************/
 +
 +/*
 + * Copyright (C) 2002 Derek Atkins
 + * Copyright (C) 2003 Linas Vepstas <linas at linas.org>
 + * Author: Derek Atkins <warlord at MIT.EDU>
 + */
 +
 +#include <config.h>
 +
 +#include <glib.h>
 +#include <qofinstance-p.h>
 +
 +#include "gnc-features.h"
 +#include "gncTaxTableP.h"
 +
 +struct _gncTaxTable
 +{
 +    QofInstance     inst;
 +    char *          name;
 +    GncTaxTableEntryList*  entries;
 +    Timespec        modtime;      /* internal date of last modtime */
 +
 +    /* See src/doc/business.txt for an explanation of the following */
 +    /* Code that handles this is *identical* to that in gncBillTerm */
 +    gint64          refcount;
 +    GncTaxTable *   parent;       /* if non-null, we are an immutable child */
 +    GncTaxTable *   child;        /* if non-null, we have not changed */
 +    gboolean        invisible;
 +    GList *         children;     /* list of children for disconnection */
 +};
 +
 +struct _gncTaxTableClass
 +{
 +    QofInstanceClass parent_class;
 +};
 +
 +struct _gncTaxTableEntry
 +{
 +    GncTaxTable *   table;
 +    Account *       account;
 +    GncAmountType   type;
 +    gnc_numeric     amount;
 +};
 +
 +struct _book_info
 +{
 +    GList *         tables;          /* visible tables */
 +};
 +
 +static QofLogModule log_module = GNC_MOD_BUSINESS;
 +
 +/* =============================================================== */
 +/* You must edit the functions in this block in tandem.  KEEP THEM IN
 +   SYNC! */
 +
 +#define GNC_RETURN_ENUM_AS_STRING(x,s) case (x): return (s);
 +const char *
 +gncAmountTypeToString (GncAmountType type)
 +{
 +    switch (type)
 +    {
 +        GNC_RETURN_ENUM_AS_STRING(GNC_AMT_TYPE_VALUE, "VALUE");
 +        GNC_RETURN_ENUM_AS_STRING(GNC_AMT_TYPE_PERCENT, "PERCENT");
 +    default:
 +        g_warning ("asked to translate unknown amount type %d.\n", type);
 +        break;
 +    }
 +    return(NULL);
 +}
 +
 +const char *
 +gncTaxIncludedTypeToString (GncTaxIncluded type)
 +{
 +    switch (type)
 +    {
 +        GNC_RETURN_ENUM_AS_STRING(GNC_TAXINCLUDED_YES, "YES");
 +        GNC_RETURN_ENUM_AS_STRING(GNC_TAXINCLUDED_NO, "NO");
 +        GNC_RETURN_ENUM_AS_STRING(GNC_TAXINCLUDED_USEGLOBAL, "USEGLOBAL");
 +    default:
 +        g_warning ("asked to translate unknown taxincluded type %d.\n", type);
 +        break;
 +    }
 +    return(NULL);
 +}
 +#undef GNC_RETURN_ENUM_AS_STRING
 +#define GNC_RETURN_ON_MATCH(s,x) \
 +  if(g_strcmp0((s), (str)) == 0) { *type = x; return(TRUE); }
 +gboolean
 +gncAmountStringToType (const char *str, GncAmountType *type)
 +{
 +    GNC_RETURN_ON_MATCH ("VALUE", GNC_AMT_TYPE_VALUE);
 +    GNC_RETURN_ON_MATCH ("PERCENT", GNC_AMT_TYPE_PERCENT);
 +    g_warning ("asked to translate unknown amount type string %s.\n",
 +               str ? str : "(null)");
 +
 +    return(FALSE);
 +}
 +
 +gboolean
 +gncTaxIncludedStringToType (const char *str, GncTaxIncluded *type)
 +{
 +    GNC_RETURN_ON_MATCH ("YES", GNC_TAXINCLUDED_YES);
 +    GNC_RETURN_ON_MATCH ("NO", GNC_TAXINCLUDED_NO);
 +    GNC_RETURN_ON_MATCH ("USEGLOBAL", GNC_TAXINCLUDED_USEGLOBAL);
 +    g_warning ("asked to translate unknown taxincluded type string %s.\n",
 +               str ? str : "(null)");
 +
 +    return(FALSE);
 +}
 +#undef GNC_RETURN_ON_MATCH
 +
 +/* =============================================================== */
 +/* Misc inline functions */
 +
 +#define _GNC_MOD_NAME        GNC_ID_TAXTABLE
 +
 +#define SET_STR(obj, member, str) { \
 +        char * tmp; \
 +        \
 +        if (!g_strcmp0 (member, str)) return; \
 +        gncTaxTableBeginEdit (obj); \
 +        tmp = CACHE_INSERT (str); \
 +        CACHE_REMOVE (member); \
 +        member = tmp; \
 +        }
 +
 +static inline void
 +mark_table (GncTaxTable *table)
 +{
 +    qof_instance_set_dirty(&table->inst);
 +    qof_event_gen (&table->inst, QOF_EVENT_MODIFY, NULL);
 +}
 +
 +static inline void
 +maybe_resort_list (GncTaxTable *table)
 +{
 +    struct _book_info *bi;
 +
 +    if (table->parent || table->invisible) return;
 +    bi = qof_book_get_data (qof_instance_get_book(table), _GNC_MOD_NAME);
 +    bi->tables = g_list_sort (bi->tables, (GCompareFunc)gncTaxTableCompare);
 +}
 +
 +static inline void
 +mod_table (GncTaxTable *table)
 +{
 +    timespecFromTime64 (&table->modtime, gnc_time (NULL));
 +}
 +
 +static inline void addObj (GncTaxTable *table)
 +{
 +    struct _book_info *bi;
 +    bi = qof_book_get_data (qof_instance_get_book(table), _GNC_MOD_NAME);
 +    bi->tables = g_list_insert_sorted (bi->tables, table,
 +                                       (GCompareFunc)gncTaxTableCompare);
 +}
 +
 +static inline void remObj (GncTaxTable *table)
 +{
 +    struct _book_info *bi;
 +    bi = qof_book_get_data (qof_instance_get_book(table), _GNC_MOD_NAME);
 +    bi->tables = g_list_remove (bi->tables, table);
 +}
 +
 +static inline void
 +gncTaxTableAddChild (GncTaxTable *table, GncTaxTable *child)
 +{
 +    g_return_if_fail(table);
 +    g_return_if_fail(child);
 +    g_return_if_fail(qof_instance_get_destroying(table) == FALSE);
 +
 +    table->children = g_list_prepend(table->children, child);
 +}
 +
 +static inline void
 +gncTaxTableRemoveChild (GncTaxTable *table, const GncTaxTable *child)
 +{
 +    g_return_if_fail(table);
 +    g_return_if_fail(child);
 +
 +    if (qof_instance_get_destroying(table)) return;
 +
 +    table->children = g_list_remove(table->children, child);
 +}
 +
 +/* =============================================================== */
 +
 +enum
 +{
 +    PROP_0,
 +    PROP_NAME,		/* Table */
 +    PROP_INVISIBLE,	/* Table */
 +    PROP_REFCOUNT,	/* Table */
 +//  PROP_PARENT,	/* Table */
 +};
 +
 +/* GObject Initialization */
 +G_DEFINE_TYPE(GncTaxTable, gnc_taxtable, QOF_TYPE_INSTANCE);
 +
 +static void
 +gnc_taxtable_init(GncTaxTable* tt)
 +{
 +}
 +
 +static void
 +gnc_taxtable_dispose(GObject *ttp)
 +{
 +    G_OBJECT_CLASS(gnc_taxtable_parent_class)->dispose(ttp);
 +}
 +
 +static void
 +gnc_taxtable_finalize(GObject* ttp)
 +{
 +    G_OBJECT_CLASS(gnc_taxtable_parent_class)->dispose(ttp);
 +}
 +
 +static void
 +gnc_taxtable_get_property (GObject         *object,
 +                           guint            prop_id,
 +                           GValue          *value,
 +                           GParamSpec      *pspec)
 +{
 +    GncTaxTable *tt;
 +
 +    g_return_if_fail(GNC_IS_TAXTABLE(object));
 +
 +    tt = GNC_TAXTABLE(object);
 +    switch (prop_id)
 +    {
 +    case PROP_NAME:
 +        g_value_set_string(value, tt->name);
 +        break;
 +    case PROP_INVISIBLE:
 +        g_value_set_boolean(value, tt->invisible);
 +        break;
 +    case PROP_REFCOUNT:
 +        g_value_set_uint64(value, tt->refcount);
 +        break;
 +    default:
 +        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
 +        break;
 +    }
 +}
 +
 +static void
 +gnc_taxtable_set_property (GObject         *object,
 +                           guint            prop_id,
 +                           const GValue          *value,
 +                           GParamSpec      *pspec)
 +{
 +    GncTaxTable *tt;
 +
 +    g_return_if_fail(GNC_IS_TAXTABLE(object));
 +
 +    tt = GNC_TAXTABLE(object);
 +    g_assert (qof_instance_get_editlevel(tt));
 +
 +    switch (prop_id)
 +    {
 +    case PROP_NAME:
 +        gncTaxTableSetName(tt, g_value_get_string(value));
 +        break;
 +    case PROP_INVISIBLE:
 +        if (g_value_get_boolean(value))
 +        {
 +            gncTaxTableMakeInvisible(tt);
 +        }
 +        break;
 +    case PROP_REFCOUNT:
 +        gncTaxTableSetRefcount(tt, g_value_get_uint64(value));
 +        break;
 +    default:
 +        G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
 +        break;
 +    }
 +}
 +
 +/** Return displayable name */
 +static gchar*
 +impl_get_display_name(const QofInstance* inst)
 +{
 +    GncTaxTable* tt;
 +
 +    g_return_val_if_fail(inst != NULL, FALSE);
 +    g_return_val_if_fail(GNC_IS_TAXTABLE(inst), FALSE);
 +
 +    tt = GNC_TAXTABLE(inst);
 +    return g_strdup_printf("Tax table %s", tt->name);
 +}
 +
 +/** Does this object refer to a specific object */
 +static gboolean
 +impl_refers_to_object(const QofInstance* inst, const QofInstance* ref)
 +{
 +    GncTaxTable* tt;
 +
 +    g_return_val_if_fail(inst != NULL, FALSE);
 +    g_return_val_if_fail(GNC_IS_TAXTABLE(inst), FALSE);
 +
 +    tt = GNC_TAXTABLE(inst);
 +
 +    if (GNC_IS_ACCOUNT(ref))
 +    {
 +        GList* node;
 +
 +        for (node = tt->entries; node != NULL; node = node->next)
 +        {
 +            GncTaxTableEntry* tte = node->data;
 +
 +            if (tte->account == GNC_ACCOUNT(ref))
 +            {
 +                return TRUE;
 +            }
 +        }
 +    }
 +
 +    return FALSE;
 +}
 +
 +/** Returns a list of my type of object which refers to an object.  For example, when called as
 +        qof_instance_get_typed_referring_object_list(taxtable, account);
 +    it will return the list of taxtables which refer to a specific account.  The result should be the
 +    same regardless of which taxtable object is used.  The list must be freed by the caller but the
 +    objects on the list must not.
 + */
 +static GList*
 +impl_get_typed_referring_object_list(const QofInstance* inst, const QofInstance* ref)
 +{
 +    if (!GNC_IS_ACCOUNT(ref))
 +    {
 +        return NULL;
 +    }
 +
 +    return qof_instance_get_referring_object_list_from_collection(qof_instance_get_collection(inst), ref);
 +}
 +
 +static void
 +gnc_taxtable_class_init (GncTaxTableClass *klass)
 +{
 +    GObjectClass *gobject_class = G_OBJECT_CLASS (klass);
 +    QofInstanceClass* qof_class = QOF_INSTANCE_CLASS(klass);
 +
 +    gobject_class->dispose = gnc_taxtable_dispose;
 +    gobject_class->finalize = gnc_taxtable_finalize;
 +    gobject_class->set_property = gnc_taxtable_set_property;
 +    gobject_class->get_property = gnc_taxtable_get_property;
 +
 +    qof_class->get_display_name = impl_get_display_name;
 +    qof_class->refers_to_object = impl_refers_to_object;
 +    qof_class->get_typed_referring_object_list = impl_get_typed_referring_object_list;
 +
 +    g_object_class_install_property
 +    (gobject_class,
 +     PROP_NAME,
 +     g_param_spec_string ("name",
 +                          "TaxTable Name",
 +                          "The accountName is an arbitrary string "
 +                          "assigned by the user.  It is intended to "
 +                          "a short, 10 to 30 character long string "
 +                          "that is displayed by the GUI as the "
 +                          "tax table mnemonic.",
 +                          NULL,
 +                          G_PARAM_READWRITE));
 +
 +    g_object_class_install_property
 +    (gobject_class,
 +     PROP_INVISIBLE,
 +     g_param_spec_boolean ("invisible",
 +                           "Invisible",
 +                           "TRUE if the tax table is invisible.  FALSE if visible.",
 +                           FALSE,
 +                           G_PARAM_READWRITE));
 +
 +    g_object_class_install_property
 +    (gobject_class,
 +     PROP_REFCOUNT,
 +     g_param_spec_uint64("ref-count",
 +                         "Reference count",
 +                         "The ref-count property contains number of times this tax table "
 +                         "is referenced.",
 +                         0,           /* min */
 +                         G_MAXUINT64, /* max */
 +                         0,           /* default */
 +                         G_PARAM_READWRITE));
 +}
 +
 +/* Create/Destroy Functions */
 +GncTaxTable *
 +gncTaxTableCreate (QofBook *book)
 +{
 +    GncTaxTable *table;
 +    if (!book) return NULL;
 +
 +    table = g_object_new (GNC_TYPE_TAXTABLE, NULL);
 +    qof_instance_init_data (&table->inst, _GNC_MOD_NAME, book);
 +    table->name = CACHE_INSERT ("");
 +    addObj (table);
 +    qof_event_gen (&table->inst, QOF_EVENT_CREATE, NULL);
 +    return table;
 +}
 +
 +void
 +gncTaxTableDestroy (GncTaxTable *table)
 +{
 +    if (!table) return;
 +    qof_instance_set_destroying(table, TRUE);
 +    qof_instance_set_dirty (&table->inst);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +static void
 +gncTaxTableFree (GncTaxTable *table)
 +{
 +    GList *list;
 +    GncTaxTable *child;
 +
 +    if (!table) return;
 +
 +    qof_event_gen (&table->inst, QOF_EVENT_DESTROY, NULL);
 +    CACHE_REMOVE (table->name);
 +    remObj (table);
 +
 +    /* destroy the list of entries */
 +    for (list = table->entries; list; list = list->next)
 +        gncTaxTableEntryDestroy (list->data);
 +    g_list_free (table->entries);
 +
 +    if (!qof_instance_get_destroying(table))
 +        PERR("free a taxtable without do_free set!");
 +
 +    /* disconnect from parent */
 +    if (table->parent)
 +        gncTaxTableRemoveChild(table->parent, table);
 +
 +    /* disconnect from the children */
 +    for (list = table->children; list; list = list->next)
 +    {
 +        child = list->data;
 +        gncTaxTableSetParent(child, NULL);
 +    }
 +    g_list_free(table->children);
 +
 +    /* qof_instance_release (&table->inst); */
 +    g_object_unref (table);
 +}
 +
 +/* =============================================================== */
 +
 +GncTaxTableEntry * gncTaxTableEntryCreate (void)
 +{
 +    GncTaxTableEntry *entry;
 +    entry = g_new0 (GncTaxTableEntry, 1);
 +    entry->amount = gnc_numeric_zero ();
 +    return entry;
 +}
 +
 +void gncTaxTableEntryDestroy (GncTaxTableEntry *entry)
 +{
 +    if (!entry) return;
 +    g_free (entry);
 +}
 +
 +/* =============================================================== */
 +/* Set Functions */
 +
 +void gncTaxTableSetName (GncTaxTable *table, const char *name)
 +{
 +    if (!table || !name) return;
 +    SET_STR (table, table->name, name);
 +    mark_table (table);
 +    maybe_resort_list (table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableSetParent (GncTaxTable *table, GncTaxTable *parent)
 +{
 +    if (!table) return;
 +    gncTaxTableBeginEdit (table);
 +    if (table->parent)
 +        gncTaxTableRemoveChild(table->parent, table);
 +    table->parent = parent;
 +    if (parent)
 +        gncTaxTableAddChild(parent, table);
 +    table->refcount = 0;
 +    gncTaxTableMakeInvisible (table);
 +    mark_table (table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableSetChild (GncTaxTable *table, GncTaxTable *child)
 +{
 +    if (!table) return;
 +    gncTaxTableBeginEdit (table);
 +    table->child = child;
 +    mark_table (table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableIncRef (GncTaxTable *table)
 +{
 +    if (!table) return;
 +    if (table->parent || table->invisible) return;        /* children dont need refcounts */
 +    gncTaxTableBeginEdit (table);
 +    table->refcount++;
 +    mark_table (table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableDecRef (GncTaxTable *table)
 +{
 +    if (!table) return;
 +    if (table->parent || table->invisible) return;        /* children dont need refcounts */
 +    g_return_if_fail (table->refcount > 0);
 +    gncTaxTableBeginEdit (table);
 +    table->refcount--;
 +    mark_table (table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableSetRefcount (GncTaxTable *table, gint64 refcount)
 +{
 +    if (!table) return;
 +    g_return_if_fail (refcount >= 0);
 +    gncTaxTableBeginEdit (table);
 +    table->refcount = refcount;
 +    mark_table (table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableMakeInvisible (GncTaxTable *table)
 +{
 +    struct _book_info *bi;
 +    if (!table) return;
 +    gncTaxTableBeginEdit (table);
 +    table->invisible = TRUE;
 +    bi = qof_book_get_data (qof_instance_get_book(table), _GNC_MOD_NAME);
 +    bi->tables = g_list_remove (bi->tables, table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableEntrySetAccount (GncTaxTableEntry *entry, Account *account)
 +{
 +    if (!entry || !account) return;
 +    if (entry->account == account) return;
 +    entry->account = account;
 +    if (entry->table)
 +    {
 +        mark_table (entry->table);
 +        mod_table (entry->table);
 +    }
 +}
 +
 +void gncTaxTableEntrySetType (GncTaxTableEntry *entry, GncAmountType type)
 +{
 +    if (!entry) return;
 +    if (entry->type == type) return;
 +    entry->type = type;
 +    if (entry->table)
 +    {
 +        mark_table (entry->table);
 +        mod_table (entry->table);
 +    }
 +}
 +
 +void gncTaxTableEntrySetAmount (GncTaxTableEntry *entry, gnc_numeric amount)
 +{
 +    if (!entry) return;
 +    if (gnc_numeric_eq (entry->amount, amount)) return;
 +    entry->amount = amount;
 +    if (entry->table)
 +    {
 +        mark_table (entry->table);
 +        mod_table (entry->table);
 +    }
 +}
 +
 +void gncTaxTableAddEntry (GncTaxTable *table, GncTaxTableEntry *entry)
 +{
 +    if (!table || !entry) return;
 +    if (entry->table == table) return; /* already mine */
 +
 +    gncTaxTableBeginEdit (table);
 +    if (entry->table)
 +        gncTaxTableRemoveEntry (entry->table, entry);
 +
 +    entry->table = table;
 +    table->entries = g_list_insert_sorted (table->entries, entry,
 +                                           (GCompareFunc)gncTaxTableEntryCompare);
 +    mark_table (table);
 +    mod_table (table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableRemoveEntry (GncTaxTable *table, GncTaxTableEntry *entry)
 +{
 +    if (!table || !entry) return;
 +    gncTaxTableBeginEdit (table);
 +    entry->table = NULL;
 +    table->entries = g_list_remove (table->entries, entry);
 +    mark_table (table);
 +    mod_table (table);
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +void gncTaxTableChanged (GncTaxTable *table)
 +{
 +    if (!table) return;
 +    gncTaxTableBeginEdit (table);
 +    table->child = NULL;
 +    gncTaxTableCommitEdit (table);
 +}
 +
 +/* =============================================================== */
 +
 +void gncTaxTableBeginEdit (GncTaxTable *table)
 +{
 +    qof_begin_edit(&table->inst);
 +}
 +
 +static void gncTaxTableOnError (QofInstance *inst, QofBackendError errcode)
 +{
 +    PERR("TaxTable QofBackend Failure: %d", errcode);
 +    gnc_engine_signal_commit_error( errcode );
 +}
 +
 +static void gncTaxTableOnDone (QofInstance *inst) {}
 +
 +static void table_free (QofInstance *inst)
 +{
 +    GncTaxTable *table = (GncTaxTable *) inst;
 +    gncTaxTableFree (table);
 +}
 +
 +void gncTaxTableCommitEdit (GncTaxTable *table)
 +{
 +    /* GnuCash 2.6.3 and earlier didn't handle taxtable kvp's... */
 +     if (qof_instance_has_kvp (QOF_INSTANCE (table)))
 +          gnc_features_set_used (qof_instance_get_book (QOF_INSTANCE (table)),
 +                                 GNC_FEATURE_KVP_EXTRA_DATA);
 +
 +    if (!qof_commit_edit (QOF_INSTANCE(table))) return;
 +    qof_commit_edit_part2 (&table->inst, gncTaxTableOnError,
 +                           gncTaxTableOnDone, table_free);
 +}
 +
 +
 +/* =============================================================== */
 +/* Get Functions */
 +
 +GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name)
 +{
 +    GList *list = gncTaxTableGetTables (book);
 +
 +    for ( ; list; list = list->next)
 +    {
 +        GncTaxTable *table = list->data;
 +        if (!g_strcmp0 (table->name, name))
 +            return list->data;
 +    }
 +    return NULL;
 +}
 +
- GList * gncTaxTableGetTables (QofBook *book)
++GncTaxTableList * gncTaxTableGetTables (QofBook *book)
 +{
 +    struct _book_info *bi;
 +    if (!book) return NULL;
 +
 +    bi = qof_book_get_data (book, _GNC_MOD_NAME);
 +    return bi->tables;
 +}
 +
 +const char *gncTaxTableGetName (const GncTaxTable *table)
 +{
 +    if (!table) return NULL;
 +    return table->name;
 +}
 +
 +static GncTaxTableEntry *gncTaxTableEntryCopy (const GncTaxTableEntry *entry)
 +{
 +    GncTaxTableEntry *e;
 +    if (!entry) return NULL;
 +
 +    e = gncTaxTableEntryCreate ();
 +    gncTaxTableEntrySetAccount (e, entry->account);
 +    gncTaxTableEntrySetType (e, entry->type);
 +    gncTaxTableEntrySetAmount (e, entry->amount);
 +
 +    return e;
 +}
 +
 +static GncTaxTable *gncTaxTableCopy (const GncTaxTable *table)
 +{
 +    GncTaxTable *t;
 +    GList *list;
 +
 +    if (!table) return NULL;
 +    t = gncTaxTableCreate (qof_instance_get_book(table));
 +    gncTaxTableSetName (t, table->name);
 +    for (list = table->entries; list; list = list->next)
 +    {
 +        GncTaxTableEntry *entry, *e;
 +        entry = list->data;
 +        e = gncTaxTableEntryCopy (entry);
 +        gncTaxTableAddEntry (t, e);
 +    }
 +    return t;
 +}
 +
 +GncTaxTable *gncTaxTableReturnChild (GncTaxTable *table, gboolean make_new)
 +{
 +    GncTaxTable *child = NULL;
 +
 +    if (!table) return NULL;
 +    if (table->child) return table->child;
 +    if (table->parent || table->invisible) return table;
 +    if (make_new)
 +    {
 +        child = gncTaxTableCopy (table);
 +        gncTaxTableSetChild (table, child);
 +        gncTaxTableSetParent (child, table);
 +    }
 +    return child;
 +}
 +
 +GncTaxTable *gncTaxTableGetParent (const GncTaxTable *table)
 +{
 +    if (!table) return NULL;
 +    return table->parent;
 +}
 +
 +GncTaxTableEntryList* gncTaxTableGetEntries (const GncTaxTable *table)
 +{
 +    if (!table) return NULL;
 +    return table->entries;
 +}
 +
 +gint64 gncTaxTableGetRefcount (const GncTaxTable *table)
 +{
 +    if (!table) return 0;
 +    return table->refcount;
 +}
 +
 +Timespec gncTaxTableLastModified (const GncTaxTable *table)
 +{
 +    Timespec ts = { 0 , 0 };
 +    if (!table) return ts;
 +    return table->modtime;
 +}
 +
 +gboolean gncTaxTableGetInvisible (const GncTaxTable *table)
 +{
 +    if (!table) return FALSE;
 +    return table->invisible;
 +}
 +
 +Account * gncTaxTableEntryGetAccount (const GncTaxTableEntry *entry)
 +{
 +    if (!entry) return NULL;
 +    return entry->account;
 +}
 +
 +GncAmountType gncTaxTableEntryGetType (const GncTaxTableEntry *entry)
 +{
 +    if (!entry) return 0;
 +    return entry->type;
 +}
 +
 +gnc_numeric gncTaxTableEntryGetAmount (const GncTaxTableEntry *entry)
 +{
 +    if (!entry) return gnc_numeric_zero();
 +    return entry->amount;
 +}
 +
 +/* This is a semi-private function (meaning that it's not declared in
 + * the header) used for SQL Backend testing. */
 +GncTaxTable* gncTaxTableEntryGetTable( const GncTaxTableEntry* entry )
 +{
 +    if (!entry) return NULL;
 +    return entry->table;
 +}
 +
 +int gncTaxTableEntryCompare (const GncTaxTableEntry *a, const GncTaxTableEntry *b)
 +{
 +    char *name_a, *name_b;
 +    int retval;
 +
 +    if (!a && !b) return 0;
 +    if (!a) return -1;
 +    if (!b) return 1;
 +
 +    name_a = gnc_account_get_full_name (a->account);
 +    name_b = gnc_account_get_full_name (b->account);
 +    retval = g_strcmp0(name_a, name_b);
 +    g_free(name_a);
 +    g_free(name_b);
 +
 +    if (retval)
 +        return retval;
 +
 +    return gnc_numeric_compare (a->amount, b->amount);
 +}
 +
 +int gncTaxTableCompare (const GncTaxTable *a, const GncTaxTable *b)
 +{
 +    if (!a && !b) return 0;
 +    if (!a) return -1;
 +    if (!b) return 1;
 +    return g_strcmp0 (a->name, b->name);
 +}
 +
 +gboolean gncTaxTableEntryEqual(const GncTaxTableEntry *a, const GncTaxTableEntry *b)
 +{
 +    if (a == NULL && b == NULL) return TRUE;
 +    if (a == NULL || b == NULL) return FALSE;
 +
 +    if (!xaccAccountEqual(a->account, b->account, TRUE))
 +    {
 +        PWARN("accounts differ");
 +        return FALSE;
 +    }
 +
 +    if (a->type != b->type)
 +    {
 +        PWARN("types differ");
 +        return FALSE;
 +    }
 +
 +    if (!gnc_numeric_equal(a->amount, b->amount))
 +    {
 +        PWARN("amounts differ");
 +        return FALSE;
 +    }
 +
 +    return TRUE;
 +}
 +
 +gboolean gncTaxTableEqual(const GncTaxTable *a, const GncTaxTable *b)
 +{
 +    if (a == NULL && b == NULL) return TRUE;
 +    if (a == NULL || b == NULL) return FALSE;
 +
 +    g_return_val_if_fail(GNC_IS_TAXTABLE(a), FALSE);
 +    g_return_val_if_fail(GNC_IS_TAXTABLE(b), FALSE);
 +
 +    if (g_strcmp0(a->name, b->name) != 0)
 +    {
 +        PWARN("Names differ: %s vs %s", a->name, b->name);
 +        return FALSE;
 +    }
 +
 +    if (a->invisible != b->invisible)
 +    {
 +        PWARN("invisible flags differ");
 +        return FALSE;
 +    }
 +
 +    if ((a->entries != NULL) != (b->entries != NULL))
 +    {
 +        PWARN("only one has entries");
 +        return FALSE;
 +    }
 +
 +    if (a->entries != NULL && b->entries != NULL)
 +    {
 +        GncTaxTableEntryList* a_node;
 +        GncTaxTableEntryList* b_node;
 +
 +        for (a_node = a->entries, b_node = b->entries;
 +                a_node != NULL && b_node != NULL;
 +                a_node = a_node->next, b_node = b_node->next)
 +        {
 +            if (!gncTaxTableEntryEqual((GncTaxTableEntry*)a_node->data,
 +                                       (GncTaxTableEntry*)b_node->data))
 +            {
 +                PWARN("entries differ");
 +                return FALSE;
 +            }
 +        }
 +
 +        if (a_node != NULL || b_node != NULL)
 +        {
 +            PWARN("Unequal number of entries");
 +            return FALSE;
 +        }
 +    }
 +
 +#if 0
 +    /* See src/doc/business.txt for an explanation of the following */
 +    /* Code that handles this is *identical* to that in gncBillTerm */
 +    gint64          refcount;
 +    GncTaxTable *   parent;       /* if non-null, we are an immutable child */
 +    GncTaxTable *   child;        /* if non-null, we have not changed */
 +    GList *         children;     /* list of children for disconnection */
 +#endif
 +
 +    return TRUE;
 +}
 +
 +/*
 + * This will add value to the account-value for acc, creating a new
 + * list object if necessary
 + */
 +GList *gncAccountValueAdd (GList *list, Account *acc, gnc_numeric value)
 +{
 +    GList *li;
 +    GncAccountValue *res = NULL;
 +
 +    g_return_val_if_fail (acc, list);
 +    g_return_val_if_fail (gnc_numeric_check (value) == GNC_ERROR_OK, list);
 +
 +    /* Try to find the account in the list */
 +    for (li = list; li; li = li->next)
 +    {
 +        res = li->data;
 +        if (res->account == acc)
 +        {
 +            res->value = gnc_numeric_add (res->value, value, GNC_DENOM_AUTO,
 +                                          GNC_HOW_DENOM_LCD);
 +            return list;
 +        }
 +    }
 +    /* Nope, didn't find it. */
 +
 +    res = g_new0 (GncAccountValue, 1);
 +    res->account = acc;
 +    res->value = value;
 +    return g_list_prepend (list, res);
 +}
 +
 +/* Merge l2 into l1.  l2 is not touched. */
 +GList *gncAccountValueAddList (GList *l1, GList *l2)
 +{
 +    GList *li;
 +
 +    for (li = l2; li; li = li->next )
 +    {
 +        GncAccountValue *val = li->data;
 +        l1 = gncAccountValueAdd (l1, val->account, val->value);
 +    }
 +
 +    return l1;
 +}
 +
 +/* return the total for this list */
 +gnc_numeric gncAccountValueTotal (GList *list)
 +{
 +    gnc_numeric total = gnc_numeric_zero ();
 +
 +    for ( ; list ; list = list->next)
 +    {
 +        GncAccountValue *val = list->data;
 +        total = gnc_numeric_add (total, val->value, GNC_DENOM_AUTO, GNC_HOW_DENOM_LCD);
 +    }
 +    return total;
 +}
 +
 +/* Destroy a list of accountvalues */
 +void gncAccountValueDestroy (GList *list)
 +{
 +    GList *node;
 +    for ( node = list; node ; node = node->next)
 +        g_free (node->data);
 +
 +    g_list_free (list);
 +}
 +
 +/* Package-Private functions */
 +
 +static void _gncTaxTableCreate (QofBook *book)
 +{
 +    struct _book_info *bi;
 +
 +    if (!book) return;
 +
 +    bi = g_new0 (struct _book_info, 1);
 +    qof_book_set_data (book, _GNC_MOD_NAME, bi);
 +}
 +
 +static void _gncTaxTableDestroy (QofBook *book)
 +{
 +    struct _book_info *bi;
 +
 +    if (!book) return;
 +
 +    bi = qof_book_get_data (book, _GNC_MOD_NAME);
 +
 +    g_list_free (bi->tables);
 +    g_free (bi);
 +}
 +
 +static QofObject gncTaxTableDesc =
 +{
 +    DI(.interface_version = ) QOF_OBJECT_VERSION,
 +    DI(.e_type            = ) _GNC_MOD_NAME,
 +    DI(.type_label        = ) "Tax Table",
 +    DI(.create            = ) (gpointer)gncTaxTableCreate,
 +    DI(.book_begin        = ) _gncTaxTableCreate,
 +    DI(.book_end          = ) _gncTaxTableDestroy,
 +    DI(.is_dirty          = ) qof_collection_is_dirty,
 +    DI(.mark_clean        = ) qof_collection_mark_clean,
 +    DI(.foreach           = ) qof_collection_foreach,
 +    DI(.printable         = ) NULL,
 +    DI(.version_cmp       = ) (int (*)(gpointer, gpointer)) qof_instance_version_cmp,
 +};
 +
 +gboolean gncTaxTableRegister (void)
 +{
 +    static QofParam params[] =
 +    {
 +        { GNC_TT_NAME, 		QOF_TYPE_STRING, 	(QofAccessFunc)gncTaxTableGetName, 		(QofSetterFunc)gncTaxTableSetName },
 +        { GNC_TT_REFCOUNT, 	QOF_TYPE_INT64, 	(QofAccessFunc)gncTaxTableGetRefcount, 	(QofSetterFunc)gncTaxTableSetRefcount },
 +        { QOF_PARAM_BOOK, 	QOF_ID_BOOK, 		(QofAccessFunc)qof_instance_get_book, 	NULL },
 +        { QOF_PARAM_GUID, 	QOF_TYPE_GUID, 		(QofAccessFunc)qof_instance_get_guid, 	NULL },
 +        { NULL },
 +    };
 +
 +    qof_class_register (_GNC_MOD_NAME, (QofSortFunc)gncTaxTableCompare, params);
 +
 +    return qof_object_register (&gncTaxTableDesc);
 +}
 +
 +/* need a QOF tax table entry object */
 +//gncTaxTableEntrySetType_q int32
 +//gint gncTaxTableEntryGetType_q (GncTaxTableEntry *entry);

commit 82bd4f69aa6324818fe68659eb8af0cdd353d5e7
Merge: f0f53d9 bbdb715
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 10 18:56:44 2017 +0200

    Merge branch 'fix_cmake_ofx_dep' of https://github.com/bhardwajs/gnucash


commit 600f010472564c2460742f8449b85b120f541be7
Author: christopherlam <christopher.lck at gmail.com>
Date:   Sat Sep 9 15:03:52 2017 +0800

    Fix swig wrapper for gncTaxTableGetTaxTables
    
    - Add new typedef GncTaxTableList
    - Add SWIG wrapper for gncTaxTableGetTables
    - gncTaxTableGetTables to return gncTaxTableList

diff --git a/src/engine/business-core.i b/src/engine/business-core.i
index f1582bc..9b66867 100644
--- a/src/engine/business-core.i
+++ b/src/engine/business-core.i
@@ -74,6 +74,7 @@ static GncEmployee * gncEmployeeLookupFlip(GncGUID g, QofBook *b)
 
 GLIST_HELPER_INOUT(GncInvoiceList, SWIGTYPE_p__gncInvoice);
 GLIST_HELPER_INOUT(EntryList, SWIGTYPE_p__gncEntry);
+GLIST_HELPER_INOUT(GncTaxTableGetTables, SWIGTYPE_p__gncTaxTable);
 GLIST_HELPER_INOUT(GncTaxTableEntryList, SWIGTYPE_p__gncTaxTableEntry);
 GLIST_HELPER_INOUT(OwnerList, SWIGTYPE_p__gncOwner);
 
diff --git a/src/engine/gncTaxTable.c b/src/engine/gncTaxTable.c
index 8650217..830c32c 100644
--- a/src/engine/gncTaxTable.c
+++ b/src/engine/gncTaxTable.c
@@ -676,7 +676,7 @@ GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name)
     return NULL;
 }
 
-GList * gncTaxTableGetTables (QofBook *book)
+GncTaxTableList * gncTaxTableGetTables (QofBook *book)
 {
     struct _book_info *bi;
     if (!book) return NULL;
diff --git a/src/engine/gncTaxTable.h b/src/engine/gncTaxTable.h
index 5e0e1da..7d9579a 100644
--- a/src/engine/gncTaxTable.h
+++ b/src/engine/gncTaxTable.h
@@ -152,7 +152,8 @@ static inline GncTaxTable *gncTaxTableLookup (const QofBook* book, const GncGUID
 
 GncTaxTable *gncTaxTableLookupByName (QofBook *book, const char *name);
 
-GList * gncTaxTableGetTables (QofBook *book);
+typedef GList GncTaxTableList;
+GncTaxTableList  * gncTaxTableGetTables (QofBook *book);
 
 const char *gncTaxTableGetName (const GncTaxTable *table);
 GncTaxTable *gncTaxTableGetParent (const GncTaxTable *table);

commit f0f53d99b7f889d71198c4a7825f41fe671373bd
Merge: f0fe1e9 121dd8c
Author: Geert Janssens <geert at kobaltwit.be>
Date:   Sun Sep 10 18:32:58 2017 +0200

    Merge branch 'trav' of https://github.com/limitedAtonement/gnucash


commit 4250f53faa3c5a03056d892d25ce4a45697441e9
Author: Daniel <daniel.hornung at gmx.de>
Date:   Mon Sep 4 00:56:35 2017 +0200

    L10N: DE, some small corrections.

diff --git a/po/de.po b/po/de.po
index 943fa15..e8a618b 100644
--- a/po/de.po
+++ b/po/de.po
@@ -16,7 +16,7 @@ msgstr ""
 "Project-Id-Version: GnuCash 2.6.15\n"
 "Report-Msgid-Bugs-To: \n"
 "POT-Creation-Date: 2017-09-04 00:02+0200\n"
-"PO-Revision-Date: 2017-09-04 17:10+0200\n"
+"PO-Revision-Date: 2017-09-09 21:33+0200\n"
 "Last-Translator: Mechtilde <ooo at mechtilde.de>\n"
 "Language-Team: GnuCash-de <gnucash-de at gnucash.org>\n"
 "Language: de\n"
@@ -8313,6 +8313,17 @@ msgstr "Standardwährung, die bei neuen Berichten verwendet wird"
 msgid "Zoom factor to use by default for reports."
 msgstr "Vorgabe der Vergrößerung in Berichten."
 
+#: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:112
+#: ../src/gnome-utils/gtkbuilder/dialog-preferences.glade.h:179
+msgid ""
+"On high resolution screens reports tend to be hard to read. This option "
+"allows you to scale reports up by the set factor. For example setting this "
+"to 2.0 will display reports at twice their typical size."
+msgstr ""
+"Auf hochauflösenden Bildschirmen können Berichte schwer zu lesen sein.\n"
+"Diese Option erlaubt das Skalieren der Berichte um den gewählten Faktor.\n"
+"Z.B. wird ein Wert von 2 die Berichte mit dem Doppelten ihrer ursprünglichen Größe darstellen."
+
 #: ../src/gnome/gschemas/org.gnucash.gschema.xml.in.in.h:113
 msgid "PDF export file name format"
 msgstr "PDF-Export Dateinamen-Formatvorlage"
@@ -12121,8 +12132,8 @@ msgstr ""
 "GnuCash: Ihr privater Finanzmanager. Die freie Lösung zur Finanzverwaltung."
 
 #: ../src/gnome-utils/gnc-main-window.c:4372
-msgid "© 1997-2016 Contributors"
-msgstr "© 1997-2016 Mitwirkende"
+msgid "© 1997-2017 Contributors"
+msgstr "© 1997-2017 Mitwirkende"
 
 #. Translators: the following string will be shown in Help->About->Credits
 #. * Enter your name or that of your team and an email contact for feedback.
@@ -22866,7 +22877,7 @@ msgstr ""
 #: ../src/report/standard-reports/advanced-portfolio.scm:97
 msgid "Use last-in first-out method for basis."
 msgstr ""
-"Verwende die First-In First-Out-Zuordnung (zuerst erworbene werden zuerst "
+"Verwende die Last-In First-Out-Zuordnung (zuletzt erworbene werden zuerst "
 "verkauft) zur Ermittlung der Basis."
 
 #: ../src/report/standard-reports/advanced-portfolio.scm:103

commit bbdb7151dd16d24b9ad708cab6f95882c16d8321
Author: Sumit Bhardwaj <bhardwajs at users.noreply.github.com>
Date:   Sat Sep 9 10:13:19 2017 -0700

    Made ofx-gschema dependent on WITH_OFX flag

diff --git a/cmake/CMakeLists.txt b/cmake/CMakeLists.txt
index 5107819..e832570 100644
--- a/cmake/CMakeLists.txt
+++ b/cmake/CMakeLists.txt
@@ -16,12 +16,16 @@ IF (${CMAKE_VERSION} VERSION_GREATER 3.1)
 ENDIF()
 
 SET(schema-targets csv-exp-gschema csv-imp-gschema
-    generic-import-gschema gnome-gschema gnome-utils-gschema ofx-gschema qif-imp-gschema)
+    generic-import-gschema gnome-gschema gnome-utils-gschema qif-imp-gschema)
 
 IF (WITH_AQBANKING)
   LIST(APPEND schema-targets aqb-gschema)
 ENDIF (WITH_AQBANKING)
     
+IF (WITH_OFX)
+  LIST(APPEND schema-targets ofx-gschema)
+ENDIF (WITH_OFX)
+    
 SET(SCHEMA_DIRECTORY ${DATADIR_BUILD}/glib-2.0/schemas)
 ADD_CUSTOM_COMMAND(
   OUTPUT ${SCHEMA_DIRECTORY}/gschemas.compiled

commit 121dd8cf90d359fb14c58d80b96562beaf3c011c
Author: lmat <dartme18 at gmail.com>
Date:   Wed Sep 6 13:23:59 2017 -0400

    Configure travis to use docker for CI
    
    Currently, there is an ubuntu 14.04 and archlinux build and they both
    use cmake with ninja, cmake with make, and autotools to build. It should
    be straightforward to add another configuration.
    
    Travis checks out the correct branch of the source code for us, and we
    expose that source code to the docker container using a docker run
    "volume".

diff --git a/.travis.yml b/.travis.yml
index 64e6636..374ea17 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,26 +1,20 @@
 # Test
 sudo: required
-dist: trusty
-branches:
-  except:
-    - trunk
 language: c++
-compiler:
-  - gcc
-#  - clang
+compiler: gcc
 env:
-  - BUILDTYPE=cmake-make
-  - BUILDTYPE=cmake-ninja
-  - BUILDTYPE=autotools
-before_install:
-#  - sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y
-  - sudo apt-get update -qq
+    - BUILDENV=arch BUILDTYPE=cmake-make
+    - BUILDENV=arch BUILDTYPE=cmake-ninja
+    - BUILDENV=arch BUILDTYPE=autotools
+    - BUILDENV=ubuntu-14.04 BUILDTYPE=cmake-make
+    - BUILDENV=ubuntu-14.04 BUILDTYPE=cmake-ninja
+    - BUILDENV=ubuntu-14.04 BUILDTYPE=autotools
+services:
+    - docker
 install:
-#  - if [ "$CXX" = "g++" ]; then sudo apt-get install -qq g++-4.9; export CXX="g++-4.9" CC="gcc-4.9"; fi
-  - sudo apt-get build-dep -qq gnucash
-  - sudo apt-get install -qq swig xsltproc libdbd-sqlite3 cmake3 texinfo ninja-build
-  - sudo apt-get install -qq libboost-all-dev libgtk-3-dev libwebkit2gtk-3.0-dev
-  - sudo apt-get --reinstall install -qq language-pack-en language-pack-fr
-  - git clone https://github.com/google/googletest -b release-1.8.0 ~/gtest
-script: ./util/travis-script.sh
-after_failure:  ./util/travis-after-failure.sh
+    - docker --version
+    - echo BUILDENV="$BUILDENV"
+    - docker build -f util/ci/${BUILDENV}-docker -t ${BUILDENV}-gnucashbuild util/ci
+script:
+    - echo BUILDTYPE="$BUILDTYPE"
+    - docker run -v "$(pwd)":/gnucash:rw --env="BUILDTYPE=$BUILDTYPE" --rm ${BUILDENV}-gnucashbuild
diff --git a/util/ci/afterfailure b/util/ci/afterfailure
new file mode 100755
index 0000000..c71f7c7
--- /dev/null
+++ b/util/ci/afterfailure
@@ -0,0 +1,23 @@
+#!/bin/bash
+
+if [[ "$BUILDTYPE" == "cmake-make" ]] || [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
+    echo "########################";
+    echo "##### LastTest.log #####";
+    echo "########################";
+    cat /build/Testing/Temporary/LastTest.log;
+elif [[ "$BUILDTYPE" == "autotools" ]]; then
+    find . -name 'test*.log' -print0 |
+        while IFS= read -r -d '' logfile; do
+            SIZE=$((${#logfile} + 12));
+            HRULE=$(head -c "$SIZE" < /dev/zero | tr '\0' '#');
+            echo $HRULE;
+            echo "##### ${logfile} #####";
+            echo $HRULE;
+            cat -- "$logfile";
+            echo $'\n'$'\n';
+        done;
+else
+    echo "Unknown BUILDTYPE: \"$BUILDTYPE\", cannot create failure information.";
+fi
+# This script should fail so that the entire script will fail.
+exit 1;
diff --git a/util/ci/arch-docker b/util/ci/arch-docker
new file mode 100644
index 0000000..4d9bcc6
--- /dev/null
+++ b/util/ci/arch-docker
@@ -0,0 +1,11 @@
+from base/archlinux
+#run pacman -Syu --quiet --noconfirm > /dev/null
+#run pacman -S --noconfirm archlinux-keyring
+run pacman -Syu --quiet --noconfirm gcc cmake make autoconf automake boost python2 pkg-config guile2.0 guile git ninja gtest gmock sqlite3 webkit2gtk swig gwenhywfar aqbanking intltool libxslt postgresql-libs libmariadbclient libdbi libdbi-drivers > /dev/null
+run echo en_US.UTF-8 UTF-8 >> /etc/locale.gen
+run echo en_GB.UTF-8 UTF-8 >> /etc/locale.gen
+run echo fr_FR.UTF-8 UTF-8 >> /etc/locale.gen
+run locale-gen
+copy arch-testscript afterfailure commonbuild /
+run chmod +x /arch-testscript /afterfailure /commonbuild
+entrypoint /arch-testscript
diff --git a/util/ci/arch-testscript b/util/ci/arch-testscript
new file mode 100644
index 0000000..b97021d
--- /dev/null
+++ b/util/ci/arch-testscript
@@ -0,0 +1,18 @@
+#!/bin/bash -le
+
+#-l above (login shell) so that /etc/profile runs so that perl is
+# on the path.
+
+#-e so that if any command has an exit code != 0, this script will
+#  exit immediately.
+
+# Python is python 3, but gnucash doesn't work with python 3. There
+# doesn't seem to be a way to tell automake to use /usr/bin/python2,
+# so we'll mock this up
+mkdir autotools_bin;
+ln -s /usr/bin/python2 autotools_bin/python;
+export PATH=/autotools_bin:"$PATH";
+echo path is "$PATH";
+echo python version is "$(python --version)";
+
+../commonbuild
diff --git a/util/ci/commonbuild b/util/ci/commonbuild
new file mode 100644
index 0000000..f94f9ff
--- /dev/null
+++ b/util/ci/commonbuild
@@ -0,0 +1,25 @@
+#!/bin/bash -e
+
+mkdir build;
+cd build;
+export TZ="America/Los_Angeles";
+
+mkdir -p /root/.local/share;
+
+if [[ "$BUILDTYPE" == "cmake-make" ]]; then
+    cmake ../gnucash
+    make -j 4;
+    make check || ../afterfailure;
+elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
+    cmake ../gnucash -DCMAKE_BUILD_TYPE=debug -DENABLE_DEBUG=on -G Ninja
+    ninja
+    ninja check || ../afterfailure;
+elif [[ "$BUILDTYPE" == "autotools" ]]; then
+    ../gnucash/autogen.sh;
+    ../gnucash/configure --enable-python;
+    make;
+    make check || ../afterfailure;
+else
+    echo "Unknown buildtype: \"$BUILDTYPE\". Not building.";
+fi
+
diff --git a/util/ci/ubuntu-14.04-docker b/util/ci/ubuntu-14.04-docker
new file mode 100644
index 0000000..5609be4
--- /dev/null
+++ b/util/ci/ubuntu-14.04-docker
@@ -0,0 +1,11 @@
+from ubuntu:14.04
+#sudo apt-get install -qq software-properties-common
+#sudo add-apt-repository -qq ppa:george-edison55/cmake-3.x
+run apt-get update -qq
+run apt-get build-dep -qq gnucash > /dev/null
+run apt-get install -qq git bash-completion cmake3 make swig xsltproc libdbd-sqlite3 texinfo ninja-build libboost-all-dev libgtk-3-dev libwebkit2gtk-3.0-dev > /dev/null
+run apt-get --reinstall install -qq language-pack-en language-pack-fr
+run git clone https://github.com/google/googletest -b release-1.8.0 gtest
+copy ubuntu-14.04-testscript afterfailure commonbuild /
+run chmod +x /ubuntu-14.04-testscript /afterfailure /commonbuild
+entrypoint /ubuntu-14.04-testscript
diff --git a/util/ci/ubuntu-14.04-testscript b/util/ci/ubuntu-14.04-testscript
new file mode 100644
index 0000000..a5fe7aa
--- /dev/null
+++ b/util/ci/ubuntu-14.04-testscript
@@ -0,0 +1,8 @@
+#!/bin/bash -e
+
+# -e above so that if any command has an exit code != 0, this script will
+#  exit immediately.
+
+export GTEST_ROOT=/gtest/googletest GMOCK_ROOT=/gtest/googlemock;
+
+../commonbuild
diff --git a/util/travis-after-failure.sh b/util/travis-after-failure.sh
deleted file mode 100755
index 64957de..0000000
--- a/util/travis-after-failure.sh
+++ /dev/null
@@ -1,19 +0,0 @@
-#! /bin/bash
-
-# Build logs are located in different places depending on the build environment used
-if [[ "$BUILDTYPE" == "cmake-make" ]] || [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
-  echo "##### LastTest.log #####"
-  echo "#########################"
-  cat /tmp/gnucash-build-${BUILDTYPE}/Testing/Temporary/LastTest.log
-elif [[ "$BUILDTYPE" == "autotools" ]]; then
-  for logfile in $( find . -name 'test*.log' ); do
-    SIZE=$((${#logfile} + 12))
-    HRULE=$(head -c $SIZE < /dev/zero | tr '\0' '#')
-    echo $HRULE
-    echo "##### ${logfile} #####"
-    echo $HRULE
-    cat -- "$logfile"
-    echo -e "\n\n"
-  done
-fi
-
diff --git a/util/travis-script.sh b/util/travis-script.sh
deleted file mode 100755
index 8e14edd..0000000
--- a/util/travis-script.sh
+++ /dev/null
@@ -1,30 +0,0 @@
-#! /bin/bash -ev
-# The -e above says that if any line below fails, the whole script fails
-
-# Run tests in different build configurations depending on the
-# value of the BUILDTYPE environment variable
-# 1. cmake build using the default Makefile generator
-if [[ "$BUILDTYPE" == "cmake-make" ]]; then
-  mkdir /tmp/gnucash-build-cmake-make
-  cd /tmp/gnucash-build-cmake-make
-  GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock cmake $TRAVIS_BUILD_DIR
-  make -j 4
-  TZ="America/Los_Angeles" make check
-
-# 2. cmake build using the Ninja generator
-elif [[ "$BUILDTYPE" == "cmake-ninja" ]]; then
-  mkdir /tmp/gnucash-build-cmake-ninja
-  cd /tmp/gnucash-build-cmake-ninja
-  GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock cmake -G Ninja $TRAVIS_BUILD_DIR
-  ninja
-  TZ="America/Los_Angeles" ninja check
-
-# 3. autotools build
-elif [[ "$BUILDTYPE" == "autotools" ]]; then
-  cd $TRAVIS_BUILD_DIR
-  ./autogen.sh
-  ./configure --enable-python GTEST_ROOT=~/gtest/googletest GMOCK_ROOT=~/gtest/googlemock
-  make
-  TZ="America/Los_Angeles" make check
-fi
-



Summary of changes:
 .travis.yml                       | 36 +++++++++++++++---------------------
 cmake/CMakeLists.txt              |  6 +++++-
 libgnucash/engine/business-core.i |  1 +
 libgnucash/engine/gncTaxTable.c   |  2 +-
 libgnucash/engine/gncTaxTable.h   |  3 ++-
 po/de.po                          | 19 +++++++++++++++----
 util/ci/afterfailure              | 23 +++++++++++++++++++++++
 util/ci/arch-docker               | 11 +++++++++++
 util/ci/arch-testscript           | 18 ++++++++++++++++++
 util/ci/commonbuild               | 25 +++++++++++++++++++++++++
 util/ci/ubuntu-14.04-docker       | 11 +++++++++++
 util/ci/ubuntu-14.04-testscript   |  8 ++++++++
 util/travis-after-failure.sh      | 19 -------------------
 util/travis-script.sh             | 30 ------------------------------
 14 files changed, 135 insertions(+), 77 deletions(-)
 create mode 100755 util/ci/afterfailure
 create mode 100644 util/ci/arch-docker
 create mode 100644 util/ci/arch-testscript
 create mode 100644 util/ci/commonbuild
 create mode 100644 util/ci/ubuntu-14.04-docker
 create mode 100644 util/ci/ubuntu-14.04-testscript
 delete mode 100755 util/travis-after-failure.sh
 delete mode 100755 util/travis-script.sh



More information about the gnucash-changes mailing list