mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
And more const-correctnes in SchedXaction.h
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@19462 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -312,7 +312,7 @@ sx_advRemind_handler( xmlNodePtr node, gpointer sx_pdata )
|
||||
static
|
||||
gboolean
|
||||
sx_set_date( xmlNodePtr node, SchedXaction *sx,
|
||||
void (*settor)( SchedXaction *sx, GDate *d ) )
|
||||
void (*settor)( SchedXaction *sx, const GDate *d ) )
|
||||
{
|
||||
GDate *date;
|
||||
date = dom_tree_to_gdate( node );
|
||||
|
||||
@@ -581,7 +581,7 @@ xaccSchedXactionGetStartDate(const SchedXaction *sx )
|
||||
}
|
||||
|
||||
void
|
||||
xaccSchedXactionSetStartDate( SchedXaction *sx, GDate* newStart )
|
||||
xaccSchedXactionSetStartDate( SchedXaction *sx, const GDate* newStart )
|
||||
{
|
||||
gnc_sx_begin_edit(sx);
|
||||
sx->start_date = *newStart;
|
||||
@@ -602,7 +602,7 @@ xaccSchedXactionGetEndDate(const SchedXaction *sx )
|
||||
}
|
||||
|
||||
void
|
||||
xaccSchedXactionSetEndDate( SchedXaction *sx, GDate *newEnd )
|
||||
xaccSchedXactionSetEndDate( SchedXaction *sx, const GDate *newEnd )
|
||||
{
|
||||
if ( g_date_valid( newEnd )
|
||||
&& g_date_compare( newEnd, &sx->start_date ) < 0 )
|
||||
@@ -629,7 +629,7 @@ xaccSchedXactionGetLastOccurDate(const SchedXaction *sx )
|
||||
}
|
||||
|
||||
void
|
||||
xaccSchedXactionSetLastOccurDate(SchedXaction *sx, GDate* new_last_occur)
|
||||
xaccSchedXactionSetLastOccurDate(SchedXaction *sx, const GDate* new_last_occur)
|
||||
{
|
||||
if (g_date_valid(&sx->last_date)
|
||||
&& g_date_compare(&sx->last_date, new_last_occur) == 0)
|
||||
|
||||
@@ -161,7 +161,7 @@ gchar *xaccSchedXactionGetName( const SchedXaction *sx );
|
||||
void xaccSchedXactionSetName( SchedXaction *sx, const gchar *newName );
|
||||
|
||||
const GDate* xaccSchedXactionGetStartDate(const SchedXaction *sx );
|
||||
void xaccSchedXactionSetStartDate( SchedXaction *sx, GDate* newStart );
|
||||
void xaccSchedXactionSetStartDate( SchedXaction *sx, const GDate* newStart );
|
||||
|
||||
int xaccSchedXactionHasEndDate( const SchedXaction *sx );
|
||||
/**
|
||||
@@ -171,10 +171,10 @@ const GDate* xaccSchedXactionGetEndDate(const SchedXaction *sx );
|
||||
/**
|
||||
* Set to an invalid GDate to turn off 'end-date' definition.
|
||||
*/
|
||||
void xaccSchedXactionSetEndDate( SchedXaction *sx, GDate* newEnd );
|
||||
void xaccSchedXactionSetEndDate( SchedXaction *sx, const GDate* newEnd );
|
||||
|
||||
const GDate* xaccSchedXactionGetLastOccurDate(const SchedXaction *sx );
|
||||
void xaccSchedXactionSetLastOccurDate( SchedXaction *sx, GDate* newLastOccur );
|
||||
void xaccSchedXactionSetLastOccurDate( SchedXaction *sx, const GDate* newLastOccur );
|
||||
|
||||
/**
|
||||
* Returns true if the scheduled transaction has a defined number of
|
||||
|
||||
@@ -2189,7 +2189,7 @@ make_trans_query (Transaction *trans, TestQueryTypes query_types)
|
||||
}
|
||||
|
||||
static Recurrence*
|
||||
daily_freq(GDate* start, int multiplier)
|
||||
daily_freq(const GDate* start, int multiplier)
|
||||
{
|
||||
Recurrence *r = g_new0(Recurrence, 1);
|
||||
recurrenceSet(r, multiplier, PERIOD_DAY, start, WEEKEND_ADJ_NONE);
|
||||
@@ -2197,7 +2197,7 @@ daily_freq(GDate* start, int multiplier)
|
||||
}
|
||||
|
||||
static Recurrence*
|
||||
once_freq(GDate *when)
|
||||
once_freq(const GDate *when)
|
||||
{
|
||||
Recurrence *r = g_new0(Recurrence, 1);
|
||||
recurrenceSet(r, 1, PERIOD_ONCE, when, WEEKEND_ADJ_NONE);
|
||||
@@ -2205,7 +2205,7 @@ once_freq(GDate *when)
|
||||
}
|
||||
|
||||
static SchedXaction*
|
||||
add_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur, Recurrence *r)
|
||||
add_sx(gchar *name, const GDate *start, const GDate *end, const GDate *last_occur, Recurrence *r)
|
||||
{
|
||||
QofBook *book = qof_session_get_book(gnc_get_current_session());
|
||||
SchedXaction *sx = xaccSchedXactionMalloc(book);
|
||||
@@ -2227,13 +2227,13 @@ add_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur, Recurrence *r)
|
||||
}
|
||||
|
||||
SchedXaction*
|
||||
add_daily_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur)
|
||||
add_daily_sx(gchar *name, const GDate *start, const GDate *end, const GDate *last_occur)
|
||||
{
|
||||
return add_sx(name, start, end, last_occur, daily_freq(start, 1));
|
||||
}
|
||||
|
||||
SchedXaction*
|
||||
add_once_sx(gchar *name, GDate *when)
|
||||
add_once_sx(gchar *name, const GDate *when)
|
||||
{
|
||||
return add_sx(name, when, NULL, NULL, once_freq(when));
|
||||
}
|
||||
|
||||
@@ -89,8 +89,8 @@ void make_random_changes_to_level (QofBook *book, Account *parent);
|
||||
void make_random_changes_to_book (QofBook *book);
|
||||
void make_random_changes_to_session (QofSession *session);
|
||||
|
||||
SchedXaction* add_daily_sx(gchar *name, GDate *start, GDate *end, GDate *last_occur);
|
||||
SchedXaction* add_once_sx(gchar *name, GDate *when);
|
||||
SchedXaction* add_daily_sx(gchar *name, const GDate *start, const GDate *end, const GDate *last_occur);
|
||||
SchedXaction* add_once_sx(gchar *name, const GDate *when);
|
||||
void remove_sx(SchedXaction *sx);
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user