[Gnucash-changes] r13713 - gnucash/trunk - Work around the fact that a validating XML parser barfs on gnucash's

Chris Shoemaker c.shoemaker at cox.net
Thu Mar 30 13:15:48 EST 2006


On Thu, Mar 30, 2006 at 12:20:31PM -0500, David Hampton wrote:
> Author: hampton
> Date: 2006-03-30 12:20:29 -0500 (Thu, 30 Mar 2006)
> New Revision: 13713
> Trac: http://svn.gnucash.org/trac/changeset/13713
> 
> Modified:
>    gnucash/trunk/ChangeLog
>    gnucash/trunk/src/backend/file/io-gncxml-v2.c
>    gnucash/trunk/src/gnome-utils/gnc-main-window.c
>    gnucash/trunk/src/gnome-utils/gnc-window.c
> Log:
> Work around the fact that a validating XML parser barfs on gnucash's
> use of an attribute in an undefined namespace.
> 
> 
> @@ -446,25 +456,26 @@
>      total = counter->transactions_total + counter->accounts_total +
>        counter->books_total + counter->commodities_total +
>        counter->schedXactions_total + counter->budgets_total;
> +    if (total == 0)
> +      total = 1;
>  
>      percentage = (loaded * 100)/total;
>      if (percentage > 100) {
>        /* FIXME: Perhaps the below should be replaced by:
>  	 print_counter_data(counter); */
> -      printf("Transactions: Total: %d, Loaded: %d\n",
> -             counter->transactions_total, counter->transactions_loaded);
> -      printf("Accounts: Total: %d, Loaded: %d\n",
> -             counter->accounts_total, counter->accounts_loaded);
> -      printf("Books: Total: %d, Loaded: %d\n",
> -             counter->books_total, counter->books_loaded);
> -      printf("Commodities: Total: %d, Loaded: %d\n",
> -             counter->commodities_total, counter->commodities_loaded);
> -      printf("Scheduled Tansactions: Total: %d, Loaded: %d\n",
> -             counter->schedXactions_total, counter->schedXactions_loaded);
> -      printf("Budgets: Total: %d, Loaded: %d\n",
> -	     counter->budgets_total, counter->budgets_loaded);
> +//      printf("Transactions: Total: %d, Loaded: %d\n",
> +//             counter->transactions_total, counter->transactions_loaded);
> +//      printf("Accounts: Total: %d, Loaded: %d\n",
> +//             counter->accounts_total, counter->accounts_loaded);
> +//      printf("Books: Total: %d, Loaded: %d\n",
> +//             counter->books_total, counter->books_loaded);
> +//      printf("Commodities: Total: %d, Loaded: %d\n",
> +//             counter->commodities_total, counter->commodities_loaded);
> +//      printf("Scheduled Tansactions: Total: %d, Loaded: %d\n",
> +//             counter->schedXactions_total, counter->schedXactions_loaded);
> +//      printf("Budgets: Total: %d, Loaded: %d\n",
> +//	     counter->budgets_total, counter->budgets_loaded);
>      }
> -    percentage = MIN(percentage, 100);
>      gd->gui_display_fn(NULL, percentage);
>  }
>  

What happened here?  I've been seeing these printf's for quite a while
and I've been meaning to track down why the 'loaded' numbers are less
than the 'total' numbers for several data-types.  I'm especially
concerned because I've recently noticed GnuCash silently ignoring some
of my transactions, even though they're visible in the register.  I'm
suspecting some sort of data corruption, and I've been wondering if that
would also explain the numbers in these printfs.

But why remove them?  Are they invalid in some way?

-chris


More information about the gnucash-devel mailing list