Bug 754533 No Account Templates Error Patch

Add test for zero account list to stop warnings.
This commit is contained in:
Robert Fewell 2015-08-31 16:33:01 +01:00 committed by Geert Janssens
parent 42415056d0
commit 557ec68667
4 changed files with 16 additions and 4 deletions

View File

@ -208,7 +208,10 @@ gnc_ui_find_transactions_dialog_create(GNCLedgerDisplay * orig_ledg)
tRoot = gnc_book_get_template_root( gnc_get_current_book() ); tRoot = gnc_book_get_template_root( gnc_get_current_book() );
al = gnc_account_get_descendants( tRoot ); al = gnc_account_get_descendants( tRoot );
xaccQueryAddAccountMatch( start_q, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
if (g_list_length(al) != 0)
xaccQueryAddAccountMatch( start_q, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
g_list_free (al); g_list_free (al);
al = NULL; al = NULL;
tRoot = NULL; tRoot = NULL;

View File

@ -209,7 +209,10 @@ gnc_ui_find_transactions_dialog_create2 (GNCLedgerDisplay2 * orig_ledg)
tRoot = gnc_book_get_template_root( gnc_get_current_book() ); tRoot = gnc_book_get_template_root( gnc_get_current_book() );
al = gnc_account_get_descendants( tRoot ); al = gnc_account_get_descendants( tRoot );
xaccQueryAddAccountMatch( start_q, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
if (g_list_length(al) != 0)
xaccQueryAddAccountMatch( start_q, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
g_list_free (al); g_list_free (al);
al = NULL; al = NULL;
tRoot = NULL; tRoot = NULL;

View File

@ -415,7 +415,10 @@ gnc_ledger_display_gl (void)
tRoot = gnc_book_get_template_root( gnc_get_current_book() ); tRoot = gnc_book_get_template_root( gnc_get_current_book() );
al = gnc_account_get_descendants( tRoot ); al = gnc_account_get_descendants( tRoot );
xaccQueryAddAccountMatch( query, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
if (g_list_length(al) != 0)
xaccQueryAddAccountMatch( query, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
g_list_free (al); g_list_free (al);
al = NULL; al = NULL;
tRoot = NULL; tRoot = NULL;

View File

@ -424,7 +424,10 @@ gnc_ledger_display2_gl (void)
tRoot = gnc_book_get_template_root( gnc_get_current_book() ); tRoot = gnc_book_get_template_root( gnc_get_current_book() );
al = gnc_account_get_descendants( tRoot ); al = gnc_account_get_descendants( tRoot );
xaccQueryAddAccountMatch( query, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
if (g_list_length(al) != 0)
xaccQueryAddAccountMatch( query, al, QOF_GUID_MATCH_NONE, QOF_QUERY_AND );
g_list_free (al); g_list_free (al);
al = NULL; al = NULL;
tRoot = NULL; tRoot = NULL;