Skip to content

Commit

Permalink
Refactor: hide implementation of GNCSearch* (move from .h to .c)
Browse files Browse the repository at this point in the history
  • Loading branch information
richardcohen committed Jun 13, 2023
1 parent 5d3eaa5 commit 4eb20b2
Show file tree
Hide file tree
Showing 18 changed files with 71 additions and 72 deletions.
7 changes: 7 additions & 0 deletions gnucash/gnome-search/search-account.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_account_finalize (GObject *obj);

struct _GNCSearchAccount
{
GNCSearchCoreType parent;

QofGuidMatch how;
};

typedef struct _GNCSearchAccountPrivate GNCSearchAccountPrivate;

struct _GNCSearchAccountPrivate
Expand Down
7 changes: 0 additions & 7 deletions gnucash/gnome-search/search-account.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
#define GNC_TYPE_SEARCH_ACCOUNT (gnc_search_account_get_type ())
G_DECLARE_FINAL_TYPE (GNCSearchAccount, gnc_search_account, GNC, SEARCH_ACCOUNT, GNCSearchCoreType)

struct _GNCSearchAccount
{
GNCSearchCoreType parent;

QofGuidMatch how;
};

GNCSearchAccount *gnc_search_account_new (void);
GNCSearchAccount *gnc_search_account_matchall_new (void);

Expand Down
7 changes: 7 additions & 0 deletions gnucash/gnome-search/search-boolean.c
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,13 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_boolean_finalize (GObject *obj);

struct _GNCSearchBoolean
{
GNCSearchCoreType parent;

gboolean value;
};

typedef struct _GNCSearchBooleanPrivate GNCSearchBooleanPrivate;

struct _GNCSearchBooleanPrivate
Expand Down
7 changes: 0 additions & 7 deletions gnucash/gnome-search/search-boolean.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
#define GNC_TYPE_SEARCH_BOOLEAN (gnc_search_boolean_get_type ())
G_DECLARE_FINAL_TYPE (GNCSearchBoolean, gnc_search_boolean, GNC, SEARCH_BOOLEAN, GNCSearchCoreType)

struct _GNCSearchBoolean
{
GNCSearchCoreType parent;

gboolean value;
};

GNCSearchBoolean *gnc_search_boolean_new (void);

/* methods */
Expand Down
8 changes: 8 additions & 0 deletions gnucash/gnome-search/search-date.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_date_finalize (GObject *obj);

struct _GNCSearchDate
{
GNCSearchCoreType parent;

QofQueryCompare how;
time64 tt;
};

typedef struct _GNCSearchDatePrivate GNCSearchDatePrivate;

struct _GNCSearchDatePrivate
Expand Down
8 changes: 0 additions & 8 deletions gnucash/gnome-search/search-date.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,6 @@
#define GNC_TYPE_SEARCH_DATE (gnc_search_date_get_type ())
G_DECLARE_FINAL_TYPE (GNCSearchDate, gnc_search_date, GNC, SEARCH_DATE, GNCSearchCoreType)

struct _GNCSearchDate
{
GNCSearchCoreType parent;

QofQueryCompare how;
time64 tt;
};

GNCSearchDate *gnc_search_date_new (void);

/* methods */
Expand Down
8 changes: 8 additions & 0 deletions gnucash/gnome-search/search-double.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,14 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_double_finalize (GObject *obj);

struct _GNCSearchDouble
{
GNCSearchCoreType parent;

QofQueryCompare how;
double value;
};

typedef struct _GNCSearchDoublePrivate GNCSearchDoublePrivate;

struct _GNCSearchDoublePrivate
Expand Down
8 changes: 0 additions & 8 deletions gnucash/gnome-search/search-double.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
#define GNC_TYPE_SEARCH_DOUBLE (gnc_search_double_get_type ())
G_DECLARE_FINAL_TYPE (GNCSearchDouble, gnc_search_double, GNC, SEARCH_DOUBLE, GNCSearchCoreType)

struct _GNCSearchDouble
{
GNCSearchCoreType parent;

QofQueryCompare how;
double value;
};

GNCSearchDouble *gnc_search_double_new (void);

/* methods */
Expand Down
7 changes: 7 additions & 0 deletions gnucash/gnome-search/search-int64.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_int64_finalize (GObject *obj);

struct _GNCSearchInt64
{
GNCSearchCoreType parent;

QofQueryCompare how;
gint64 value;
};

typedef struct _GNCSearchInt64Private GNCSearchInt64Private;

Expand Down
8 changes: 0 additions & 8 deletions gnucash/gnome-search/search-int64.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
#define GNC_TYPE_SEARCH_INT64 (gnc_search_int64_get_type ())
G_DECLARE_FINAL_TYPE (GNCSearchInt64, gnc_search_int64, GNC, SEARCH_INT64, GNCSearchCoreType)

