mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Replace all occurrences of the old gnc_book_get_pricedb with the newer gnc_pricedb_get_db
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19664 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
parent
83322e1ab1
commit
e1f224493e
@ -95,7 +95,7 @@ load_all_prices( GncSqlBackend* be )
|
|||||||
g_return_if_fail( be != NULL );
|
g_return_if_fail( be != NULL );
|
||||||
|
|
||||||
pBook = be->primary_book;
|
pBook = be->primary_book;
|
||||||
pPriceDB = gnc_book_get_pricedb( pBook );
|
pPriceDB = gnc_pricedb_get_db( pBook );
|
||||||
stmt = gnc_sql_create_select_statement( be, TABLE_NAME );
|
stmt = gnc_sql_create_select_statement( be, TABLE_NAME );
|
||||||
if ( stmt != NULL )
|
if ( stmt != NULL )
|
||||||
{
|
{
|
||||||
@ -217,7 +217,7 @@ write_prices( GncSqlBackend* be )
|
|||||||
|
|
||||||
g_return_val_if_fail( be != NULL, FALSE );
|
g_return_val_if_fail( be != NULL, FALSE );
|
||||||
|
|
||||||
priceDB = gnc_book_get_pricedb( be->primary_book );
|
priceDB = gnc_pricedb_get_db( be->primary_book );
|
||||||
|
|
||||||
data.be = be;
|
data.be = be;
|
||||||
data.is_ok = TRUE;
|
data.is_ok = TRUE;
|
||||||
|
@ -125,7 +125,7 @@ gnc_book_dom_tree_create(QofBook *book)
|
|||||||
*/
|
*/
|
||||||
xmlAddChild(ret, gnc_commodity_dom_tree_create(
|
xmlAddChild(ret, gnc_commodity_dom_tree_create(
|
||||||
gnc_book_get_commodity_table(book)));
|
gnc_book_get_commodity_table(book)));
|
||||||
xmlAddChild(ret, gnc_pricedb_dom_tree_create(gnc_book_get_pricedb(book)));
|
xmlAddChild(ret, gnc_pricedb_dom_tree_create(gnc_pricedb_get_db(book)));
|
||||||
if (allow_incompat)
|
if (allow_incompat)
|
||||||
{
|
{
|
||||||
accnode = gnc_account_dom_tree_create(account, FALSE);
|
accnode = gnc_account_dom_tree_create(account, FALSE);
|
||||||
|
@ -264,7 +264,7 @@ pricedb_start_handler(GSList* sibling_data,
|
|||||||
{
|
{
|
||||||
gxpf_data *gdata = global_data;
|
gxpf_data *gdata = global_data;
|
||||||
QofBook *book = gdata->bookdata;
|
QofBook *book = gdata->bookdata;
|
||||||
GNCPriceDB *db = gnc_book_get_pricedb(book);
|
GNCPriceDB *db = gnc_pricedb_get_db(book);
|
||||||
g_return_val_if_fail(db, FALSE);
|
g_return_val_if_fail(db, FALSE);
|
||||||
gnc_pricedb_set_bulk_update(db, TRUE);
|
gnc_pricedb_set_bulk_update(db, TRUE);
|
||||||
*result = db;
|
*result = db;
|
||||||
|
@ -3803,7 +3803,7 @@ pricedb_start_handler(GSList* sibling_data,
|
|||||||
gchar **attrs)
|
gchar **attrs)
|
||||||
{
|
{
|
||||||
GNCParseStatus *pstatus = (GNCParseStatus *) global_data;
|
GNCParseStatus *pstatus = (GNCParseStatus *) global_data;
|
||||||
GNCPriceDB *db = gnc_book_get_pricedb(pstatus->book);
|
GNCPriceDB *db = gnc_pricedb_get_db(pstatus->book);
|
||||||
g_return_val_if_fail(db, FALSE);
|
g_return_val_if_fail(db, FALSE);
|
||||||
*result = db;
|
*result = db;
|
||||||
return(TRUE);
|
return(TRUE);
|
||||||
|
@ -1073,7 +1073,7 @@ write_pricedb(FILE *out, QofBook *book, sixtp_gdv2 *gd)
|
|||||||
{
|
{
|
||||||
xmlNodePtr node;
|
xmlNodePtr node;
|
||||||
|
|
||||||
node = gnc_pricedb_dom_tree_create(gnc_book_get_pricedb(book));
|
node = gnc_pricedb_dom_tree_create(gnc_pricedb_get_db(book));
|
||||||
|
|
||||||
if (!node)
|
if (!node)
|
||||||
{
|
{
|
||||||
|
@ -3293,7 +3293,7 @@ xaccAccountConvertBalanceToCurrencyAsOfDate(const Account *acc, /* for book */
|
|||||||
return balance;
|
return balance;
|
||||||
|
|
||||||
book = gnc_account_get_book (acc);
|
book = gnc_account_get_book (acc);
|
||||||
pdb = gnc_book_get_pricedb (book);
|
pdb = gnc_pricedb_get_db (book);
|
||||||
|
|
||||||
ts.tv_sec = date;
|
ts.tv_sec = date;
|
||||||
ts.tv_nsec = 0;
|
ts.tv_nsec = 0;
|
||||||
|
@ -83,7 +83,7 @@ GType gnc_pricedb_get_type(void);
|
|||||||
they're really needed.
|
they're really needed.
|
||||||
|
|
||||||
Every QofBook contains a GNCPriceDB, accessible via
|
Every QofBook contains a GNCPriceDB, accessible via
|
||||||
gnc_book_get_pricedb.
|
gnc_pricedb_get_db.
|
||||||
|
|
||||||
\warning The PriceDB does not currently use the object
|
\warning The PriceDB does not currently use the object
|
||||||
system used elsewhere in the GnuCash Engine, i.e. it does
|
system used elsewhere in the GnuCash Engine, i.e. it does
|
||||||
@ -280,9 +280,6 @@ gboolean gnc_price_list_equal(PriceList *prices1, PriceList *prices2);
|
|||||||
/** Data type */
|
/** Data type */
|
||||||
typedef struct gnc_price_db_s GNCPriceDB;
|
typedef struct gnc_price_db_s GNCPriceDB;
|
||||||
|
|
||||||
/* XXX backwards-compat defines, remove these someday */
|
|
||||||
#define gnc_book_get_pricedb gnc_pricedb_get_db
|
|
||||||
|
|
||||||
/** return the pricedb associated with the book */
|
/** return the pricedb associated with the book */
|
||||||
/*@ dependent @*/ GNCPriceDB * gnc_pricedb_get_db(QofBook *book);
|
/*@ dependent @*/ GNCPriceDB * gnc_pricedb_get_db(QofBook *book);
|
||||||
GNCPriceDB * gnc_collection_get_pricedb(QofCollection *col);
|
GNCPriceDB * gnc_collection_get_pricedb(QofCollection *col);
|
||||||
|
@ -1904,7 +1904,7 @@ gnc_xfer_dialog (GtkWidget * parent, Account * initial)
|
|||||||
}
|
}
|
||||||
|
|
||||||
xferData->book = book;
|
xferData->book = book;
|
||||||
xferData->pricedb = gnc_book_get_pricedb (book);
|
xferData->pricedb = gnc_pricedb_get_db (book);
|
||||||
|
|
||||||
gnc_xfer_dialog_create(parent, xferData);
|
gnc_xfer_dialog_create(parent, xferData);
|
||||||
|
|
||||||
|
@ -229,7 +229,7 @@ refresh_details_page (StockSplitInfo *info)
|
|||||||
|
|
||||||
commodity = xaccAccountGetCommodity (account);
|
commodity = xaccAccountGetCommodity (account);
|
||||||
book = gnc_account_get_book (account);
|
book = gnc_account_get_book (account);
|
||||||
db = gnc_book_get_pricedb(book);
|
db = gnc_pricedb_get_db(book);
|
||||||
|
|
||||||
prices = gnc_pricedb_lookup_latest_any_currency(db, commodity);
|
prices = gnc_pricedb_lookup_latest_any_currency(db, commodity);
|
||||||
if (prices)
|
if (prices)
|
||||||
@ -486,7 +486,7 @@ gnc_stock_split_druid_finish (GnomeDruidPage *druidpage,
|
|||||||
gnc_price_commit_edit (price);
|
gnc_price_commit_edit (price);
|
||||||
|
|
||||||
book = gnc_get_current_book ();
|
book = gnc_get_current_book ();
|
||||||
pdb = gnc_book_get_pricedb (book);
|
pdb = gnc_pricedb_get_db (book);
|
||||||
|
|
||||||
if (!gnc_pricedb_add_price (pdb, price))
|
if (!gnc_pricedb_add_price (pdb, price))
|
||||||
gnc_error_dialog (info->window, "%s", _("Error adding price."));
|
gnc_error_dialog (info->window, "%s", _("Error adding price."));
|
||||||
|
@ -505,7 +505,7 @@ account_latest_price (Account *account)
|
|||||||
currency = gnc_default_currency ();
|
currency = gnc_default_currency ();
|
||||||
|
|
||||||
book = gnc_account_get_book (account);
|
book = gnc_account_get_book (account);
|
||||||
pdb = gnc_book_get_pricedb (book);
|
pdb = gnc_pricedb_get_db (book);
|
||||||
|
|
||||||
return gnc_pricedb_lookup_latest (pdb, commodity, currency);
|
return gnc_pricedb_lookup_latest (pdb, commodity, currency);
|
||||||
}
|
}
|
||||||
@ -523,7 +523,7 @@ account_latest_price_any_currency (Account *account)
|
|||||||
commodity = xaccAccountGetCommodity (account);
|
commodity = xaccAccountGetCommodity (account);
|
||||||
|
|
||||||
book = gnc_account_get_book (account);
|
book = gnc_account_get_book (account);
|
||||||
pdb = gnc_book_get_pricedb (book);
|
pdb = gnc_pricedb_get_db (book);
|
||||||
|
|
||||||
price_list = gnc_pricedb_lookup_latest_any_currency (pdb, commodity);
|
price_list = gnc_pricedb_lookup_latest_any_currency (pdb, commodity);
|
||||||
if (!price_list) return NULL;
|
if (!price_list) return NULL;
|
||||||
|
@ -462,7 +462,7 @@ finish_helper(gpointer key, gpointer value, gpointer data)
|
|||||||
comm = gnc_commodity_table_insert(gnc_get_current_commodities(), comm);
|
comm = gnc_commodity_table_insert(gnc_get_current_commodities(), comm);
|
||||||
|
|
||||||
/* s/old commodity/new commodity/g in the pricedb */
|
/* s/old commodity/new commodity/g in the pricedb */
|
||||||
gnc_pricedb_substitute_commodity(gnc_book_get_pricedb(book),
|
gnc_pricedb_substitute_commodity(gnc_pricedb_get_db(book),
|
||||||
old_comm,
|
old_comm,
|
||||||
comm);
|
comm);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user