"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "gnucash/register/ledger-core/gnc-ledger-display.c" between
gnucash-3.6.tar.bz2 and gnucash-3.7.tar.bz2

About: GnuCash is personal and small-business financial-accounting software.

gnc-ledger-display.c  (gnucash-3.6.tar.bz2):gnc-ledger-display.c  (gnucash-3.7.tar.bz2)
skipping to change at line 72 skipping to change at line 72
SplitRegister *reg; SplitRegister *reg;
gboolean loading; gboolean loading;
gboolean use_double_line_default; gboolean use_double_line_default;
GNCLedgerDisplayDestroy destroy; GNCLedgerDisplayDestroy destroy;
GNCLedgerDisplayGetParent get_parent; GNCLedgerDisplayGetParent get_parent;
gpointer user_data; gpointer user_data;
gint number_of_subaccounts;
gint component_id; gint component_id;
}; };
/** GLOBALS *********************************************************/ /** GLOBALS *********************************************************/
static QofLogModule log_module = GNC_MOD_LEDGER; static QofLogModule log_module = GNC_MOD_LEDGER;
/** Declarations ****************************************************/ /** Declarations ****************************************************/
static GNCLedgerDisplay * static GNCLedgerDisplay *
gnc_ledger_display_internal (Account *lead_account, Query *q, gnc_ledger_display_internal (Account *lead_account, Query *q,
GNCLedgerDisplayType ld_type, GNCLedgerDisplayType ld_type,
SplitRegisterType reg_type, SplitRegisterType reg_type,
SplitRegisterStyle style, SplitRegisterStyle style,
gboolean use_double_line, gboolean use_double_line,
gboolean is_template); gboolean is_template);
static void gnc_ledger_display_refresh_internal (GNCLedgerDisplay *ld, static void gnc_ledger_display_refresh_internal (GNCLedgerDisplay *ld,
GList *splits); GList *splits);
static void gnc_ledger_display_make_query (GNCLedgerDisplay *ld,
gint limit,
SplitRegisterType type);
/** Implementations *************************************************/ /** Implementations *************************************************/
Account * Account *
gnc_ledger_display_leader (GNCLedgerDisplay *ld) gnc_ledger_display_leader (GNCLedgerDisplay *ld)
{ {
if (!ld) if (!ld)
return NULL; return NULL;
return xaccAccountLookup (&ld->leader, gnc_get_current_book ()); return xaccAccountLookup (&ld->leader, gnc_get_current_book ());
skipping to change at line 570 skipping to change at line 577
{ {
info = gnc_gui_get_entity_events (changes, &ld->leader); info = gnc_gui_get_entity_events (changes, &ld->leader);
if (info && (info->event_mask & QOF_EVENT_DESTROY)) if (info && (info->event_mask & QOF_EVENT_DESTROY))
{ {
gnc_close_gui_component (ld->component_id); gnc_close_gui_component (ld->component_id);
LEAVE("destroy"); LEAVE("destroy");
return; return;
} }
} }
/* if subaccount ledger, check to see if still the same number
* of subaccounts, if not recreate the query. */
if (ld->ld_type == LD_SUBACCOUNT)
{
Account *leader = gnc_ledger_display_leader (ld);
GList *accounts = gnc_account_get_descendants (leader);
if (g_list_length (accounts) != ld->number_of_subaccounts)
gnc_ledger_display_make_query (ld,
gnc_prefs_get_float(GNC_PREFS_GROUP_GENERAL_REGIS
TER, GNC_PREF_MAX_TRANS),
gnc_get_reg_type (leader, ld->ld_type));
g_list_free (accounts);
}
/* Its not clear if we should re-run the query, or if we should /* Its not clear if we should re-run the query, or if we should
* just use qof_query_last_run(). Its possible that the dates * just use qof_query_last_run(). Its possible that the dates
* changed, requiring a full new query. Similar considerations * changed, requiring a full new query. Similar considerations
* needed for multi-user mode. * needed for multi-user mode.
*/ */
splits = qof_query_run (ld->query); splits = qof_query_run (ld->query);
gnc_ledger_display_set_watches (ld, splits); gnc_ledger_display_set_watches (ld, splits);
gnc_ledger_display_refresh_internal (ld, splits); gnc_ledger_display_refresh_internal (ld, splits);
skipping to change at line 645 skipping to change at line 667
* configurable, or maybe we should go back a time range instead * configurable, or maybe we should go back a time range instead
* of picking a number, or maybe we should be able to exclude * of picking a number, or maybe we should be able to exclude
* based on reconciled status. Anyway, this works for now. */ * based on reconciled status. Anyway, this works for now. */
if ((limit != 0) && (type != SEARCH_LEDGER)) if ((limit != 0) && (type != SEARCH_LEDGER))
qof_query_set_max_results (ld->query, limit); qof_query_set_max_results (ld->query, limit);
qof_query_set_book (ld->query, gnc_get_current_book()); qof_query_set_book (ld->query, gnc_get_current_book());
leader = gnc_ledger_display_leader (ld); leader = gnc_ledger_display_leader (ld);
/* if this is a subaccount ledger, record the number of
* subaccounts so we can determine if the query needs
* recreating on a refresh. */
if (ld->ld_type == LD_SUBACCOUNT) if (ld->ld_type == LD_SUBACCOUNT)
{
accounts = gnc_account_get_descendants (leader); accounts = gnc_account_get_descendants (leader);
ld->number_of_subaccounts = g_list_length (accounts);
}
else else
accounts = NULL; accounts = NULL;
accounts = g_list_prepend (accounts, leader); accounts = g_list_prepend (accounts, leader);
xaccQueryAddAccountMatch (ld->query, accounts, xaccQueryAddAccountMatch (ld->query, accounts,
QOF_GUID_MATCH_ANY, QOF_QUERY_AND); QOF_GUID_MATCH_ANY, QOF_QUERY_AND);
g_list_free (accounts); g_list_free (accounts);
} }
 End of changes. 7 change blocks. 
1 lines changed or deleted 30 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)