struct _GNCSearchInt64
{
GNCSearchCoreType parent;

QofQueryCompare how;
gint64 value;
};

GNCSearchInt64 *gnc_search_int64_new (void);

/* methods */
Expand Down
10 changes: 10 additions & 0 deletions gnucash/gnome-search/search-numeric.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,16 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_numeric_finalize (GObject *obj);

struct _GNCSearchNumeric
{
GNCSearchCoreType parent;
struct _GNCSearchNumericPrivate *priv;

QofQueryCompare how;
gnc_numeric value;
QofNumericMatch option;
};

typedef struct _GNCSearchNumericPrivate GNCSearchNumericPrivate;

struct _GNCSearchNumericPrivate
Expand Down
10 changes: 0 additions & 10 deletions gnucash/gnome-search/search-numeric.h
Original file line number Diff line number Diff line change
Expand Up @@ -29,16 +29,6 @@
#define GNC_TYPE_SEARCH_NUMERIC (gnc_search_numeric_get_type ())
G_DECLARE_FINAL_TYPE (GNCSearchNumeric, gnc_search_numeric, GNC, SEARCH_NUMERIC, GNCSearchCoreType)

struct _GNCSearchNumeric
{
GNCSearchCoreType parent;
struct _GNCSearchNumericPrivate *priv;

QofQueryCompare how;
gnc_numeric value;
QofNumericMatch option;
};

GNCSearchNumeric *gnc_search_numeric_new (void);
GNCSearchNumeric *gnc_search_numeric_debcred_new (void);

Expand Down
8 changes: 8 additions & 0 deletions gnucash/gnome-search/search-reconciled.c
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,14 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_reconciled_finalize (GObject *obj);

struct _GNCSearchReconciled
{
GNCSearchCoreType parent;

QofCharMatch how;
cleared_match_t value;
};

typedef struct _GNCSearchReconciledPrivate GNCSearchReconciledPrivate;

struct _GNCSearchReconciledPrivate
Expand Down
8 changes: 0 additions & 8 deletions gnucash/gnome-search/search-reconciled.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,6 @@
#define GNC_TYPE_SEARCH_RECONCILED (gnc_search_reconciled_get_type ())
G_DECLARE_FINAL_TYPE (GNCSearchReconciled, gnc_search_reconciled, GNC, SEARCH_RECONCILED, GNCSearchCoreType)

struct _GNCSearchReconciled
{
GNCSearchCoreType parent;

QofCharMatch how;
cleared_match_t value;
};

GNCSearchReconciled *gnc_search_reconciled_new (void);

/* methods */
Expand Down
9 changes: 9 additions & 0 deletions gnucash/gnome-search/search-string.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,15 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_string_finalize (GObject *obj);

struct _GNCSearchString
{
GNCSearchCoreType parent;

GNCSearchString_Type how;
gboolean ign_case;
char * value;
};

typedef struct _GNCSearchStringPrivate GNCSearchStringPrivate;

struct _GNCSearchStringPrivate
Expand Down
9 changes: 0 additions & 9 deletions gnucash/gnome-search/search-string.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,6 @@ typedef enum _search_string_how
SEARCH_STRING_NOT_EQUAL
} GNCSearchString_Type;

struct _GNCSearchString
{
GNCSearchCoreType parent;

GNCSearchString_Type how;
gboolean ign_case;
char * value;
};

GNCSearchString *gnc_search_string_new (void);

/* methods */
Expand Down
7 changes: 7 additions & 0 deletions gnucash/gnome/search-owner.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,13 @@ static QofQueryPredData* gncs_get_predicate (GNCSearchCoreType *fe);

static void gnc_search_owner_finalize (GObject *obj);

struct _GNCSearchOwner
{
GNCSearchCoreType parent;

QofGuidMatch how;
};

typedef struct _GNCSearchOwnerPrivate
{
GncOwner owner;
Expand Down
7 changes: 0 additions & 7 deletions gnucash/gnome/search-owner.h
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,6 @@
#define GNC_TYPE_SEARCH_OWNER (gnc_search_owner_get_type ())
G_DECLARE_FINAL_TYPE (GNCSearchOwner, gnc_search_owner, GNC, SEARCH_OWNER, GNCSearchCoreType)

struct _GNCSearchOwner
{
GNCSearchCoreType parent;

QofGuidMatch how;
};

GNCSearchOwner *gnc_search_owner_new (void);

/* methods */
Expand Down

0 comments on commit 4eb20b2

Please sign in to comment.