mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
[gnc-budget.cpp] convert to c++
This commit is contained in:
parent
8bc080b96d
commit
9088acabd8
@ -139,7 +139,7 @@ set (engine_SOURCES
|
||||
cap-gains.c
|
||||
cashobjects.c
|
||||
gnc-aqbanking-templates.cpp
|
||||
gnc-budget.c
|
||||
gnc-budget.cpp
|
||||
gnc-commodity.c
|
||||
gnc-date.cpp
|
||||
gnc-datetime.cpp
|
||||
|
@ -33,6 +33,7 @@
|
||||
|
||||
#include "Account.h"
|
||||
|
||||
#include "guid.hpp"
|
||||
#include "gnc-budget.h"
|
||||
#include "gnc-commodity.h"
|
||||
|
||||
@ -196,7 +197,7 @@ gnc_budget_set_property( GObject* object,
|
||||
gnc_budget_set_num_periods(budget, g_value_get_uint(value));
|
||||
break;
|
||||
case PROP_RECURRENCE:
|
||||
gnc_budget_set_recurrence(budget, g_value_get_pointer(value));
|
||||
gnc_budget_set_recurrence (budget, static_cast<Recurrence*>(g_value_get_pointer(value)));
|
||||
break;
|
||||
default:
|
||||
G_OBJECT_WARN_INVALID_PROPERTY_ID(object, prop_id, pspec);
|
||||
@ -311,12 +312,11 @@ gnc_budget_commit_edit(GncBudget *bgt)
|
||||
GncBudget*
|
||||
gnc_budget_new(QofBook *book)
|
||||
{
|
||||
GncBudget* budget;
|
||||
|
||||
g_return_val_if_fail(book, NULL);
|
||||
|
||||
ENTER(" ");
|
||||
budget = g_object_new(GNC_TYPE_BUDGET, NULL);
|
||||
|
||||
auto budget { static_cast<GncBudget*>(g_object_new(GNC_TYPE_BUDGET, nullptr)) };
|
||||
qof_instance_init_data (&budget->inst, GNC_ID_BUDGET, book);
|
||||
|
||||
qof_event_gen( &budget->inst, QOF_EVENT_CREATE , NULL);
|
||||
@ -773,7 +773,7 @@ get_acct_array (const GncBudget *budget, const Account *account)
|
||||
GArray *array;
|
||||
|
||||
if (!g_hash_table_lookup_extended (priv->acct_hash, account, NULL,
|
||||
(gpointer) &array))
|
||||
(gpointer*)(&array)))
|
||||
{
|
||||
array = g_array_sized_new (FALSE, TRUE, sizeof (PeriodData),
|
||||
priv->num_periods);
|
||||
@ -879,7 +879,7 @@ static QofObject budget_object_def =
|
||||
DI(.interface_version = ) QOF_OBJECT_VERSION,
|
||||
DI(.e_type = ) GNC_ID_BUDGET,
|
||||
DI(.type_label = ) "Budget",
|
||||
DI(.create = ) (gpointer)gnc_budget_new,
|
||||
DI(.create = ) (void*(*)(QofBook*)) gnc_budget_new,
|
||||
DI(.book_begin = ) NULL,
|
||||
DI(.book_end = ) gnc_budget_book_end,
|
||||
DI(.is_dirty = ) qof_collection_is_dirty,
|
@ -64,6 +64,11 @@
|
||||
#ifndef __GNC_BUDGET_H__
|
||||
#define __GNC_BUDGET_H__
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C"
|
||||
{
|
||||
#endif
|
||||
|
||||
#include <glib.h>
|
||||
|
||||
/** The budget data.*/
|
||||
@ -171,6 +176,11 @@ GncBudget* gnc_budget_get_default(QofBook *book);
|
||||
GncBudget* gnc_budget_lookup (const GncGUID *guid, const QofBook *book);
|
||||
#define gnc_budget_lookup_direct(g,b) gnc_budget_lookup(&(g),(b))
|
||||
|
||||
#ifdef __cplusplus
|
||||
}
|
||||
#endif
|
||||
|
||||
|
||||
#endif // __BUDGET_H__
|
||||
|
||||
/** @} */
|
||||
|
@ -630,7 +630,7 @@ libgnucash/engine/engine-helpers.c
|
||||
libgnucash/engine/gncAddress.c
|
||||
libgnucash/engine/gnc-aqbanking-templates.cpp
|
||||
libgnucash/engine/gncBillTerm.c
|
||||
libgnucash/engine/gnc-budget.c
|
||||
libgnucash/engine/gnc-budget.cpp
|
||||
libgnucash/engine/gncBusiness.c
|
||||
libgnucash/engine/gnc-commodity.c
|
||||
libgnucash/engine/gnc-commodity.h
|
||||
|
Loading…
Reference in New Issue
Block a user