mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Replace some renamed functions by their real new names, removing the annoying #defines.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19652 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
de7b16533e
commit
67c6a3d0cf
@ -45,7 +45,7 @@ run_tests (int count)
|
||||
{
|
||||
q = get_random_query ();
|
||||
test_query (q, val2str);
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
}
|
||||
success ("");
|
||||
}
|
||||
|
@ -43,7 +43,7 @@ test_query (Query *q, SCM val2str)
|
||||
|
||||
q2 = gnc_scm2query (res_q);
|
||||
|
||||
if (!xaccQueryEqual (q, q2))
|
||||
if (!qof_query_equal (q, q2))
|
||||
{
|
||||
failure ("queries don't match");
|
||||
fprintf (stderr, "%s\n\n", str2 ? str2 : "(null)");
|
||||
@ -58,7 +58,7 @@ test_query (Query *q, SCM val2str)
|
||||
success ("queries match");
|
||||
}
|
||||
if (str2) g_free(str2);
|
||||
if (q2) xaccFreeQuery (q2);
|
||||
if (q2) qof_query_destroy (q2);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -75,7 +75,7 @@ run_tests (void)
|
||||
{
|
||||
q = get_random_query ();
|
||||
test_query (q, val2str);
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
printf("%d ", i);
|
||||
fflush(stdout);
|
||||
}
|
||||
@ -83,7 +83,7 @@ run_tests (void)
|
||||
{
|
||||
q = get_random_query ();
|
||||
test_query (q, val2str);
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
printf("%d ", i);
|
||||
fflush(stdout);
|
||||
}
|
||||
|
@ -2337,7 +2337,7 @@ query_restore_start_handler(GSList* sibling_data, gpointer parent_data,
|
||||
gpointer *result, const gchar *tag, gchar **attrs)
|
||||
{
|
||||
Query *q;
|
||||
q = xaccMallocQuery();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
g_return_val_if_fail(q, FALSE);
|
||||
*data_for_children = q;
|
||||
*result = q;
|
||||
@ -2363,16 +2363,16 @@ query_restore_end_handler(gpointer data_for_children,
|
||||
g_return_val_if_fail(qand, FALSE);
|
||||
|
||||
/* append the and terms by or'ing them in ... */
|
||||
qret = xaccQueryMerge (q, qand, QUERY_OR);
|
||||
qret = qof_query_merge (q, qand, QUERY_OR);
|
||||
if (!qret)
|
||||
{
|
||||
xaccFreeQuery(qand);
|
||||
qof_query_destroy(qand);
|
||||
*result = q;
|
||||
g_return_val_if_fail(qret, FALSE);
|
||||
}
|
||||
|
||||
xaccFreeQuery(q);
|
||||
xaccFreeQuery(qand);
|
||||
qof_query_destroy(q);
|
||||
qof_query_destroy(qand);
|
||||
|
||||
*result = qret;
|
||||
return(TRUE);
|
||||
@ -2402,7 +2402,7 @@ query_restore_fail_handler(gpointer data_for_children,
|
||||
const gchar *tag)
|
||||
{
|
||||
Query *q = (Query *) data_for_children;
|
||||
if (q) xaccFreeQuery(q);
|
||||
if (q) qof_query_destroy(q);
|
||||
}
|
||||
|
||||
/* ================================================================= */
|
||||
@ -2434,7 +2434,7 @@ query_and_start_handler(GSList* sibling_data, gpointer parent_data,
|
||||
Query *q;
|
||||
|
||||
/* note this malloc freed in the node higher up (query_restore_end_handler) */
|
||||
q = xaccMallocQuery();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
g_return_val_if_fail(q, FALSE);
|
||||
*data_for_children = q;
|
||||
*result = q;
|
||||
@ -2463,7 +2463,7 @@ query_and_fail_handler(gpointer data_for_children,
|
||||
const gchar *tag)
|
||||
{
|
||||
Query *q = (Query *) data_for_children;
|
||||
if (q) xaccFreeQuery(q);
|
||||
if (q) qof_query_destroy(q);
|
||||
}
|
||||
|
||||
/* ================================================================= */
|
||||
|
@ -65,7 +65,7 @@ build_param_list_internal (const char *first, va_list rest)
|
||||
SplitList *
|
||||
xaccQueryGetSplitsUniqueTrans(Query *q)
|
||||
{
|
||||
GList * splits = xaccQueryGetSplits(q);
|
||||
GList * splits = qof_query_run(q);
|
||||
GList * current;
|
||||
GList * result = NULL;
|
||||
GHashTable * trans_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
|
||||
@ -117,7 +117,7 @@ query_match_any_filter_func(gpointer key, gpointer value, gpointer user_data)
|
||||
TransList *
|
||||
xaccQueryGetTransactions (Query * q, query_txn_match_t runtype)
|
||||
{
|
||||
GList * splits = xaccQueryGetSplits(q);
|
||||
GList * splits = qof_query_run(q);
|
||||
GList * current = NULL;
|
||||
GList * retval = NULL;
|
||||
GHashTable * trans_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
|
||||
@ -188,7 +188,7 @@ query_match_any_lot_filter_func(gpointer key, gpointer value, gpointer user_data
|
||||
LotList *
|
||||
xaccQueryGetLots (Query * q, query_txn_match_t runtype)
|
||||
{
|
||||
GList * splits = xaccQueryGetSplits(q);
|
||||
GList * splits = qof_query_run(q);
|
||||
GList * current = NULL;
|
||||
GList * retval = NULL;
|
||||
GHashTable * lot_hash = g_hash_table_new(g_direct_hash, g_direct_equal);
|
||||
|
@ -39,30 +39,6 @@
|
||||
|
||||
typedef QofQuery Query;
|
||||
|
||||
#define xaccMallocQuery() qof_query_create_for(GNC_ID_SPLIT)
|
||||
#define xaccFreeQuery qof_query_destroy
|
||||
#define xaccQueryCopy qof_query_copy
|
||||
#define xaccQuerySetBook qof_query_set_book
|
||||
|
||||
#define xaccQueryInvert qof_query_invert
|
||||
#define xaccQueryMerge qof_query_merge
|
||||
#define xaccQueryClear qof_query_clear
|
||||
|
||||
/* The xaccQueryHasTerms() routine returns the number of 'OR' terms in the query.
|
||||
* The xaccQueryNumTerms() routine returns the total number of terms in the query.
|
||||
*/
|
||||
|
||||
#define xaccQueryHasTerms qof_query_has_terms
|
||||
#define xaccQueryNumTerms qof_query_num_terms
|
||||
|
||||
|
||||
#define xaccQuerySetSortIncreasing qof_query_set_sort_increasing
|
||||
|
||||
#define xaccQuerySetMaxSplits qof_query_set_max_results
|
||||
#define xaccQueryGetMaxSplits qof_query_get_max_results
|
||||
|
||||
#define xaccQueryEqual qof_query_equal
|
||||
|
||||
typedef enum
|
||||
{
|
||||
QUERY_TXN_MATCH_ALL = 1, /* match all accounts */
|
||||
@ -77,21 +53,23 @@ typedef enum
|
||||
* query. Any given split will appear at most once in the result;
|
||||
* however, several splits from one transaction may appear in the list.
|
||||
* The caller MUST NOT change the GList.
|
||||
*
|
||||
*/
|
||||
|
||||
/**
|
||||
* The xaccQueryGetSplitsUniqueTrans() routine returns splits matching
|
||||
* the query, but only one matching split per transaction will be
|
||||
* returned. In other words, any given transaction will be
|
||||
* represented at most once in the returned list. The caller must
|
||||
* free the GList.
|
||||
*
|
||||
*/
|
||||
SplitList * xaccQueryGetSplitsUniqueTrans(Query *q);
|
||||
|
||||
/**
|
||||
* The xaccQueryGetTransactions() routine returns a list of
|
||||
* transactions that match the query. The GList must be freed by
|
||||
* the caller. The query_run_t argument is used to provide account
|
||||
* matching in the following way:
|
||||
*
|
||||
* The xaccQueryGetLots() routine is just like GetTransactions() except
|
||||
* it returns a list of Lots.
|
||||
*
|
||||
* query_txn_match_t describes how to match accounts when querying
|
||||
* for transactions with xaccQueryGetTransactions().
|
||||
* What is the difference between 'ANY' and 'ALL', you
|
||||
@ -107,9 +85,13 @@ typedef enum
|
||||
* matching accounts, whereas 'AND' acts as a boolean-AND
|
||||
* for matching accounts. Whew. Got that?
|
||||
*/
|
||||
#define xaccQueryGetSplits qof_query_run
|
||||
SplitList * xaccQueryGetSplitsUniqueTrans(Query *q);
|
||||
TransList * xaccQueryGetTransactions(Query * q, query_txn_match_t type);
|
||||
|
||||
/**
|
||||
* The xaccQueryGetLots() routine is just like GetTransactions() except
|
||||
* it returns a list of Lots.
|
||||
*
|
||||
*/
|
||||
LotList * xaccQueryGetLots(Query * q, query_txn_match_t type);
|
||||
|
||||
/*******************************************************************
|
||||
|
@ -1181,7 +1181,7 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
|
||||
query_term_scm = SCM_CDR (query_term_scm);
|
||||
sense = scm_is_true (scm);
|
||||
|
||||
q = xaccMallocQuery ();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
|
||||
if (!safe_strcmp (pd_type, "pd-date"))
|
||||
{
|
||||
@ -1497,14 +1497,14 @@ gnc_scm2query_term_query_v1 (SCM query_term_scm)
|
||||
out_q = q;
|
||||
else
|
||||
{
|
||||
out_q = xaccQueryInvert (q);
|
||||
xaccFreeQuery (q);
|
||||
out_q = qof_query_invert (q);
|
||||
qof_query_destroy (q);
|
||||
}
|
||||
|
||||
return out_q;
|
||||
}
|
||||
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -1577,11 +1577,11 @@ gnc_scm2query_and_terms (SCM and_terms, query_version_t vers)
|
||||
|
||||
if (q_and)
|
||||
{
|
||||
q_new = xaccQueryMerge (q, q_and, QOF_QUERY_AND);
|
||||
q_new = qof_query_merge (q, q_and, QOF_QUERY_AND);
|
||||
|
||||
if (q_new)
|
||||
{
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
q = q_new;
|
||||
}
|
||||
}
|
||||
@ -1599,7 +1599,7 @@ gnc_scm2query_or_terms (SCM or_terms, query_version_t vers)
|
||||
if (!scm_is_list (or_terms))
|
||||
return NULL;
|
||||
|
||||
q = xaccMallocQuery ();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
|
||||
while (!scm_is_null (or_terms))
|
||||
{
|
||||
@ -1619,11 +1619,11 @@ gnc_scm2query_or_terms (SCM or_terms, query_version_t vers)
|
||||
|
||||
if (q_or)
|
||||
{
|
||||
q_new = xaccQueryMerge (q, q_or, QOF_QUERY_OR);
|
||||
q_new = qof_query_merge (q, q_or, QOF_QUERY_OR);
|
||||
|
||||
if (q_new)
|
||||
{
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
q = q_new;
|
||||
}
|
||||
}
|
||||
@ -1907,7 +1907,7 @@ gnc_scm2query_v1 (SCM query_scm)
|
||||
if (safe_strcmp ("terms", symbol) == 0)
|
||||
{
|
||||
if (q)
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
|
||||
q = gnc_scm2query_or_terms (value, gnc_QUERY_v1);
|
||||
if (!q)
|
||||
@ -1999,12 +1999,12 @@ gnc_scm2query_v1 (SCM query_scm)
|
||||
qof_query_set_sort_order (q, s1, s2, s3);
|
||||
qof_query_set_sort_increasing (q, primary_increasing, secondary_increasing,
|
||||
tertiary_increasing);
|
||||
xaccQuerySetMaxSplits (q, max_splits);
|
||||
qof_query_set_max_results (q, max_splits);
|
||||
|
||||
return q;
|
||||
}
|
||||
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@ -2058,7 +2058,7 @@ gnc_scm2query_v2 (SCM query_scm)
|
||||
if (!safe_strcmp ("terms", symbol))
|
||||
{
|
||||
if (q)
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
|
||||
q = gnc_scm2query_or_terms (value, gnc_QUERY_v2);
|
||||
if (!q)
|
||||
@ -2138,7 +2138,7 @@ gnc_scm2query_v2 (SCM query_scm)
|
||||
return q;
|
||||
}
|
||||
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -1721,7 +1721,7 @@ get_random_query(void)
|
||||
num_terms = get_random_int_in_range (1, 3);
|
||||
if (gnc_engine_debug_random) printf("num_terms = %d", num_terms);
|
||||
|
||||
q = xaccMallocQuery ();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
|
||||
while (num_terms-- > 0)
|
||||
{
|
||||
@ -1882,12 +1882,12 @@ get_random_query(void)
|
||||
if (gnc_engine_debug_random) printf ("\n");
|
||||
set_query_sort (q, get_random_int_in_range (1, BY_NONE));
|
||||
|
||||
xaccQuerySetSortIncreasing (q,
|
||||
qof_query_set_sort_increasing (q,
|
||||
get_random_boolean (),
|
||||
get_random_boolean (),
|
||||
get_random_boolean ());
|
||||
|
||||
xaccQuerySetMaxSplits (q, get_random_int_in_range (-50000, 50000));
|
||||
qof_query_set_max_results (q, get_random_int_in_range (-50000, 50000));
|
||||
|
||||
return q;
|
||||
}
|
||||
@ -2047,7 +2047,7 @@ make_trans_query (Transaction *trans, TestQueryTypes query_types)
|
||||
if (query_types == RANDOM_QT)
|
||||
query_types = get_random_query_type ();
|
||||
|
||||
q = xaccMallocQuery ();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
|
||||
s = xaccTransGetSplit (trans, 0);
|
||||
a = xaccSplitGetAccount (s);
|
||||
@ -2121,7 +2121,7 @@ make_trans_query (Transaction *trans, TestQueryTypes query_types)
|
||||
break;
|
||||
default:
|
||||
failure ("bad reconcile flag");
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -39,7 +39,7 @@ test_trans_query (Transaction *trans, gpointer data)
|
||||
Query *q;
|
||||
|
||||
q = make_trans_query (trans, ALL_QT);
|
||||
xaccQuerySetBook (q, book);
|
||||
qof_query_set_book (q, book);
|
||||
|
||||
list = xaccQueryGetTransactions (q, QUERY_TXN_MATCH_ANY);
|
||||
if (g_list_length (list) != 1)
|
||||
@ -59,7 +59,7 @@ test_trans_query (Transaction *trans, gpointer data)
|
||||
}
|
||||
|
||||
success ("found right transaction");
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
g_list_free (list);
|
||||
|
||||
return 0;
|
||||
|
@ -21,7 +21,7 @@ test_query (Query *q)
|
||||
|
||||
q2 = gnc_scm2query (scm_q);
|
||||
|
||||
if (!xaccQueryEqual (q, q2))
|
||||
if (!qof_query_equal (q, q2))
|
||||
{
|
||||
failure ("queries don't match");
|
||||
scm_display (scm_q, SCM_UNDEFINED);
|
||||
@ -36,7 +36,7 @@ test_query (Query *q)
|
||||
success ("queries match");
|
||||
}
|
||||
|
||||
xaccFreeQuery (q2);
|
||||
qof_query_destroy (q2);
|
||||
}
|
||||
|
||||
static void
|
||||
@ -47,15 +47,15 @@ run_tests (void)
|
||||
|
||||
test_query (NULL);
|
||||
|
||||
q = xaccMallocQuery ();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
test_query (q);
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
|
||||
for (i = 0; i < 50; i++)
|
||||
{
|
||||
q = get_random_query ();
|
||||
test_query (q);
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -348,8 +348,8 @@ main (int argc, char *argv[])
|
||||
xaccQuerySetGroup (q, root);
|
||||
|
||||
/* hack -- limit to 30 splits ... */
|
||||
xaccQuerySetMaxSplits (q, 30);
|
||||
split_list = xaccQueryGetSplits (q);
|
||||
qof_query_set_max_results (q, 30);
|
||||
split_list = qof_query_run (q);
|
||||
|
||||
/* poke those splits into an ccount group structure */
|
||||
/* XXX not implemented */
|
||||
@ -357,7 +357,7 @@ main (int argc, char *argv[])
|
||||
/* send the account group structure back to the user */
|
||||
/* XXX not implemented */
|
||||
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
g_free (request_bufp);
|
||||
|
||||
}
|
||||
|
@ -58,9 +58,9 @@ main (int argc, char *argv[])
|
||||
root = gnc_book_get_root_account (book);
|
||||
|
||||
/* build a query */
|
||||
q = xaccMallocQuery ();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
xaccQuerySetGroup (q, root);
|
||||
xaccQuerySetMaxSplits (q, 30);
|
||||
qof_query_set_max_results (q, 30);
|
||||
|
||||
/* Get everything between some random dates */
|
||||
/* In real life, we would use a query as specified by the user */
|
||||
@ -68,7 +68,7 @@ main (int argc, char *argv[])
|
||||
FALSE, 16, 10, 2010,
|
||||
QUERY_OR);
|
||||
|
||||
split_list = xaccQueryGetSplits (q);
|
||||
split_list = qof_query_run (q);
|
||||
|
||||
/* count number of splits */
|
||||
i = 0;
|
||||
@ -80,9 +80,9 @@ main (int argc, char *argv[])
|
||||
|
||||
gncxml_write_query_to_buf(q, &bufp, &sz);
|
||||
qq = gncxml_read_query (bufp, sz);
|
||||
xaccQuerySetMaxSplits (qq, 30);
|
||||
qof_query_set_max_results (qq, 30);
|
||||
xaccQuerySetGroup (qq, root);
|
||||
sl2 = xaccQueryGetSplits (qq);
|
||||
sl2 = qof_query_run (qq);
|
||||
|
||||
/* count number of splits */
|
||||
ii = 0;
|
||||
@ -103,7 +103,7 @@ main (int argc, char *argv[])
|
||||
printf (" its %d and %d \n", i, ii);
|
||||
|
||||
free (bufp);
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
|
||||
|
||||
bookerrexit:
|
||||
|
@ -93,10 +93,10 @@ main (int argc, char *argv[])
|
||||
xaccQuerySetGroup (q, root);
|
||||
|
||||
/* hack -- limit to 30 splits ... */
|
||||
xaccQuerySetMaxSplits (q, 30);
|
||||
split_list = xaccQueryGetSplits (q);
|
||||
qof_query_set_max_results (q, 30);
|
||||
split_list = qof_query_run (q);
|
||||
|
||||
xaccFreeQuery (q);
|
||||
qof_query_destroy (q);
|
||||
|
||||
/* wait for the next request */
|
||||
continue;
|
||||
|
@ -472,7 +472,7 @@ gnc_query_list_destroy (GtkObject *object)
|
||||
}
|
||||
if (list->query)
|
||||
{
|
||||
xaccFreeQuery(list->query);
|
||||
qof_query_destroy(list->query);
|
||||
list->query = NULL;
|
||||
}
|
||||
if (list->column_params)
|
||||
@ -719,7 +719,7 @@ gnc_query_list_set_query_sort (GNCQueryList *list, gboolean new_column)
|
||||
gncQuerySetSortOrder (list->query, p1, p2, NULL);
|
||||
}
|
||||
|
||||
xaccQuerySetSortIncreasing (list->query,
|
||||
qof_query_set_sort_increasing (list->query,
|
||||
sort_order,
|
||||
sort_order,
|
||||
sort_order);
|
||||
|
@ -1000,14 +1000,14 @@ _show_created_transactions(GncSxSinceLastRunDialog *app_dialog, GList *created_t
|
||||
Query *book_query, *guid_query, *query;
|
||||
GList *guid_iter;
|
||||
|
||||
book_query = xaccMallocQuery();
|
||||
guid_query = xaccMallocQuery();
|
||||
xaccQuerySetBook(book_query, gnc_get_current_book());
|
||||
book_query = qof_query_create_for(GNC_ID_SPLIT);
|
||||
guid_query = qof_query_create_for(GNC_ID_SPLIT);
|
||||
qof_query_set_book(book_query, gnc_get_current_book());
|
||||
for (guid_iter = created_txn_guids; guid_iter != NULL; guid_iter = guid_iter->next)
|
||||
{
|
||||
xaccQueryAddGUIDMatch(guid_query, (GncGUID*)guid_iter->data, GNC_ID_TRANS, QUERY_OR);
|
||||
}
|
||||
query = xaccQueryMerge(book_query, guid_query, QUERY_AND);
|
||||
query = qof_query_merge(book_query, guid_query, QUERY_AND);
|
||||
|
||||
// inspired by dialog-find-transactions:do_find_cb:
|
||||
ledger = gnc_ledger_display_query(query, SEARCH_LEDGER, REG_STYLE_JOURNAL);
|
||||
@ -1016,9 +1016,9 @@ _show_created_transactions(GncSxSinceLastRunDialog *app_dialog, GList *created_t
|
||||
g_object_set(G_OBJECT(page), "page-name", _("Created Transactions"), NULL);
|
||||
gnc_main_window_open_page(NULL, page);
|
||||
|
||||
xaccFreeQuery(query);
|
||||
xaccFreeQuery(book_query);
|
||||
xaccFreeQuery(guid_query);
|
||||
qof_query_destroy(query);
|
||||
qof_query_destroy(book_query);
|
||||
qof_query_destroy(guid_query);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -2117,7 +2117,7 @@ gnc_plugin_page_register_cmd_print_check (GtkAction *action,
|
||||
else if (ledger_type == LD_GL && reg->type == SEARCH_LEDGER)
|
||||
{
|
||||
Account *common_acct = NULL, *account;
|
||||
splits = xaccQueryGetSplits(gnc_ledger_display_get_query(priv->ledger));
|
||||
splits = qof_query_run(gnc_ledger_display_get_query(priv->ledger));
|
||||
/* Make sure each split is from the same account */
|
||||
for (item = splits; item; item = g_list_next(item))
|
||||
{
|
||||
@ -3056,7 +3056,7 @@ gnc_plugin_page_register_cmd_scrub_all (GtkAction *action,
|
||||
gnc_suspend_gui_refresh();
|
||||
root = gnc_get_current_root_account();
|
||||
|
||||
for (node = xaccQueryGetSplits(query); node; node = node->next)
|
||||
for (node = qof_query_run(query); node; node = node->next)
|
||||
{
|
||||
split = node->data;
|
||||
trans = xaccSplitGetParent(split);
|
||||
@ -3112,9 +3112,9 @@ gnc_plugin_page_register_cmd_transaction_report (GtkAction *action,
|
||||
if (!split)
|
||||
return;
|
||||
|
||||
query = xaccMallocQuery ();
|
||||
query = qof_query_create_for(GNC_ID_SPLIT);
|
||||
|
||||
xaccQuerySetBook (query, gnc_get_current_book ());
|
||||
qof_query_set_book (query, gnc_get_current_book ());
|
||||
|
||||
xaccQueryAddGUIDMatch (query, xaccSplitGetGUID (split),
|
||||
GNC_ID_SPLIT, QUERY_AND);
|
||||
|
@ -141,8 +141,8 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type,
|
||||
list->list_type = type;
|
||||
list->statement_date = statement_date;
|
||||
|
||||
query = xaccMallocQuery();
|
||||
xaccQuerySetBook(query, gnc_get_current_book ());
|
||||
query = qof_query_create_for(GNC_ID_SPLIT);
|
||||
qof_query_set_book(query, gnc_get_current_book ());
|
||||
|
||||
include_children = xaccAccountGetReconcileChildrenStatus(account);
|
||||
if (include_children)
|
||||
@ -177,7 +177,7 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type,
|
||||
|
||||
if (auto_check)
|
||||
{
|
||||
for (splits = xaccQueryGetSplits(query); splits; splits = splits->next)
|
||||
for (splits = qof_query_run(query); splits; splits = splits->next)
|
||||
{
|
||||
Split *split = splits->data;
|
||||
char recn = xaccSplitGetReconcile(split);
|
||||
@ -193,7 +193,7 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type,
|
||||
}
|
||||
|
||||
/* Free the query -- we don't need it anymore */
|
||||
xaccFreeQuery(query);
|
||||
qof_query_destroy(query);
|
||||
|
||||
return GTK_WIDGET(list);
|
||||
}
|
||||
@ -649,7 +649,7 @@ gnc_reconcile_list_fill(GNCReconcileList *list)
|
||||
|
||||
print_info = gnc_account_print_info (list->account, FALSE);
|
||||
|
||||
for (splits = xaccQueryGetSplits (list->query); splits; splits = splits->next)
|
||||
for (splits = qof_query_run (list->query); splits; splits = splits->next)
|
||||
{
|
||||
gnc_numeric amount;
|
||||
Timespec ts;
|
||||
|
@ -778,7 +778,7 @@ void gnc_import_find_split_matches(GNCImportTransInfo *trans_info,
|
||||
gint match_date_hardlimit)
|
||||
{
|
||||
GList * list_element;
|
||||
Query *query = xaccMallocQuery();
|
||||
Query *query = qof_query_create_for(GNC_ID_SPLIT);
|
||||
g_assert (trans_info);
|
||||
|
||||
/* Get list of splits of the originating account. */
|
||||
@ -793,14 +793,14 @@ void gnc_import_find_split_matches(GNCImportTransInfo *trans_info,
|
||||
xaccSplitGetAccount (gnc_import_TransInfo_get_fsplit (trans_info));
|
||||
time_t download_time = xaccTransGetDate (gnc_import_TransInfo_get_trans (trans_info));
|
||||
|
||||
xaccQuerySetBook (query, gnc_get_current_book());
|
||||
qof_query_set_book (query, gnc_get_current_book());
|
||||
xaccQueryAddSingleAccountMatch (query, importaccount,
|
||||
QOF_QUERY_AND);
|
||||
xaccQueryAddDateMatchTT (query,
|
||||
TRUE, download_time - match_date_hardlimit * 86400,
|
||||
TRUE, download_time + match_date_hardlimit * 86400,
|
||||
QOF_QUERY_AND);
|
||||
list_element = xaccQueryGetSplits (query);
|
||||
list_element = qof_query_run (query);
|
||||
/* Sigh. Doesnt help too much. We still create and run one query
|
||||
for each imported transaction. Maybe it would improve
|
||||
performance further if there is one single (master-)query at
|
||||
@ -825,7 +825,7 @@ void gnc_import_find_split_matches(GNCImportTransInfo *trans_info,
|
||||
list_element = g_list_next (list_element);
|
||||
}
|
||||
|
||||
xaccFreeQuery (query);
|
||||
qof_query_destroy (query);
|
||||
}
|
||||
|
||||
|
||||
|
@ -413,9 +413,9 @@ gnc_ledger_display_gl (void)
|
||||
|
||||
ENTER(" ");
|
||||
|
||||
query = xaccMallocQuery ();
|
||||
query = qof_query_create_for(GNC_ID_SPLIT);
|
||||
|
||||
xaccQuerySetBook (query, gnc_get_current_book());
|
||||
qof_query_set_book (query, gnc_get_current_book());
|
||||
|
||||
/* In lieu of not "mis-using" some portion of the infrastructure by writing
|
||||
* a bunch of new code, we just filter out the accounts of the template
|
||||
@ -472,10 +472,10 @@ gnc_ledger_display_template_gl (char *id)
|
||||
acct = NULL;
|
||||
isTemplateModeTrue = TRUE;
|
||||
|
||||
q = xaccMallocQuery ();
|
||||
q = qof_query_create_for(GNC_ID_SPLIT);
|
||||
|
||||
book = gnc_get_current_book ();
|
||||
xaccQuerySetBook (q, book);
|
||||
qof_query_set_book (q, book);
|
||||
|
||||
if ( id != NULL )
|
||||
{
|
||||
@ -612,7 +612,7 @@ close_handler (gpointer user_data)
|
||||
gnc_split_register_destroy (ld->reg);
|
||||
ld->reg = NULL;
|
||||
|
||||
xaccFreeQuery (ld->query);
|
||||
qof_query_destroy (ld->query);
|
||||
ld->query = NULL;
|
||||
|
||||
g_free (ld);
|
||||
@ -643,17 +643,17 @@ gnc_ledger_display_make_query (GNCLedgerDisplay *ld,
|
||||
return;
|
||||
}
|
||||
|
||||
xaccFreeQuery (ld->query);
|
||||
ld->query = xaccMallocQuery ();
|
||||
qof_query_destroy (ld->query);
|
||||
ld->query = qof_query_create_for(GNC_ID_SPLIT);
|
||||
|
||||
/* This is a bit of a hack. The number of splits should be
|
||||
* configurable, or maybe we should go back a time range instead
|
||||
* of picking a number, or maybe we should be able to exclude
|
||||
* based on reconciled status. Anyway, this works for now. */
|
||||
if ((limit != 0) && (type != SEARCH_LEDGER))
|
||||
xaccQuerySetMaxSplits (ld->query, limit);
|
||||
qof_query_set_max_results (ld->query, limit);
|
||||
|
||||
xaccQuerySetBook (ld->query, gnc_get_current_book());
|
||||
qof_query_set_book (ld->query, gnc_get_current_book());
|
||||
|
||||
leader = gnc_ledger_display_leader (ld);
|
||||
|
||||
@ -778,7 +778,7 @@ gnc_ledger_display_internal (Account *lead_account, Query *q,
|
||||
|
||||
/* set up the query filter */
|
||||
if (q)
|
||||
ld->query = xaccQueryCopy (q);
|
||||
ld->query = qof_query_copy (q);
|
||||
else
|
||||
gnc_ledger_display_make_query (ld, limit, reg_type);
|
||||
|
||||
@ -813,8 +813,8 @@ gnc_ledger_display_set_query (GNCLedgerDisplay *ledger_display, Query *q)
|
||||
|
||||
g_return_if_fail (ledger_display->ld_type == LD_GL);
|
||||
|
||||
xaccFreeQuery (ledger_display->query);
|
||||
ledger_display->query = xaccQueryCopy (q);
|
||||
qof_query_destroy (ledger_display->query);
|
||||
ledger_display->query = qof_query_copy (q);
|
||||
}
|
||||
|
||||
GNCLedgerDisplay *
|
||||
@ -864,7 +864,7 @@ gnc_ledger_display_refresh (GNCLedgerDisplay *ld)
|
||||
return;
|
||||
}
|
||||
|
||||
gnc_ledger_display_refresh_internal (ld, xaccQueryGetSplits (ld->query));
|
||||
gnc_ledger_display_refresh_internal (ld, qof_query_run (ld->query));
|
||||
LEAVE(" ");
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user