Skip to content

Commit

Permalink
Refactor: hide implementation of GncTreeModel* (move from .h -> .c)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardcohen committed Jun 13, 2023
1 parent ae352e9 commit 1084071
Show file tree
Hide file tree
Showing 10 changed files with 38 additions and 48 deletions.
6 changes: 6 additions & 0 deletions gnucash/gnome-utils/gnc-tree-model-account-types.c
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,12 @@ gnc_tree_model_account_types_finalize (GObject * object);
static void
gnc_tree_model_account_types_tree_model_init (GtkTreeModelIface * iface);

struct _GncTreeModelAccountTypes
{
GObject gobject;
int stamp;
};

typedef struct GncTreeModelAccountTypesPrivate
{
guint32 selected;
Expand Down
7 changes: 0 additions & 7 deletions gnucash/gnome-utils/gnc-tree-model-account-types.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,6 @@ typedef enum
GNC_TREE_MODEL_ACCOUNT_TYPES_NUM_COLUMNS
} GncTreeModelAccountTypesColumn;

/* typedefs & structures */
struct _GncTreeModelAccountTypes
{
GObject gobject;
int stamp;
};

/* function prototypes */

/* Choose one of two methods to use the GncTreeModelAccountTypes
Expand Down
8 changes: 8 additions & 0 deletions gnucash/gnome-utils/gnc-tree-model-account.c
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,14 @@ static void gnc_tree_model_account_event_handler (QofInstance *entity,
GncTreeModelAccount *model,
GncEventData *ed);

/** The instance data structure for an account tree model. */
struct _GncTreeModelAccount
{
GncTreeModel gnc_tree_model; /**< The parent object data. */
int stamp; /**< The state of the model. Any state
* change increments this number. */
};

/** The instance private data for an account tree model. */
typedef struct GncTreeModelAccountPrivate
{
Expand Down
10 changes: 0 additions & 10 deletions gnucash/gnome-utils/gnc-tree-model-account.h
Original file line number Diff line number Diff line change
Expand Up @@ -96,16 +96,6 @@ typedef enum
GNC_TREE_MODEL_ACCOUNT_NUM_COLUMNS
} GncTreeModelAccountColumn;

/* typedefs & structures */

/** The instance data structure for an account tree model. */
struct _GncTreeModelAccount
{
GncTreeModel gnc_tree_model; /**< The parent object data. */
int stamp; /**< The state of the model. Any state
* change increments this number. */
};

/** Clear the tree model account cached values.
*
* @param model A pointer to the account tree model.
Expand Down
8 changes: 8 additions & 0 deletions gnucash/gnome-utils/gnc-tree-model-commodity.c
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,14 @@ static void gnc_tree_model_commodity_event_handler (QofInstance *entity,
gpointer user_data,
gpointer event_data);

/** The instance data structure for a commodity tree model. */
struct _GncTreeModelCommodity
{
GncTreeModel gnc_tree_model; /**< The parent object data. */
int stamp; /**< The state of the model. Any state
* change increments this number. */
};

/** The instance private data for a commodity database tree model. */
typedef struct GncTreeModelCommodityPrivate
{
Expand Down
11 changes: 0 additions & 11 deletions gnucash/gnome-utils/gnc-tree-model-commodity.h
Original file line number Diff line number Diff line change
Expand Up @@ -72,17 +72,6 @@ typedef enum
GNC_TREE_MODEL_COMMODITY_NUM_COLUMNS
} GncTreeModelCommodityColumn;

/* typedefs & structures */

/** The instance data structure for a commodity tree model. */
struct _GncTreeModelCommodity
{
GncTreeModel gnc_tree_model; /**< The parent object data. */
int stamp; /**< The state of the model. Any state
* change increments this number. */
};


/** @name Account Tree Model Constructors
@{ */

Expand Down
8 changes: 8 additions & 0 deletions gnucash/gnome-utils/gnc-tree-model-owner.c
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,14 @@ static void gnc_tree_model_owner_event_handler (QofInstance *entity,
GncTreeModelOwner *model,
GncEventData *ed);

/** The instance data structure for an owner tree model. */
struct _GncTreeModelOwner
{
GncTreeModel gnc_tree_model; /**< The parent object data. */
int stamp; /**< The state of the model. Any state
* change increments this number. */
};

/** The instance private data for an owner tree model. */
typedef struct GncTreeModelOwnerPrivate
{
Expand Down
10 changes: 0 additions & 10 deletions gnucash/gnome-utils/gnc-tree-model-owner.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,16 +75,6 @@ typedef enum
GNC_TREE_MODEL_OWNER_NUM_COLUMNS
} GncTreeModelOwnerColumn;

/* typedefs & structures */

/** The instance data structure for an owner tree model. */
struct _GncTreeModelOwner
{
GncTreeModel gnc_tree_model; /**< The parent object data. */
int stamp; /**< The state of the model. Any state
* change increments this number. */
};

/** @name Owner Tree Model Constructors
@{ */

Expand Down
8 changes: 8 additions & 0 deletions gnucash/gnome-utils/gnc-tree-model-price.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ static void gnc_tree_model_price_event_handler (QofInstance *entity,
gpointer user_data,
gpointer event_data);

/** The instance data structure for a price tree model. */
struct _GncTreeModelPrice
{
GncTreeModel gnc_tree_model; /**< The parent object data. */
int stamp; /**< The state of the model. Any state
* change increments this number. */
};

/** The instance private data for a price database tree model. */
typedef struct GncTreeModelPricePrivate
{
Expand Down
10 changes: 0 additions & 10 deletions gnucash/gnome-utils/gnc-tree-model-price.h
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,6 @@ typedef enum
GNC_TREE_MODEL_PRICE_NUM_COLUMNS
} GncTreeModelPriceColumn;

/* typedefs & structures */

/** The instance data structure for a price tree model. */
struct _GncTreeModelPrice
{
GncTreeModel gnc_tree_model; /**< The parent object data. */
int stamp; /**< The state of the model. Any state
* change increments this number. */
};

/** @name Account Tree Model Constructors
@{ */

Expand Down

0 comments on commit 1084071

Please sign in to comment.