Replace obsolete <QueryNew.h> #defines by the current <qof.h> function names.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19932 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Christian Stimming
2010-12-12 21:30:59 +00:00
parent d9b311efb1
commit c8a1ebb93a
38 changed files with 249 additions and 299 deletions
+2 -2
View File
@@ -2363,7 +2363,7 @@ query_restore_end_handler(gpointer data_for_children,
g_return_val_if_fail(qand, FALSE); g_return_val_if_fail(qand, FALSE);
/* append the and terms by or'ing them in ... */ /* append the and terms by or'ing them in ... */
qret = qof_query_merge (q, qand, QUERY_OR); qret = qof_query_merge (q, qand, QOF_QUERY_OR);
if (!qret) if (!qret)
{ {
qof_query_destroy(qand); qof_query_destroy(qand);
@@ -2509,7 +2509,7 @@ qrestore_genericpred_end_handler(gpointer data_for_children,
g_return_val_if_fail(q, FALSE); g_return_val_if_fail(q, FALSE);
g_return_val_if_fail(dp, FALSE); g_return_val_if_fail(dp, FALSE);
xaccQueryAddPredicate (q, dp, QUERY_AND); xaccQueryAddPredicate (q, dp, QOF_QUERY_AND);
return(TRUE); return(TRUE);
} }
@@ -72,7 +72,7 @@ typedef enum
struct _customer_select_window struct _customer_select_window
{ {
QofBook * book; QofBook * book;
QueryNew * q; QofQuery * q;
}; };
struct _customer_window struct _customer_window
@@ -783,14 +783,14 @@ free_userdata_cb (gpointer user_data)
g_return_if_fail (sw); g_return_if_fail (sw);
gncQueryDestroy (sw->q); qof_query_destroy (sw->q);
g_free (sw); g_free (sw);
} }
GNCSearchWindow * GNCSearchWindow *
gnc_customer_search (GncCustomer *start, QofBook *book) gnc_customer_search (GncCustomer *start, QofBook *book)
{ {
QueryNew *q, *q2 = NULL; QofQuery *q, *q2 = NULL;
GNCIdType type = GNC_CUSTOMER_MODULE_NAME; GNCIdType type = GNC_CUSTOMER_MODULE_NAME;
struct _customer_select_window *sw; struct _customer_select_window *sw;
static GList *params = NULL; static GList *params = NULL;
@@ -833,15 +833,15 @@ gnc_customer_search (GncCustomer *start, QofBook *book)
} }
/* Build the queries */ /* Build the queries */
q = gncQueryCreateFor (type); q = qof_query_create_for (type);
gncQuerySetBook (q, book); qof_query_set_book (q, book);
#if 0 #if 0
if (start) if (start)
{ {
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
gncQueryAddGUIDMatch (q2, g_slist_prepend (NULL, QUERY_PARAM_GUID), qof_query_add_guid_match (q2, g_slist_prepend (NULL, QOF_PARAM_GUID),
gncCustomerGetGUID (start), QUERY_AND); gncCustomerGetGUID (start), QOF_QUERY_AND);
} }
#endif #endif
@@ -68,7 +68,7 @@ typedef enum
struct _employee_select_window struct _employee_select_window
{ {
QofBook * book; QofBook * book;
QueryNew * q; QofQuery * q;
}; };
struct _employee_window struct _employee_window
@@ -690,7 +690,7 @@ free_employee_cb (gpointer user_data)
g_return_if_fail (sw); g_return_if_fail (sw);
gncQueryDestroy (sw->q); qof_query_destroy (sw->q);
g_free (sw); g_free (sw);
} }
@@ -699,7 +699,7 @@ gnc_employee_search (GncEmployee *start, QofBook *book)
{ {
GNCIdType type = GNC_EMPLOYEE_MODULE_NAME; GNCIdType type = GNC_EMPLOYEE_MODULE_NAME;
struct _employee_select_window *sw; struct _employee_select_window *sw;
QueryNew *q, *q2 = NULL; QofQuery *q, *q2 = NULL;
static GList *params = NULL; static GList *params = NULL;
static GList *columns = NULL; static GList *columns = NULL;
static GNCSearchCallbackButton buttons[] = static GNCSearchCallbackButton buttons[] =
@@ -735,15 +735,15 @@ gnc_employee_search (GncEmployee *start, QofBook *book)
} }
/* Build the queries */ /* Build the queries */
q = gncQueryCreateFor (type); q = qof_query_create_for (type);
gncQuerySetBook (q, book); qof_query_set_book (q, book);
#if 0 #if 0
if (start) if (start)
{ {
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
gncQueryAddGUIDMatch (q2, g_slist_prepend (NULL, QUERY_PARAM_GUID), qof_query_add_guid_match (q2, g_slist_prepend (NULL, QOF_PARAM_GUID),
gncEmployeeGetGUID (start), QUERY_AND); gncEmployeeGetGUID (start), QOF_QUERY_AND);
} }
#endif #endif
+34 -34
View File
@@ -32,7 +32,7 @@
#include "gncObject.h" #include "gncObject.h"
#include "QueryCore.h" #include "QueryCore.h"
#include "QueryNew.h" #include "qof.h"
#include "dialog-utils.h" #include "dialog-utils.h"
#include "gnc-component-manager.h" #include "gnc-component-manager.h"
@@ -111,7 +111,7 @@ struct _invoice_select_window
{ {
QofBook * book; QofBook * book;
GncOwner * owner; GncOwner * owner;
QueryNew * q; QofQuery * q;
GncOwner owner_def; GncOwner owner_def;
}; };
@@ -912,7 +912,7 @@ void gnc_invoice_window_payment_cb (GtkWidget *widget, gpointer data)
void void
gnc_invoice_window_sort (InvoiceWindow *iw, invoice_sort_type_t sort_code) gnc_invoice_window_sort (InvoiceWindow *iw, invoice_sort_type_t sort_code)
{ {
QueryNew *query = gnc_entry_ledger_get_query (iw->ledger); QofQuery *query = gnc_entry_ledger_get_query (iw->ledger);
GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard; GSList *p1 = NULL, *p2 = NULL, *p3 = NULL, *standard;
if (iw->last_sort == sort_code) if (iw->last_sort == sort_code)
@@ -951,7 +951,7 @@ gnc_invoice_window_sort (InvoiceWindow *iw, invoice_sort_type_t sort_code)
g_return_if_fail (FALSE); g_return_if_fail (FALSE);
} }
gncQuerySetSortOrder (query, p1, p2, p3); qof_query_set_sort_order (query, p1, p2, p3);
iw->last_sort = sort_code; iw->last_sort = sort_code;
gnc_entry_ledger_display_refresh (iw->ledger); gnc_entry_ledger_display_refresh (iw->ledger);
} }
@@ -2366,7 +2366,7 @@ free_invoice_cb (gpointer user_data)
g_return_if_fail (sw); g_return_if_fail (sw);
gncQueryDestroy (sw->q); qof_query_destroy (sw->q);
g_free (sw); g_free (sw);
} }
@@ -2375,7 +2375,7 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
{ {
GNCIdType type = GNC_INVOICE_MODULE_NAME; GNCIdType type = GNC_INVOICE_MODULE_NAME;
struct _invoice_select_window *sw; struct _invoice_select_window *sw;
QueryNew *q, *q2 = NULL; QofQuery *q, *q2 = NULL;
GncOwnerType owner_type = GNC_OWNER_CUSTOMER; GncOwnerType owner_type = GNC_OWNER_CUSTOMER;
static GList *inv_params = NULL, *bill_params = NULL, *emp_params = NULL, *params; static GList *inv_params = NULL, *bill_params = NULL, *emp_params = NULL, *params;
static GList *columns = NULL; static GList *columns = NULL;
@@ -2532,8 +2532,8 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
} }
/* Build the queries */ /* Build the queries */
q = gncQueryCreateFor (type); q = qof_query_create_for (type);
gncQuerySetBook (q, book); qof_query_set_book (q, book);
/* If owner is supplied, limit all searches to invoices who's owner /* If owner is supplied, limit all searches to invoices who's owner
* or end-owner is the supplied owner! Show all invoices by this * or end-owner is the supplied owner! Show all invoices by this
@@ -2561,20 +2561,20 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
*/ */
if (gncOwnerGetGUID (owner)) if (gncOwnerGetGUID (owner))
{ {
q2 = gncQueryCreate (); q2 = qof_query_create ();
gncQueryAddGUIDMatch (q2, g_slist_prepend qof_query_add_guid_match (q2, g_slist_prepend
(g_slist_prepend (NULL, QUERY_PARAM_GUID), (g_slist_prepend (NULL, QOF_PARAM_GUID),
INVOICE_OWNER), INVOICE_OWNER),
gncOwnerGetGUID (owner), QUERY_OR); gncOwnerGetGUID (owner), QOF_QUERY_OR);
gncQueryAddGUIDMatch (q2, g_slist_prepend qof_query_add_guid_match (q2, g_slist_prepend
(g_slist_prepend (NULL, OWNER_PARENTG), (g_slist_prepend (NULL, OWNER_PARENTG),
INVOICE_OWNER), INVOICE_OWNER),
gncOwnerGetGUID (owner), QUERY_OR); gncOwnerGetGUID (owner), QOF_QUERY_OR);
gncQueryMergeInPlace (q, q2, QUERY_AND); qof_query_merge_in_place (q, q2, QOF_QUERY_AND);
gncQueryDestroy (q2); qof_query_destroy (q2);
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
} }
else else
{ {
@@ -2584,7 +2584,7 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
gncInvoiceGetTypeFromOwnerType(owner_type), gncInvoiceGetTypeFromOwnerType(owner_type),
QOF_STRING_MATCH_NORMAL, FALSE); QOF_STRING_MATCH_NORMAL, FALSE);
param_list = g_slist_prepend (param_list, INVOICE_TYPE); param_list = g_slist_prepend (param_list, INVOICE_TYPE);
gncQueryAddTerm (q, param_list, inv_type_pred, QOF_QUERY_AND); qof_query_add_term (q, param_list, inv_type_pred, QOF_QUERY_AND);
} }
} }
@@ -2592,10 +2592,10 @@ gnc_invoice_search (GncInvoice *start, GncOwner *owner, QofBook *book)
if (start) if (start)
{ {
if (q2 == NULL) if (q2 == NULL)
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
gncQueryAddGUIDMatch (q2, g_slist_prepend (NULL, QUERY_PARAM_GUID), qof_query_add_guid_match (q2, g_slist_prepend (NULL, QOF_PARAM_GUID),
gncInvoiceGetGUID (start), QUERY_AND); gncInvoiceGetGUID (start), QOF_QUERY_AND);
} }
#endif #endif
@@ -2695,9 +2695,9 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
} }
/* Create the query to search for invoices; set the book */ /* Create the query to search for invoices; set the book */
q = gncQueryCreate(); q = qof_query_create();
gncQuerySearchFor(q, GNC_INVOICE_MODULE_NAME); qof_query_search_for(q, GNC_INVOICE_MODULE_NAME);
gncQuerySetBook (q, book); qof_query_set_book (q, book);
/* we want to find all invoices where: /* we want to find all invoices where:
* invoice -> is_posted == TRUE * invoice -> is_posted == TRUE
@@ -2706,18 +2706,18 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
* AND invoice -> due >= (today - days_in_advance) * AND invoice -> due >= (today - days_in_advance)
*/ */
gncQueryAddBooleanMatch (q, g_slist_prepend(NULL, INVOICE_IS_POSTED), TRUE, qof_query_add_boolean_match (q, g_slist_prepend(NULL, INVOICE_IS_POSTED), TRUE,
QUERY_AND); QOF_QUERY_AND);
gncQueryAddBooleanMatch (q, g_slist_prepend(g_slist_prepend(NULL, LOT_IS_CLOSED), qof_query_add_boolean_match (q, g_slist_prepend(g_slist_prepend(NULL, LOT_IS_CLOSED),
INVOICE_POST_LOT), FALSE, QUERY_AND); INVOICE_POST_LOT), FALSE, QOF_QUERY_AND);
/* Watch out: Do *not* translate the string "Invoice" here because /* Watch out: Do *not* translate the string "Invoice" here because
it must match the QofObject.type_label string exactly, which it must match the QofObject.type_label string exactly, which
implies it is used in untranslated form! */ implies it is used in untranslated form! */
pred_data = gncQueryStringPredicate (COMPARE_NEQ, "Invoice", pred_data = gncQueryStringPredicate (COMPARE_NEQ, "Invoice",
STRING_MATCH_NORMAL, FALSE); STRING_MATCH_NORMAL, FALSE);
gncQueryAddTerm (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QUERY_AND); qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_TYPE), pred_data, QOF_QUERY_AND);
end_date = time(NULL); end_date = time(NULL);
if (days_in_advance < 0) if (days_in_advance < 0)
@@ -2727,9 +2727,9 @@ gnc_invoice_show_bills_due (QofBook *book, double days_in_advance)
ts.tv_sec = (gint64) end_date; ts.tv_sec = (gint64) end_date;
ts.tv_nsec = 0; ts.tv_nsec = 0;
pred_data = gncQueryDatePredicate (COMPARE_LTE, DATE_MATCH_NORMAL, ts); pred_data = gncQueryDatePredicate (COMPARE_LTE, DATE_MATCH_NORMAL, ts);
gncQueryAddTerm (q, g_slist_prepend(NULL, INVOICE_DUE), pred_data, QUERY_AND); qof_query_add_term (q, g_slist_prepend(NULL, INVOICE_DUE), pred_data, QOF_QUERY_AND);
res = gncQueryRun(q); res = qof_query_run(q);
len = g_list_length (res); len = g_list_length (res);
if (!res || len <= 0) if (!res || len <= 0)
return NULL; return NULL;
+13 -13
View File
@@ -64,7 +64,7 @@ struct _job_select_window
{ {
QofBook * book; QofBook * book;
GncOwner * owner; GncOwner * owner;
QueryNew * q; QofQuery * q;
GncOwner owner_def; GncOwner owner_def;
}; };
@@ -519,14 +519,14 @@ free_userdata_cb (gpointer user_data)
g_return_if_fail (sw); g_return_if_fail (sw);
gncQueryDestroy (sw->q); qof_query_destroy (sw->q);
g_free (sw); g_free (sw);
} }
GNCSearchWindow * GNCSearchWindow *
gnc_job_search (GncJob *start, GncOwner *owner, QofBook *book) gnc_job_search (GncJob *start, GncOwner *owner, QofBook *book)
{ {
QueryNew *q, *q2 = NULL; QofQuery *q, *q2 = NULL;
GNCIdType type = GNC_JOB_MODULE_NAME; GNCIdType type = GNC_JOB_MODULE_NAME;
struct _job_select_window *sw; struct _job_select_window *sw;
static GList *params = NULL; static GList *params = NULL;
@@ -570,8 +570,8 @@ gnc_job_search (GncJob *start, GncOwner *owner, QofBook *book)
} }
/* Build the queries */ /* Build the queries */
q = gncQueryCreateFor (type); q = qof_query_create_for (type);
gncQuerySetBook (q, book); qof_query_set_book (q, book);
/* If we have a start job but, for some reason, not an owner -- grab /* If we have a start job but, for some reason, not an owner -- grab
* the owner from the starting job. * the owner from the starting job.
@@ -584,22 +584,22 @@ gnc_job_search (GncJob *start, GncOwner *owner, QofBook *book)
*/ */
if (owner && gncOwnerGetGUID (owner)) if (owner && gncOwnerGetGUID (owner))
{ {
gncQueryAddGUIDMatch (q, g_slist_prepend qof_query_add_guid_match (q, g_slist_prepend
(g_slist_prepend (NULL, QUERY_PARAM_GUID), (g_slist_prepend (NULL, QOF_PARAM_GUID),
JOB_OWNER), JOB_OWNER),
gncOwnerGetGUID (owner), QUERY_AND); gncOwnerGetGUID (owner), QOF_QUERY_AND);
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
} }
#if 0 #if 0
if (start) if (start)
{ {
if (q2 == NULL) if (q2 == NULL)
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
gncQueryAddGUIDMatch (q2, g_slist_prepend (NULL, QUERY_PARAM_GUID), qof_query_add_guid_match (q2, g_slist_prepend (NULL, QOF_PARAM_GUID),
gncJobGetGUID (start), QUERY_AND); gncJobGetGUID (start), QOF_QUERY_AND);
} }
#endif #endif
+22 -22
View File
@@ -70,7 +70,7 @@ struct _order_select_window
{ {
QofBook * book; QofBook * book;
GncOwner * owner; GncOwner * owner;
QueryNew * q; QofQuery * q;
GncOwner owner_def; GncOwner owner_def;
}; };
@@ -814,7 +814,7 @@ free_order_cb (gpointer user_data)
g_return_if_fail (sw); g_return_if_fail (sw);
gncQueryDestroy (sw->q); qof_query_destroy (sw->q);
g_free (sw); g_free (sw);
} }
@@ -823,7 +823,7 @@ gnc_order_search (GncOrder *start, GncOwner *owner, QofBook *book)
{ {
GNCIdType type = GNC_ORDER_MODULE_NAME; GNCIdType type = GNC_ORDER_MODULE_NAME;
struct _order_select_window *sw; struct _order_select_window *sw;
QueryNew *q, *q2 = NULL; QofQuery *q, *q2 = NULL;
static GList *params = NULL; static GList *params = NULL;
static GList *columns = NULL; static GList *columns = NULL;
static GNCSearchCallbackButton buttons[] = static GNCSearchCallbackButton buttons[] =
@@ -868,41 +868,41 @@ gnc_order_search (GncOrder *start, GncOwner *owner, QofBook *book)
} }
/* Build the queries */ /* Build the queries */
q = gncQueryCreateFor (type); q = qof_query_create_for (type);
gncQuerySetBook (q, book); qof_query_set_book (q, book);
/* If owner is supplied, limit all searches to orders who's owner /* If owner is supplied, limit all searches to orders who's owner
* (or parent) is the supplied owner! * (or parent) is the supplied owner!
*/ */
if (owner && gncOwnerGetGUID (owner)) if (owner && gncOwnerGetGUID (owner))
{ {
QueryNew *tmp, *q3; QofQuery *tmp, *q3;
q3 = gncQueryCreateFor (type); q3 = qof_query_create_for (type);
gncQueryAddGUIDMatch (q3, g_slist_prepend qof_query_add_guid_match (q3, g_slist_prepend
(g_slist_prepend (NULL, QUERY_PARAM_GUID), (g_slist_prepend (NULL, QOF_PARAM_GUID),
ORDER_OWNER), ORDER_OWNER),
gncOwnerGetGUID (owner), QUERY_OR); gncOwnerGetGUID (owner), QOF_QUERY_OR);
gncQueryAddGUIDMatch (q3, g_slist_prepend qof_query_add_guid_match (q3, g_slist_prepend
(g_slist_prepend (NULL, OWNER_PARENTG), (g_slist_prepend (NULL, OWNER_PARENTG),
ORDER_OWNER), ORDER_OWNER),
gncOwnerGetGUID (owner), QUERY_OR); gncOwnerGetGUID (owner), QOF_QUERY_OR);
tmp = gncQueryMerge (q, q3, QUERY_AND); tmp = qof_query_merge (q, q3, QOF_QUERY_AND);
gncQueryDestroy (q); qof_query_destroy (q);
gncQueryDestroy (q3); qof_query_destroy (q3);
q = tmp; q = tmp;
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
} }
#if 0 #if 0
if (start) if (start)
{ {
if (q2 == NULL) if (q2 == NULL)
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
gncQueryAddGUIDMatch (q2, g_slist_prepend (NULL, QUERY_PARAM_GUID), qof_query_add_guid_match (q2, g_slist_prepend (NULL, QOF_PARAM_GUID),
gncOrderGetGUID (start), QUERY_AND); gncOrderGetGUID (start), QOF_QUERY_AND);
} }
#endif #endif
+8 -8
View File
@@ -68,7 +68,7 @@ typedef enum
struct _vendor_select_window struct _vendor_select_window
{ {
QofBook * book; QofBook * book;
QueryNew * q; QofQuery * q;
}; };
struct _vendor_window struct _vendor_window
@@ -645,7 +645,7 @@ free_vendor_cb (gpointer user_data)
struct _vendor_select_window *sw = user_data; struct _vendor_select_window *sw = user_data;
g_return_if_fail (sw); g_return_if_fail (sw);
gncQueryDestroy (sw->q); qof_query_destroy (sw->q);
g_free (sw); g_free (sw);
} }
@@ -654,7 +654,7 @@ gnc_vendor_search (GncVendor *start, QofBook *book)
{ {
GNCIdType type = GNC_VENDOR_MODULE_NAME; GNCIdType type = GNC_VENDOR_MODULE_NAME;
struct _vendor_select_window *sw; struct _vendor_select_window *sw;
QueryNew *q, *q2 = NULL; QofQuery *q, *q2 = NULL;
static GList *params = NULL; static GList *params = NULL;
static GList *columns = NULL; static GList *columns = NULL;
static GNCSearchCallbackButton buttons[] = static GNCSearchCallbackButton buttons[] =
@@ -693,15 +693,15 @@ gnc_vendor_search (GncVendor *start, QofBook *book)
} }
/* Build the queries */ /* Build the queries */
q = gncQueryCreateFor (type); q = qof_query_create_for (type);
gncQuerySetBook (q, book); qof_query_set_book (q, book);
#if 0 #if 0
if (start) if (start)
{ {
q2 = gncQueryCopy (q); q2 = qof_query_copy (q);
gncQueryAddGUIDMatch (q2, g_slist_prepend (NULL, QUERY_PARAM_GUID), qof_query_add_guid_match (q2, g_slist_prepend (NULL, QOF_PARAM_GUID),
gncVendorGetGUID (start), QUERY_AND); gncVendorGetGUID (start), QOF_QUERY_AND);
} }
#endif #endif
+1 -1
View File
@@ -23,7 +23,7 @@
#define _GNCSEARCH_OWNER_H #define _GNCSEARCH_OWNER_H
#include "search-core-type.h" #include "search-core-type.h"
#include "QueryNew.h" #include "qof.h"
#define GNC_TYPE_SEARCH_OWNER (gnc_search_owner_get_type ()) #define GNC_TYPE_SEARCH_OWNER (gnc_search_owner_get_type ())
#define GNCSEARCH_OWNER(obj) GTK_CHECK_CAST (obj, gnc_search_owner_get_type (), GNCSearchOwner) #define GNCSEARCH_OWNER(obj) GTK_CHECK_CAST (obj, gnc_search_owner_get_type (), GNCSearchOwner)
+43 -43
View File
@@ -376,7 +376,7 @@ void gnc_entry_ledger_destroy (GncEntryLedger *ledger)
gnc_entry_ledger_clear_blank_entry (ledger); gnc_entry_ledger_clear_blank_entry (ledger);
gnc_entry_ledger_display_fini (ledger); gnc_entry_ledger_display_fini (ledger);
gnc_table_destroy (ledger->table); gnc_table_destroy (ledger->table);
gncQueryDestroy (ledger->query); qof_query_destroy (ledger->query);
g_free (ledger); g_free (ledger);
} }
@@ -394,27 +394,27 @@ void gnc_entry_ledger_set_default_order (GncEntryLedger *ledger,
if (!ledger->query && order) if (!ledger->query && order)
{ {
ledger->query = gncQueryCreateFor (GNC_ENTRY_MODULE_NAME); ledger->query = qof_query_create_for (GNC_ENTRY_MODULE_NAME);
gncQuerySetBook (ledger->query, gncOrderGetBook (order)); qof_query_set_book (ledger->query, gncOrderGetBook (order));
gncQueryAddGUIDMatch (ledger->query, qof_query_add_guid_match (ledger->query,
g_slist_prepend (g_slist_prepend (NULL, g_slist_prepend (g_slist_prepend (NULL,
QUERY_PARAM_GUID), QOF_PARAM_GUID),
ENTRY_ORDER), ENTRY_ORDER),
gncOrderGetGUID (order), QUERY_AND); gncOrderGetGUID (order), QOF_QUERY_AND);
} }
gnc_entry_ledger_display_refresh (ledger); gnc_entry_ledger_display_refresh (ledger);
} }
static void create_invoice_query (GncEntryLedger *ledger) static void create_invoice_query (GncEntryLedger *ledger)
{ {
QueryNew *q, *q1; QofQuery *q, *q1;
char * type = NULL; char * type = NULL;
if (!ledger->invoice) if (!ledger->invoice)
return; return;
if (ledger->query) if (ledger->query)
gncQueryDestroy (ledger->query); qof_query_destroy (ledger->query);
/* Match: (where I-TYPE == Invoice or Bill) /* Match: (where I-TYPE == Invoice or Bill)
* *
@@ -436,8 +436,8 @@ static void create_invoice_query (GncEntryLedger *ledger)
*/ */
/* Term 1 */ /* Term 1 */
ledger->query = gncQueryCreateFor (GNC_ENTRY_MODULE_NAME); ledger->query = qof_query_create_for (GNC_ENTRY_MODULE_NAME);
gncQuerySetBook (ledger->query, gncInvoiceGetBook (ledger->invoice)); qof_query_set_book (ledger->query, gncInvoiceGetBook (ledger->invoice));
/* Term 2 */ /* Term 2 */
switch (ledger->type) switch (ledger->type)
@@ -458,9 +458,9 @@ static void create_invoice_query (GncEntryLedger *ledger)
break; break;
} }
q = gncQueryCreateFor (GNC_ENTRY_MODULE_NAME); q = qof_query_create_for (GNC_ENTRY_MODULE_NAME);
gncQueryAddGUIDMatch (q, gncQueryBuildParamList (type, QUERY_PARAM_GUID, NULL), qof_query_add_guid_match (q, qof_query_build_param_list (type, QOF_PARAM_GUID, NULL),
gncInvoiceGetGUID (ledger->invoice), QUERY_OR); gncInvoiceGetGUID (ledger->invoice), QOF_QUERY_OR);
/* Term 3 */ /* Term 3 */
if (ledger->type == GNCENTRY_INVOICE_ENTRY && if (ledger->type == GNCENTRY_INVOICE_ENTRY &&
@@ -469,52 +469,52 @@ static void create_invoice_query (GncEntryLedger *ledger)
const GncGUID *invoice_parent = const GncGUID *invoice_parent =
gncOwnerGetGUID (gncInvoiceGetOwner (ledger->invoice)); gncOwnerGetGUID (gncInvoiceGetOwner (ledger->invoice));
QueryNew *q2 = gncQueryCreateFor (GNC_ENTRY_MODULE_NAME); QofQuery *q2 = qof_query_create_for (GNC_ENTRY_MODULE_NAME);
/* /*
* Entry->BillTo == Invoice->parent OR * Entry->BillTo == Invoice->parent OR
* ( Entry->BillTo == NULL AND Entry->Bill->BillTo == Invoice->parent ) * ( Entry->BillTo == NULL AND Entry->Bill->BillTo == Invoice->parent )
*/ */
gncQueryAddGUIDMatch (q2, gncQueryBuildParamList (ENTRY_BILLTO, qof_query_add_guid_match (q2, qof_query_build_param_list (ENTRY_BILLTO,
QUERY_PARAM_GUID, NULL), QOF_PARAM_GUID, NULL),
NULL, QUERY_AND); NULL, QOF_QUERY_AND);
gncQueryAddGUIDMatch (q2, gncQueryBuildParamList (ENTRY_BILL, INVOICE_BILLTO, qof_query_add_guid_match (q2, qof_query_build_param_list (ENTRY_BILL, INVOICE_BILLTO,
QUERY_PARAM_GUID, NULL), QOF_PARAM_GUID, NULL),
invoice_parent, QUERY_AND); invoice_parent, QOF_QUERY_AND);
gncQueryAddGUIDMatch (q2, gncQueryBuildParamList (ENTRY_BILLTO, qof_query_add_guid_match (q2, qof_query_build_param_list (ENTRY_BILLTO,
QUERY_PARAM_GUID, NULL), QOF_PARAM_GUID, NULL),
invoice_parent, QUERY_OR); invoice_parent, QOF_QUERY_OR);
/* Entry->Billable == TRUE AND Entry->Bill->Is-Posted? == TRUE */ /* Entry->Billable == TRUE AND Entry->Bill->Is-Posted? == TRUE */
gncQueryAddBooleanMatch (q2, gncQueryBuildParamList (ENTRY_BILLABLE, NULL), qof_query_add_boolean_match (q2, qof_query_build_param_list (ENTRY_BILLABLE, NULL),
TRUE, QUERY_AND); TRUE, QOF_QUERY_AND);
gncQueryAddBooleanMatch (q2, gncQueryBuildParamList (ENTRY_BILL, qof_query_add_boolean_match (q2, qof_query_build_param_list (ENTRY_BILL,
INVOICE_IS_POSTED, NULL), INVOICE_IS_POSTED, NULL),
TRUE, QUERY_AND); TRUE, QOF_QUERY_AND);
/* Entry->Order->real-parent == Invoice->parent */ /* Entry->Order->real-parent == Invoice->parent */
gncQueryAddGUIDMatch (q2, gncQueryBuildParamList (ENTRY_ORDER, ORDER_OWNER, qof_query_add_guid_match (q2, qof_query_build_param_list (ENTRY_ORDER, ORDER_OWNER,
OWNER_PARENTG, NULL), OWNER_PARENTG, NULL),
invoice_parent, QUERY_OR); invoice_parent, QOF_QUERY_OR);
/* Entry->Invoice == NULL */ /* Entry->Invoice == NULL */
gncQueryAddGUIDMatch (q2, gncQueryBuildParamList (ENTRY_INVOICE, qof_query_add_guid_match (q2, qof_query_build_param_list (ENTRY_INVOICE,
QUERY_PARAM_GUID, NULL), QOF_PARAM_GUID, NULL),
NULL, QUERY_AND); NULL, QOF_QUERY_AND);
/* Combine terms 2 and 3 */ /* Combine terms 2 and 3 */
q1 = gncQueryMerge (q, q2, QUERY_OR); q1 = qof_query_merge (q, q2, QOF_QUERY_OR);
gncQueryDestroy (q); qof_query_destroy (q);
gncQueryDestroy (q2); qof_query_destroy (q2);
q = q1; q = q1;
} }
/* Combine terms 1 and 2 */ /* Combine terms 1 and 2 */
q1 = gncQueryMerge (ledger->query, q, QUERY_AND); q1 = qof_query_merge (ledger->query, q, QOF_QUERY_AND);
gncQueryDestroy (q); qof_query_destroy (q);
gncQueryDestroy (ledger->query); qof_query_destroy (ledger->query);
ledger->query = q1; ledger->query = q1;
} }
@@ -882,7 +882,7 @@ gnc_entry_ledger_duplicate_current_entry (GncEntryLedger *ledger)
return; return;
} }
QueryNew * QofQuery *
gnc_entry_ledger_get_query (GncEntryLedger *ledger) gnc_entry_ledger_get_query (GncEntryLedger *ledger)
{ {
if (!ledger) if (!ledger)
@@ -24,7 +24,7 @@
#ifndef GNC_ENTRY_LEDGER_H #ifndef GNC_ENTRY_LEDGER_H
#define GNC_ENTRY_LEDGER_H #define GNC_ENTRY_LEDGER_H
#include "QueryNew.h" #include "qof.h"
#include "gncEntry.h" #include "gncEntry.h"
#include "gncOrder.h" #include "gncOrder.h"
#include "table-allgui.h" #include "table-allgui.h"
@@ -138,7 +138,7 @@ gboolean gnc_entry_ledger_get_entry_virt_loc (GncEntryLedger *ledger,
void gnc_entry_ledger_delete_current_entry (GncEntryLedger *ledger); void gnc_entry_ledger_delete_current_entry (GncEntryLedger *ledger);
void gnc_entry_ledger_duplicate_current_entry (GncEntryLedger *ledger); void gnc_entry_ledger_duplicate_current_entry (GncEntryLedger *ledger);
QueryNew * gnc_entry_ledger_get_query (GncEntryLedger *ledger); QofQuery * gnc_entry_ledger_get_query (GncEntryLedger *ledger);
void gnc_entry_ledger_set_gconf_section (GncEntryLedger *ledger, const gchar *string); void gnc_entry_ledger_set_gconf_section (GncEntryLedger *ledger, const gchar *string);
@@ -256,8 +256,8 @@ static QofQuery *new_query_for_entry_desc(GncEntryLedger *reg, const char* desc)
g_assert(desc); g_assert(desc);
/* The query itself and its book */ /* The query itself and its book */
query = gncQueryCreateFor (GNC_ID_ENTRY); query = qof_query_create_for (GNC_ID_ENTRY);
gncQuerySetBook (query, reg->book); qof_query_set_book (query, reg->book);
/* Predicate data: We want to compare one string, namely the given /* Predicate data: We want to compare one string, namely the given
* argument */ * argument */
@@ -41,7 +41,7 @@ static GList *
gnc_entry_ledger_get_entries (GncEntryLedger *ledger) gnc_entry_ledger_get_entries (GncEntryLedger *ledger)
{ {
if (ledger->query) if (ledger->query)
return gncQueryRun (ledger->query); return qof_query_run (ledger->query);
// g_warning ("No query to run?"); // g_warning ("No query to run?");
return NULL; return NULL;
@@ -47,7 +47,7 @@ struct GncEntryLedger_s
Table * table; Table * table;
GncOrder * order; GncOrder * order;
GncInvoice * invoice; GncInvoice * invoice;
QueryNew * query; QofQuery * query;
GncEntryLedgerType type; GncEntryLedgerType type;
-1
View File
@@ -25,7 +25,6 @@ SET (libgncmod_engine_HEADERS
SX-book.h SX-book.h
SX-ttinfo.h SX-ttinfo.h
Query.h Query.h
QueryNew.h
QueryObject.h QueryObject.h
QueryCore.h QueryCore.h
Scrub.h Scrub.h
-1
View File
@@ -72,7 +72,6 @@ gncinclude_HEADERS = \
SX-book.h \ SX-book.h \
SX-ttinfo.h \ SX-ttinfo.h \
Query.h \ Query.h \
QueryNew.h \
QueryObject.h \ QueryObject.h \
QueryCore.h \ QueryCore.h \
Scrub.h \ Scrub.h \
-48
View File
@@ -1,48 +0,0 @@
#include "qof.h"
#define QUERY_AND QOF_QUERY_AND
#define QUERY_OR QOF_QUERY_OR
#define QUERY_NAND QOF_QUERY_NAND
#define QUERY_NOR QOF_QUERY_NOR
#define QUERY_XOR QOF_QUERY_XOR
#define QUERY_PARAM_BOOK QOF_PARAM_BOOK
#define QUERY_PARAM_GUID QOF_PARAM_GUID
#define QUERY_PARAM_ACTIVE QOF_PARAM_ACTIVE
#define querynew_s _QofQuery
#define QueryNew QofQuery
#define QueryOp QofQueryOp
#define query_new_term _QofQueryTerm
#define query_new_sort _QofSortFunc
#define gncQueryBuildParamList qof_query_build_param_list
#define gncQueryCreate qof_query_create
#define gncQueryCreateFor qof_query_create_for
#define gncQueryDestroy qof_query_destroy
#define gncQuerySearchFor qof_query_search_for
#define gncQuerySetBook qof_query_set_book
#define gncQueryAddTerm qof_query_add_term
#define gncQueryAddGUIDMatch qof_query_add_guid_match
#define gncQueryAddGUIDListMatch qof_query_add_guid_list_match
#define gncQueryAddBooleanMatch qof_query_add_boolean_match
#define gncQueryRun qof_query_run
#define gncQueryLastRun qof_query_last_run
#define gncQueryClear qof_query_clear
#define gncQueryPurgeTerms qof_query_purge_terms
#define gncQueryHasTerms qof_query_has_terms
#define gncQueryNumTerms qof_query_num_terms
#define gncQueryHasTermType qof_query_has_term_type
#define gncQueryCopy qof_query_copy
#define gncQueryInvert qof_query_invert
#define gncQueryMerge qof_query_merge
#define gncQueryMergeInPlace qof_query_merge_in_place
#define gncQuerySetSortOrder qof_query_set_sort_order
#define gncQuerySetSortOptions qof_query_set_sort_options
#define gncQuerySetSortIncreasing qof_query_set_sort_increasing
#define gncQuerySetMaxResults qof_query_set_max_results
#define gncQueryEqual qof_query_equal
#define gncQueryPrint qof_query_print
#define gncQueryGetSearchFor qof_query_get_search_for
#define gncQueryGetBooks qof_query_get_books
+8 -8
View File
@@ -77,7 +77,7 @@ static void * search(QofBook * book, const gchar *id, void * object, GNCIdType t
{ {
void *c; void *c;
GList *result; GList *result;
QueryNew *q; QofQuery *q;
gint len; gint len;
QueryPredData_t string_pred_data; QueryPredData_t string_pred_data;
g_return_val_if_fail (type, NULL); g_return_val_if_fail (type, NULL);
@@ -85,29 +85,29 @@ static void * search(QofBook * book, const gchar *id, void * object, GNCIdType t
g_return_val_if_fail (book, NULL); g_return_val_if_fail (book, NULL);
// Build the query // Build the query
q = gncQueryCreateFor (type); q = qof_query_create_for (type);
gncQuerySetBook (q, book); qof_query_set_book (q, book);
// Search only the id field // Search only the id field
string_pred_data = gncQueryStringPredicate (COMPARE_EQUAL, id, STRING_MATCH_NORMAL, FALSE); string_pred_data = gncQueryStringPredicate (COMPARE_EQUAL, id, STRING_MATCH_NORMAL, FALSE);
if (strcmp(type, GNC_CUSTOMER_MODULE_NAME)) if (strcmp(type, GNC_CUSTOMER_MODULE_NAME))
{ {
GncCustomer *c = NULL; GncCustomer *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("CUSTOMER_ID"), string_pred_data, QUERY_AND); qof_query_add_term (q, qof_query_build_param_list("CUSTOMER_ID"), string_pred_data, QOF_QUERY_AND);
} }
else if (strcmp(type, GNC_INVOICE_MODULE_NAME)) else if (strcmp(type, GNC_INVOICE_MODULE_NAME))
{ {
GncInvoice *c = NULL; GncInvoice *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("INVOICE_ID"), string_pred_data, QUERY_AND); qof_query_add_term (q, qof_query_build_param_list("INVOICE_ID"), string_pred_data, QOF_QUERY_AND);
} }
else if (strcmp(type, GNC_VENDOR_MODULE_NAME)) else if (strcmp(type, GNC_VENDOR_MODULE_NAME))
{ {
GncVendor *c = NULL; GncVendor *c = NULL;
gncQueryAddTerm (q, gncQueryBuildParamList("VENDOR_ID"), string_pred_data, QUERY_AND); qof_query_add_term (q, qof_query_build_param_list("VENDOR_ID"), string_pred_data, QOF_QUERY_AND);
} }
// Run the query // Run the query
result = gncQueryRun (q); result = qof_query_run (q);
// now compare _exactly_ // now compare _exactly_
len = g_list_length (result); len = g_list_length (result);
@@ -126,6 +126,6 @@ static void * search(QofBook * book, const gchar *id, void * object, GNCIdType t
result = g_list_next (result); result = g_list_next (result);
} }
} }
gncQueryDestroy (q); qof_query_destroy (q);
return object; return object;
} }
+1 -1
View File
@@ -33,7 +33,7 @@
#include "gncBusiness.h" #include "gncBusiness.h"
// query // query
#include "QueryCore.h" #include "QueryCore.h"
#include "QueryNew.h" #include "qof.h"
#include "GNCId.h" #include "GNCId.h"
+1 -1
View File
@@ -66,7 +66,7 @@ main (int argc, char *argv[])
/* In real life, we would use a query as specified by the user */ /* In real life, we would use a query as specified by the user */
xaccQueryAddDateMatch (q, TRUE, 28, 2, 1982, xaccQueryAddDateMatch (q, TRUE, 28, 2, 1982,
FALSE, 16, 10, 2010, FALSE, 16, 10, 2010,
QUERY_OR); QOF_QUERY_OR);
split_list = qof_query_run (q); split_list = qof_query_run (q);
+39 -39
View File
@@ -36,7 +36,7 @@
#include "gnc-query-list.h" #include "gnc-query-list.h"
#include "gnc-gconf-utils.h" #include "gnc-gconf-utils.h"
#include "gncObject.h" #include "gncObject.h"
#include "QueryNew.h" #include "qof.h"
#include "QueryObject.h" #include "QueryObject.h"
#include "QueryCore.h" #include "QueryCore.h"
@@ -111,8 +111,8 @@ struct _GNCSearchWindow
int search_type; /* New, Narrow, Add, Delete */ int search_type; /* New, Narrow, Add, Delete */
/* Our query status */ /* Our query status */
QueryNew * q; QofQuery * q;
QueryNew * start_q; /* The query to start from, if any */ QofQuery * start_q; /* The query to start from, if any */
/* The list of criteria */ /* The list of criteria */
GNCSearchParam * last_param; GNCSearchParam * last_param;
@@ -349,33 +349,33 @@ static void
search_update_query (GNCSearchWindow *sw) search_update_query (GNCSearchWindow *sw)
{ {
static GSList *active_params = NULL; static GSList *active_params = NULL;
QueryNew *q, *q2, *new_q; QofQuery *q, *q2, *new_q;
GList *node; GList *node;
QueryOp op; QofQueryOp op;
QueryPredData_t pdata; QueryPredData_t pdata;
if (sw->grouping == GNC_SEARCH_MATCH_ANY) if (sw->grouping == GNC_SEARCH_MATCH_ANY)
op = QUERY_OR; op = QOF_QUERY_OR;
else else
op = QUERY_AND; op = QOF_QUERY_AND;
if (active_params == NULL) if (active_params == NULL)
active_params = g_slist_prepend (NULL, QUERY_PARAM_ACTIVE); active_params = g_slist_prepend (NULL, QOF_PARAM_ACTIVE);
/* Make sure we supply a book! */ /* Make sure we supply a book! */
if (sw->start_q == NULL) if (sw->start_q == NULL)
{ {
sw->start_q = gncQueryCreateFor (sw->search_for); sw->start_q = qof_query_create_for (sw->search_for);
gncQuerySetBook (sw->start_q, gnc_get_current_book ()); qof_query_set_book (sw->start_q, gnc_get_current_book ());
} }
else else
{ {
/* We've got a query -- purge it of any "active" parameters */ /* We've got a query -- purge it of any "active" parameters */
gncQueryPurgeTerms (sw->start_q, active_params); qof_query_purge_terms (sw->start_q, active_params);
} }
/* Now create a new query to work from */ /* Now create a new query to work from */
q = gncQueryCreateFor (sw->search_for); q = qof_query_create_for (sw->search_for);
/* Walk the list of criteria */ /* Walk the list of criteria */
for (node = sw->crit_list; node; node = node->next) for (node = sw->crit_list; node; node = node->next)
@@ -384,8 +384,8 @@ search_update_query (GNCSearchWindow *sw)
pdata = gnc_search_core_type_get_predicate (data->element); pdata = gnc_search_core_type_get_predicate (data->element);
if (pdata) if (pdata)
gncQueryAddTerm (q, gnc_search_param_get_param_path (data->param), qof_query_add_term (q, gnc_search_param_get_param_path (data->param),
pdata, op); pdata, op);
} }
/* Now combine this query with the existing query, depending on /* Now combine this query with the existing query, depending on
@@ -396,22 +396,22 @@ search_update_query (GNCSearchWindow *sw)
switch (sw->search_type) switch (sw->search_type)
{ {
case 0: /* New */ case 0: /* New */
new_q = gncQueryMerge (sw->start_q, q, QUERY_AND); new_q = qof_query_merge (sw->start_q, q, QOF_QUERY_AND);
gncQueryDestroy (q); qof_query_destroy (q);
break; break;
case 1: /* Refine */ case 1: /* Refine */
new_q = gncQueryMerge (sw->q, q, QUERY_AND); new_q = qof_query_merge (sw->q, q, QOF_QUERY_AND);
gncQueryDestroy (q); qof_query_destroy (q);
break; break;
case 2: /* Add */ case 2: /* Add */
new_q = gncQueryMerge (sw->q, q, QUERY_OR); new_q = qof_query_merge (sw->q, q, QOF_QUERY_OR);
gncQueryDestroy (q); qof_query_destroy (q);
break; break;
case 3: /* Delete */ case 3: /* Delete */
q2 = gncQueryInvert (q); q2 = qof_query_invert (q);
new_q = gncQueryMerge (sw->q, q2, QUERY_AND); new_q = qof_query_merge (sw->q, q2, QOF_QUERY_AND);
gncQueryDestroy (q2); qof_query_destroy (q2);
gncQueryDestroy (q); qof_query_destroy (q);
break; break;
default: default:
g_warning ("bad search type: %d", sw->search_type); g_warning ("bad search type: %d", sw->search_type);
@@ -421,13 +421,13 @@ search_update_query (GNCSearchWindow *sw)
if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sw->active_only_check))) if (gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (sw->active_only_check)))
{ {
gncQueryAddBooleanMatch (new_q, active_params, TRUE, QUERY_AND); qof_query_add_boolean_match (new_q, active_params, TRUE, QOF_QUERY_AND);
active_params = NULL; active_params = NULL;
} }
/* Destroy the old query */ /* Destroy the old query */
if (sw->q) if (sw->q)
gncQueryDestroy (sw->q); qof_query_destroy (sw->q);
/* And save the new one */ /* And save the new one */
sw->q = new_q; sw->q = new_q;
@@ -523,21 +523,21 @@ search_new_item_cb (GtkButton *button, GNCSearchWindow *sw)
if (res) if (res)
{ {
const GncGUID *guid = (const GncGUID *) ((sw->get_guid->param_getfcn)(res, sw->get_guid)); const GncGUID *guid = (const GncGUID *) ((sw->get_guid->param_getfcn)(res, sw->get_guid));
QueryOp op = QUERY_OR; QofQueryOp op = QOF_QUERY_OR;
if (!sw->q) if (!sw->q)
{ {
if (!sw->start_q) if (!sw->start_q)
{ {
sw->start_q = gncQueryCreateFor (sw->search_for); sw->start_q = qof_query_create_for (sw->search_for);
gncQuerySetBook (sw->start_q, gnc_get_current_book ()); qof_query_set_book (sw->start_q, gnc_get_current_book ());
} }
sw->q = gncQueryCopy (sw->start_q); sw->q = qof_query_copy (sw->start_q);
op = QUERY_AND; op = QOF_QUERY_AND;
} }
gncQueryAddGUIDMatch (sw->q, g_slist_prepend (NULL, QUERY_PARAM_GUID), qof_query_add_guid_match (sw->q, g_slist_prepend (NULL, QOF_PARAM_GUID),
guid, op); guid, op);
/* Watch this entity so we'll refresh once it's actually changed */ /* Watch this entity so we'll refresh once it's actually changed */
gnc_gui_component_watch_entity (sw->component_id, guid, QOF_EVENT_MODIFY); gnc_gui_component_watch_entity (sw->component_id, guid, QOF_EVENT_MODIFY);
@@ -793,8 +793,8 @@ gnc_search_dialog_close_cb (GtkDialog *dialog, GNCSearchWindow *sw)
g_list_free (sw->crit_list); g_list_free (sw->crit_list);
/* Destroy the queries */ /* Destroy the queries */
if (sw->q) gncQueryDestroy (sw->q); if (sw->q) qof_query_destroy (sw->q);
if (sw->start_q) gncQueryDestroy (sw->start_q); if (sw->start_q) qof_query_destroy (sw->start_q);
/* Destroy the user_data */ /* Destroy the user_data */
if (sw->free_cb) if (sw->free_cb)
@@ -939,7 +939,7 @@ gnc_search_dialog_init_widgets (GNCSearchWindow *sw, const gchar *title)
/* Figure out if we this object-type has an "active" parameter, and /* Figure out if we this object-type has an "active" parameter, and
* if not, then set the active-check button insensitive * if not, then set the active-check button insensitive
*/ */
if (gncQueryObjectGetParameter (sw->search_for, QUERY_PARAM_ACTIVE) == NULL) if (gncQueryObjectGetParameter (sw->search_for, QOF_PARAM_ACTIVE) == NULL)
gtk_widget_set_sensitive (sw->active_only_check, FALSE); gtk_widget_set_sensitive (sw->active_only_check, FALSE);
/* Deal with the cancel button */ /* Deal with the cancel button */
@@ -1026,7 +1026,7 @@ GNCSearchWindow *
gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title, gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title,
GList *param_list, GList *param_list,
GList *display_list, GList *display_list,
QueryNew *start_query, QueryNew *show_start_query, QofQuery *start_query, QofQuery *show_start_query,
GNCSearchCallbackButton *callbacks, GNCSearchCallbackButton *callbacks,
GNCSearchResultCB result_callback, GNCSearchResultCB result_callback,
GNCSearchNewItemCB new_item_cb, GNCSearchNewItemCB new_item_cb,
@@ -1061,7 +1061,7 @@ gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title,
/* Grab the get_guid function */ /* Grab the get_guid function */
sw->get_guid = qof_class_get_parameter (sw->search_for, QOF_PARAM_GUID); sw->get_guid = qof_class_get_parameter (sw->search_for, QOF_PARAM_GUID);
if (start_query) if (start_query)
sw->start_q = gncQueryCopy (start_query); sw->start_q = qof_query_copy (start_query);
sw->q = show_start_query; sw->q = show_start_query;
gnc_search_dialog_init_widgets (sw, title); gnc_search_dialog_init_widgets (sw, title);
@@ -1140,7 +1140,7 @@ get_params_list (GNCIdTypeConst type)
type, SPLIT_TRANS, TRANS_SPLITLIST, type, SPLIT_TRANS, TRANS_SPLITLIST,
SPLIT_ACCOUNT_GUID, NULL); SPLIT_ACCOUNT_GUID, NULL);
list = gnc_search_param_prepend (list, "Split Account", GNC_ID_ACCOUNT, list = gnc_search_param_prepend (list, "Split Account", GNC_ID_ACCOUNT,
type, SPLIT_ACCOUNT, QUERY_PARAM_GUID, type, SPLIT_ACCOUNT, QOF_PARAM_GUID,
NULL); NULL);
list = gnc_search_param_prepend (list, "Split->Txn->Void?", NULL, type, list = gnc_search_param_prepend (list, "Split->Txn->Void?", NULL, type,
SPLIT_TRANS, TRANS_VOID_STATUS, NULL); SPLIT_TRANS, TRANS_VOID_STATUS, NULL);
+3 -3
View File
@@ -25,7 +25,7 @@
#define _GNC_DIALOG_SEARCH_H #define _GNC_DIALOG_SEARCH_H
#include "GNCId.h" #include "GNCId.h"
#include "QueryNew.h" #include "qof.h"
typedef struct _GNCSearchWindow GNCSearchWindow; typedef struct _GNCSearchWindow GNCSearchWindow;
@@ -42,7 +42,7 @@ typedef struct _GNCSearchWindow GNCSearchWindow;
* and the callback may change the value. * and the callback may change the value.
*/ */
typedef void (*GNCSearchCallback) (gpointer *obj_p, gpointer user_data); typedef void (*GNCSearchCallback) (gpointer *obj_p, gpointer user_data);
typedef void (*GNCSearchResultCB) (QueryNew *query, gpointer user_data, typedef void (*GNCSearchResultCB) (QofQuery *query, gpointer user_data,
gpointer *result); gpointer *result);
/* /*
@@ -93,7 +93,7 @@ GNCSearchWindow *
gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title, gnc_search_dialog_create (GNCIdTypeConst obj_type, const gchar *title,
GList *param_list, GList *param_list,
GList *display_list, GList *display_list,
QueryNew *start_query, QueryNew *show_start_query, QofQuery *start_query, QofQuery *show_start_query,
GNCSearchCallbackButton *callbacks, GNCSearchCallbackButton *callbacks,
GNCSearchResultCB result_callback, GNCSearchResultCB result_callback,
GNCSearchNewItemCB new_item_cb, GNCSearchNewItemCB new_item_cb,
+2 -2
View File
@@ -384,7 +384,7 @@ create_children (GNCGeneralSearch *gsl,
QofBook *book) QofBook *book)
{ {
GtkListStore * list_store; GtkListStore * list_store;
QueryNew * q; QofQuery * q;
GtkTreeIter iter; GtkTreeIter iter;
GList * list, * it; GList * list, * it;
GtkEntryCompletion *completion; GtkEntryCompletion *completion;
@@ -427,7 +427,7 @@ create_children (GNCGeneralSearch *gsl,
} }
gncQueryDestroy(q); qof_query_destroy(q);
/* Add the GtkEntryCompletion widget */ /* Add the GtkEntryCompletion widget */
completion = gtk_entry_completion_new(); completion = gtk_entry_completion_new();
+1 -1
View File
@@ -23,7 +23,7 @@
#define _GNCSEARCH_ACCOUNT_H #define _GNCSEARCH_ACCOUNT_H
#include "search-core-type.h" #include "search-core-type.h"
#include "QueryNew.h" #include "qof.h"
#define GNC_TYPE_SEARCH_ACCOUNT (gnc_search_account_get_type ()) #define GNC_TYPE_SEARCH_ACCOUNT (gnc_search_account_get_type ())
#define GNCSEARCH_ACCOUNT(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_ACCOUNT, GNCSearchAccount) #define GNCSEARCH_ACCOUNT(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_ACCOUNT, GNCSearchAccount)
+1 -1
View File
@@ -23,7 +23,7 @@
#define _GNCSEARCH_BOOLEAN_H #define _GNCSEARCH_BOOLEAN_H
#include "search-core-type.h" #include "search-core-type.h"
#include "QueryNew.h" #include "qof.h"
#define GNC_TYPE_SEARCH_BOOLEAN (gnc_search_boolean_get_type ()) #define GNC_TYPE_SEARCH_BOOLEAN (gnc_search_boolean_get_type ())
#define GNCSEARCH_BOOLEAN(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_BOOLEAN, GNCSearchBoolean) #define GNCSEARCH_BOOLEAN(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_BOOLEAN, GNCSearchBoolean)
+1 -1
View File
@@ -27,7 +27,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include "QueryCore.h" #include "QueryCore.h"
#include "QueryNew.h" #include "qof.h"
#include "Account.h" /* for ACCOUNT_MATCH_ALL_TYPE */ #include "Account.h" /* for ACCOUNT_MATCH_ALL_TYPE */
#include "Transaction.h" /* for RECONCILED_MATCH_TYPE */ #include "Transaction.h" /* for RECONCILED_MATCH_TYPE */
+1 -1
View File
@@ -23,7 +23,7 @@
#define _GNCSEARCH_CORE_TYPE_H #define _GNCSEARCH_CORE_TYPE_H
#include "QueryCore.h" #include "QueryCore.h"
#include "QueryNew.h" #include "qof.h"
#include "search-param.h" #include "search-param.h"
#define GNC_TYPE_SEARCH_CORE_TYPE (gnc_search_core_type_get_type ()) #define GNC_TYPE_SEARCH_CORE_TYPE (gnc_search_core_type_get_type ())
+1 -1
View File
@@ -23,7 +23,7 @@
#define _GNCSEARCH_DATE_H #define _GNCSEARCH_DATE_H
#include "search-core-type.h" #include "search-core-type.h"
#include "QueryNew.h" #include "qof.h"
#include "qof.h" #include "qof.h"
#define GNC_TYPE_SEARCH_DATE (gnc_search_date_get_type ()) #define GNC_TYPE_SEARCH_DATE (gnc_search_date_get_type ())
+1 -1
View File
@@ -23,7 +23,7 @@
#define _GNCSEARCH_DOUBLE_H #define _GNCSEARCH_DOUBLE_H
#include "search-core-type.h" #include "search-core-type.h"
#include "QueryNew.h" #include "qof.h"
#define GNC_TYPE_SEARCH_DOUBLE (gnc_search_double_get_type ()) #define GNC_TYPE_SEARCH_DOUBLE (gnc_search_double_get_type ())
#define GNCSEARCH_DOUBLE(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_DOUBLE, GNCSearchDouble) #define GNCSEARCH_DOUBLE(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_DOUBLE, GNCSearchDouble)
+1 -1
View File
@@ -23,7 +23,7 @@
#define _GNCSEARCH_INT64_H #define _GNCSEARCH_INT64_H
#include "search-core-type.h" #include "search-core-type.h"
#include "QueryNew.h" #include "qof.h"
#define GNC_TYPE_SEARCH_INT64 (gnc_search_int64_get_type ()) #define GNC_TYPE_SEARCH_INT64 (gnc_search_int64_get_type ())
#define GNCSEARCH_INT64(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_INT64, GNCSearchInt64) #define GNCSEARCH_INT64(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_INT64, GNCSearchInt64)
+1 -1
View File
@@ -24,7 +24,7 @@
#include "search-core-type.h" #include "search-core-type.h"
#include "qof.h" #include "qof.h"
#include "QueryNew.h" #include "qof.h"
#define GNC_TYPE_SEARCH_NUMERIC (gnc_search_numeric_get_type ()) #define GNC_TYPE_SEARCH_NUMERIC (gnc_search_numeric_get_type ())
#define GNCSEARCH_NUMERIC(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_NUMERIC, GNCSearchNumeric) #define GNCSEARCH_NUMERIC(obj) GTK_CHECK_CAST (obj, GNC_TYPE_SEARCH_NUMERIC, GNCSearchNumeric)
+2 -2
View File
@@ -27,7 +27,7 @@
#include <gtk/gtk.h> #include <gtk/gtk.h>
#include <glib/gi18n.h> #include <glib/gi18n.h>
#include "QueryNew.h" #include "qof.h"
#include "dialog-utils.h" #include "dialog-utils.h"
#include "gnc-component-manager.h" #include "gnc-component-manager.h"
@@ -70,7 +70,7 @@ dql_build_booklist (DialogQueryList *dql, Query *q)
g_return_if_fail (dql); g_return_if_fail (dql);
for (node = gncQueryGetBooks(q); node; node = node->next) for (node = qof_query_get_books(q); node; node = node->next)
{ {
QofBook *book = node->data; QofBook *book = node->data;
GncGUID *guid = xaccGUIDMalloc(); GncGUID *guid = xaccGUIDMalloc();
+6 -6
View File
@@ -31,7 +31,7 @@
#include "gnc-query-list.h" #include "gnc-query-list.h"
#include "search-param.h" #include "search-param.h"
#include "QueryCore.h" #include "QueryCore.h"
#include "QueryNew.h" #include "qof.h"
#include "QueryObject.h" #include "QueryObject.h"
/* Signal codes */ /* Signal codes */
@@ -129,7 +129,7 @@ gnc_query_list_construct (GNCQueryList *list, GList *param_list, Query *query)
g_return_if_fail(IS_GNC_QUERY_LIST(list)); g_return_if_fail(IS_GNC_QUERY_LIST(list));
/* more configuration */ /* more configuration */
list->query = gncQueryCopy(query); list->query = qof_query_copy(query);
list->column_params = param_list; list->column_params = param_list;
/* cache the function to get the guid of this query type */ /* cache the function to get the guid of this query type */
@@ -170,8 +170,8 @@ void gnc_query_list_reset_query (GNCQueryList *list, Query *query)
g_return_if_fail(query); g_return_if_fail(query);
g_return_if_fail (IS_GNC_QUERY_LIST(list)); g_return_if_fail (IS_GNC_QUERY_LIST(list));
gncQueryDestroy(list->query); qof_query_destroy(list->query);
list->query = gncQueryCopy(query); list->query = qof_query_copy(query);
gnc_query_list_set_query_sort(list, TRUE); gnc_query_list_set_query_sort(list, TRUE);
} }
@@ -716,7 +716,7 @@ gnc_query_list_set_query_sort (GNCQueryList *list, gboolean new_column)
p1 = gnc_search_param_get_param_path(param); p1 = gnc_search_param_get_param_path(param);
p2 = g_slist_prepend(NULL, QUERY_DEFAULT_SORT); p2 = g_slist_prepend(NULL, QUERY_DEFAULT_SORT);
gncQuerySetSortOrder (list->query, p1, p2, NULL); qof_query_set_sort_order (list->query, p1, p2, NULL);
} }
qof_query_set_sort_increasing (list->query, qof_query_set_sort_increasing (list->query,
@@ -794,7 +794,7 @@ gnc_query_list_fill(GNCQueryList *list)
gnc_gui_component_clear_watches (priv->component_id); gnc_gui_component_clear_watches (priv->component_id);
/* Reverse the list now because 'append()' takes too long */ /* Reverse the list now because 'append()' takes too long */
entries = gncQueryRun(list->query); entries = qof_query_run(list->query);
for (item = entries; item; item = item->next) for (item = entries; item; item = item->next)
{ {
+11 -11
View File
@@ -29,7 +29,7 @@
#include "gnc-ui-util.h" #include "gnc-ui-util.h"
#include "Query.h" #include "Query.h"
#include "QueryCore.h" #include "QueryCore.h"
#include "QueryNew.h" #include "qof.h"
#include "QueryObject.h" #include "QueryObject.h"
#include "SX-book.h" #include "SX-book.h"
#include "Transaction.h" #include "Transaction.h"
@@ -42,13 +42,13 @@
struct _ftd_data struct _ftd_data
{ {
QueryNew * q; QofQuery * q;
QueryNew * ledger_q; QofQuery * ledger_q;
GNCSearchWindow * sw; GNCSearchWindow * sw;
}; };
static void static void
do_find_cb (QueryNew *query, gpointer user_data, gpointer *result) do_find_cb (QofQuery *query, gpointer user_data, gpointer *result)
{ {
struct _ftd_data *ftd = user_data; struct _ftd_data *ftd = user_data;
GNCLedgerDisplay *ledger; GNCLedgerDisplay *ledger;
@@ -73,7 +73,7 @@ do_find_cb (QueryNew *query, gpointer user_data, gpointer *result)
gnc_main_window_open_page (NULL, page); gnc_main_window_open_page (NULL, page);
} }
gncQueryDestroy (ftd->q); qof_query_destroy (ftd->q);
gnc_search_dialog_destroy (ftd->sw); gnc_search_dialog_destroy (ftd->sw);
} }
@@ -95,7 +95,7 @@ gnc_ui_find_transactions_dialog_create(GNCLedgerDisplay * orig_ledg)
GNCIdType type = GNC_ID_SPLIT; GNCIdType type = GNC_ID_SPLIT;
struct _ftd_data *ftd; struct _ftd_data *ftd;
static GList *params = NULL; static GList *params = NULL;
QueryNew *start_q, *show_q = NULL; QofQuery *start_q, *show_q = NULL;
/* Build parameter list in reverse order */ /* Build parameter list in reverse order */
if (params == NULL) if (params == NULL)
@@ -105,7 +105,7 @@ gnc_ui_find_transactions_dialog_create(GNCLedgerDisplay * orig_ledg)
type, SPLIT_TRANS, TRANS_SPLITLIST, type, SPLIT_TRANS, TRANS_SPLITLIST,
SPLIT_ACCOUNT_GUID, NULL); SPLIT_ACCOUNT_GUID, NULL);
params = gnc_search_param_prepend (params, N_("Account"), GNC_ID_ACCOUNT, params = gnc_search_param_prepend (params, N_("Account"), GNC_ID_ACCOUNT,
type, SPLIT_ACCOUNT, QUERY_PARAM_GUID, type, SPLIT_ACCOUNT, QOF_PARAM_GUID,
NULL); NULL);
params = gnc_search_param_prepend (params, N_("Balanced"), NULL, params = gnc_search_param_prepend (params, N_("Balanced"), NULL,
type, SPLIT_TRANS, TRANS_IS_BALANCED, type, SPLIT_TRANS, TRANS_IS_BALANCED,
@@ -139,12 +139,12 @@ gnc_ui_find_transactions_dialog_create(GNCLedgerDisplay * orig_ledg)
if (orig_ledg) if (orig_ledg)
{ {
ftd->ledger_q = gnc_ledger_display_get_query (orig_ledg); ftd->ledger_q = gnc_ledger_display_get_query (orig_ledg);
start_q = show_q = gncQueryCopy (ftd->ledger_q); start_q = show_q = qof_query_copy (ftd->ledger_q);
} }
else else
{ {
start_q = gncQueryCreate (); start_q = qof_query_create ();
gncQuerySetBook (start_q, gnc_get_current_book ()); qof_query_set_book (start_q, gnc_get_current_book ());
/* In lieu of not "mis-using" some portion of the infrastructure by writing /* 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 * a bunch of new code, we just filter out the accounts of the template
@@ -164,7 +164,7 @@ 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, GUID_MATCH_NONE, QUERY_AND ); xaccQueryAddAccountMatch( start_q, al, GUID_MATCH_NONE, QOF_QUERY_AND );
g_list_free (al); g_list_free (al);
al = NULL; al = NULL;
tRoot = NULL; tRoot = NULL;
+3 -3
View File
@@ -43,7 +43,7 @@
#include "gnc-ui-util.h" #include "gnc-ui-util.h"
#include "Query.h" #include "Query.h"
#include "QueryNew.h" #include "qof.h"
#include "gnc-ledger-display.h" #include "gnc-ledger-display.h"
#include "gnc-plugin-page-register.h" #include "gnc-plugin-page-register.h"
#include "gnc-main-window.h" #include "gnc-main-window.h"
@@ -1005,9 +1005,9 @@ _show_created_transactions(GncSxSinceLastRunDialog *app_dialog, GList *created_t
qof_query_set_book(book_query, gnc_get_current_book()); qof_query_set_book(book_query, gnc_get_current_book());
for (guid_iter = created_txn_guids; guid_iter != NULL; guid_iter = guid_iter->next) 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); xaccQueryAddGUIDMatch(guid_query, (GncGUID*)guid_iter->data, GNC_ID_TRANS, QOF_QUERY_OR);
} }
query = qof_query_merge(book_query, guid_query, QUERY_AND); query = qof_query_merge(book_query, guid_query, QOF_QUERY_AND);
// inspired by dialog-find-transactions:do_find_cb: // inspired by dialog-find-transactions:do_find_cb:
ledger = gnc_ledger_display_query(query, SEARCH_LEDGER, REG_STYLE_JOURNAL); ledger = gnc_ledger_display_query(query, SEARCH_LEDGER, REG_STYLE_JOURNAL);
+8 -8
View File
@@ -70,7 +70,7 @@
#include "gnucash-sheet.h" #include "gnucash-sheet.h"
#include "lot-viewer.h" #include "lot-viewer.h"
#include "Scrub.h" #include "Scrub.h"
#include "QueryNew.h" #include "qof.h"
#include "window-reconcile.h" #include "window-reconcile.h"
#include "window-autoclear.h" #include "window-autoclear.h"
#include "window-report.h" #include "window-report.h"
@@ -1497,16 +1497,16 @@ gnc_ppr_update_status_query (GncPluginPageRegister *page)
} }
/* Remove the old status match */ /* Remove the old status match */
param_list = gncQueryBuildParamList (SPLIT_RECONCILE, NULL); param_list = qof_query_build_param_list (SPLIT_RECONCILE, NULL);
if (param_list) if (param_list)
{ {
gncQueryPurgeTerms (query, param_list); qof_query_purge_terms (query, param_list);
g_slist_free(param_list); g_slist_free(param_list);
} }
/* Install the new status match */ /* Install the new status match */
if (priv->fd.cleared_match != CLEARED_ALL) if (priv->fd.cleared_match != CLEARED_ALL)
xaccQueryAddClearedMatch(query, priv->fd.cleared_match, QUERY_AND); xaccQueryAddClearedMatch(query, priv->fd.cleared_match, QOF_QUERY_AND);
gnc_ledger_display_refresh (priv->ledger); gnc_ledger_display_refresh (priv->ledger);
LEAVE(" "); LEAVE(" ");
@@ -1548,10 +1548,10 @@ gnc_ppr_update_date_query (GncPluginPageRegister *page)
} }
/* Delete any existing old date spec. */ /* Delete any existing old date spec. */
param_list = gncQueryBuildParamList(SPLIT_TRANS, TRANS_DATE_POSTED, NULL); param_list = qof_query_build_param_list(SPLIT_TRANS, TRANS_DATE_POSTED, NULL);
if (param_list) if (param_list)
{ {
gncQueryPurgeTerms (query, param_list); qof_query_purge_terms (query, param_list);
g_slist_free(param_list); g_slist_free(param_list);
} }
@@ -1561,7 +1561,7 @@ gnc_ppr_update_date_query (GncPluginPageRegister *page)
xaccQueryAddDateMatchTT(query, xaccQueryAddDateMatchTT(query,
priv->fd.start_time != 0, priv->fd.start_time, priv->fd.start_time != 0, priv->fd.start_time,
priv->fd.end_time != 0, priv->fd.end_time, priv->fd.end_time != 0, priv->fd.end_time,
QUERY_AND); QOF_QUERY_AND);
} }
gnc_ledger_display_refresh (priv->ledger); gnc_ledger_display_refresh (priv->ledger);
@@ -3103,7 +3103,7 @@ gnc_plugin_page_register_cmd_transaction_report (GtkAction *action,
qof_query_set_book (query, gnc_get_current_book ()); qof_query_set_book (query, gnc_get_current_book ());
xaccQueryAddGUIDMatch (query, xaccSplitGetGUID (split), xaccQueryAddGUIDMatch (query, xaccSplitGetGUID (split),
GNC_ID_SPLIT, QUERY_AND); GNC_ID_SPLIT, QOF_QUERY_AND);
window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window); window = GNC_MAIN_WINDOW(GNC_PLUGIN_PAGE(plugin_page)->window);
id = report_helper (priv->ledger, split, query); id = report_helper (priv->ledger, split, query);
+2 -2
View File
@@ -34,7 +34,7 @@
#include "gnc-split-reg.h" #include "gnc-split-reg.h"
#include "Account.h" #include "Account.h"
#include "QueryNew.h" #include "qof.h"
#include "SX-book.h" #include "SX-book.h"
#include "dialog-account.h" #include "dialog-account.h"
#include "dialog-sx-editor.h" #include "dialog-sx-editor.h"
@@ -1612,7 +1612,7 @@ gnc_split_reg_sort( GNCSplitReg *gsr, SortType sort_code )
g_return_if_fail (FALSE); g_return_if_fail (FALSE);
} }
gncQuerySetSortOrder( query, p1, p2, p3 ); qof_query_set_sort_order( query, p1, p2, p3 );
reg = gnc_ledger_display_get_split_register( gsr->ledger ); reg = gnc_ledger_display_get_split_register( gsr->ledger );
gnc_split_register_show_present_divider( reg, show_present_divider ); gnc_split_register_show_present_divider( reg, show_present_divider );
gsr->sort_type = sort_code; gsr->sort_type = sort_code;
+5 -5
View File
@@ -29,7 +29,7 @@
#include "gnc-date.h" #include "gnc-date.h"
#include "QueryCore.h" #include "QueryCore.h"
#include "QueryNew.h" #include "qof.h"
#include "Transaction.h" #include "Transaction.h"
#include "gnc-ui-util.h" #include "gnc-ui-util.h"
#include "gnc-gconf-utils.h" #include "gnc-gconf-utils.h"
@@ -151,7 +151,7 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type,
/* match the account */ /* match the account */
accounts = g_list_prepend (accounts, account); accounts = g_list_prepend (accounts, account);
xaccQueryAddAccountMatch (query, accounts, GUID_MATCH_ANY, QUERY_AND); xaccQueryAddAccountMatch (query, accounts, GUID_MATCH_ANY, QOF_QUERY_AND);
g_list_free (accounts); g_list_free (accounts);
@@ -159,14 +159,14 @@ gnc_reconcile_list_new(Account *account, GNCReconcileListType type,
if (type == RECLIST_CREDIT) if (type == RECLIST_CREDIT)
xaccQueryAddValueMatch(query, gnc_numeric_zero (), xaccQueryAddValueMatch(query, gnc_numeric_zero (),
NUMERIC_MATCH_CREDIT, NUMERIC_MATCH_CREDIT,
COMPARE_GTE, QUERY_AND); COMPARE_GTE, QOF_QUERY_AND);
else else
xaccQueryAddValueMatch(query, gnc_numeric_zero (), xaccQueryAddValueMatch(query, gnc_numeric_zero (),
NUMERIC_MATCH_DEBIT, NUMERIC_MATCH_DEBIT,
COMPARE_GTE, QUERY_AND); COMPARE_GTE, QOF_QUERY_AND);
/* limit the matches only to Cleared and Non-reconciled splits */ /* limit the matches only to Cleared and Non-reconciled splits */
xaccQueryAddClearedMatch(query, CLEARED_NO | CLEARED_CLEARED, QUERY_AND); xaccQueryAddClearedMatch(query, CLEARED_NO | CLEARED_CLEARED, QOF_QUERY_AND);
/* initialize the QueryList */ /* initialize the QueryList */
gnc_reconcile_list_construct (list, query); gnc_reconcile_list_construct (list, query);
@@ -28,7 +28,7 @@
#include "Account.h" #include "Account.h"
#include "Query.h" #include "Query.h"
#include "QueryCore.h" #include "QueryCore.h"
#include "QueryNew.h" #include "qof.h"
#include "SX-book.h" #include "SX-book.h"
#include "Transaction.h" #include "Transaction.h"
#include "gnc-component-manager.h" #include "gnc-component-manager.h"
@@ -429,7 +429,7 @@ 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, GUID_MATCH_NONE, QUERY_AND ); xaccQueryAddAccountMatch( query, al, GUID_MATCH_NONE, QOF_QUERY_AND );
g_list_free (al); g_list_free (al);
al = NULL; al = NULL;
tRoot = NULL; tRoot = NULL;
@@ -441,7 +441,7 @@ gnc_ledger_display_gl (void)
xaccQueryAddDateMatchTT (query, xaccQueryAddDateMatchTT (query,
TRUE, start, TRUE, start,
FALSE, 0, FALSE, 0,
QUERY_AND); QOF_QUERY_AND);
ld = gnc_ledger_display_internal (NULL, query, LD_GL, GENERAL_LEDGER, ld = gnc_ledger_display_internal (NULL, query, LD_GL, GENERAL_LEDGER,
REG_STYLE_JOURNAL, FALSE, FALSE); REG_STYLE_JOURNAL, FALSE, FALSE);
@@ -482,7 +482,7 @@ gnc_ledger_display_template_gl (char *id)
root = gnc_book_get_template_root (book); root = gnc_book_get_template_root (book);
acct = gnc_account_lookup_by_name(root, id); acct = gnc_account_lookup_by_name(root, id);
g_assert( acct ); g_assert( acct );
xaccQueryAddSingleAccountMatch (q, acct, QUERY_AND); xaccQueryAddSingleAccountMatch (q, acct, QOF_QUERY_AND);
} }
ld = gnc_ledger_display_internal (NULL, q, LD_GL, ld = gnc_ledger_display_internal (NULL, q, LD_GL,
@@ -665,7 +665,7 @@ gnc_ledger_display_make_query (GNCLedgerDisplay *ld,
accounts = g_list_prepend (accounts, leader); accounts = g_list_prepend (accounts, leader);
xaccQueryAddAccountMatch (ld->query, accounts, xaccQueryAddAccountMatch (ld->query, accounts,
GUID_MATCH_ANY, QUERY_AND); GUID_MATCH_ANY, QOF_QUERY_AND);
g_list_free (accounts); g_list_free (accounts);
} }