Delete unused functions from qofinstance.c

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@21192 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
John Ralls 2011-08-20 03:44:59 +00:00
parent 8d53e67560
commit b3c49d4514
3 changed files with 7 additions and 58 deletions

View File

@ -602,17 +602,6 @@ qof_instance_set_slots (QofInstance *inst, KvpFrame *frm)
inst->kvp_data = frm;
}
Timespec
qof_instance_get_last_update (const QofInstance *inst)
{
if (!inst)
{
Timespec ts = {0, -1};
return ts;
}
return GET_PRIVATE(inst)->last_update;
}
void
qof_instance_set_last_update (QofInstance *inst, Timespec ts)
{
@ -645,13 +634,6 @@ void qof_instance_reset_editlevel (gpointer ptr)
GET_PRIVATE(ptr)->editlevel = 0;
}
gboolean
qof_instance_check_edit(const QofInstance *inst)
{
g_return_val_if_fail(QOF_IS_INSTANCE(inst), FALSE);
return (GET_PRIVATE(inst)->editlevel > 0);
}
int
qof_instance_version_cmp (const QofInstance *left, const QofInstance *right)
{
@ -770,14 +752,6 @@ qof_instance_get_version (gconstpointer inst)
return GET_PRIVATE(inst)->version;
}
gint
qof_instance_compare_version (gconstpointer inst1, gconstpointer inst2)
{
g_return_val_if_fail(QOF_IS_INSTANCE(inst1), 1);
g_return_val_if_fail(QOF_IS_INSTANCE(inst2), -1);
return GET_PRIVATE(inst2)->version - GET_PRIVATE(inst1)->version;
}
void
qof_instance_set_version (gpointer inst, gint32 vers)
{
@ -793,18 +767,6 @@ qof_instance_copy_version (gpointer to, gconstpointer from)
GET_PRIVATE(to)->version = GET_PRIVATE(from)->version;
}
void
qof_instance_increment_version (gpointer inst, guint32 new_check)
{
QofInstancePrivate *priv;
g_return_if_fail(QOF_IS_INSTANCE(inst));
priv = GET_PRIVATE(inst);
priv->version++;
priv->version_check = new_check;
}
guint32
qof_instance_get_version_check (gconstpointer inst)
{

View File

@ -140,15 +140,6 @@ gint qof_instance_guid_compare(const gconstpointer ptr1, const gconstpointer ptr
/** Return the pointer to the kvp_data */
/*@ dependent @*/
KvpFrame* qof_instance_get_slots (const QofInstance *);
/** Return the last time this instance was modified. If QofInstances
* are used with the QofObject storage backends, then the instance
* update times are reserved for use by the backend, for managing
* multi-user updates. Non-backend code should not set the update
* times.
*/
Timespec qof_instance_get_last_update (const QofInstance *inst);
void qof_instance_set_editlevel(gpointer inst, gint level);
gint qof_instance_get_editlevel (gconstpointer ptr);
void qof_instance_increase_editlevel (gpointer ptr);
@ -209,23 +200,19 @@ void qof_instance_set_dirty(QofInstance* inst);
/* reset the dirty flag */
void qof_instance_mark_clean (QofInstance *);
gboolean qof_instance_check_edit(const QofInstance *inst);
gboolean qof_instance_get_infant(const QofInstance *inst);
/** Get the version number on this instance. The version number is
* used to manage multi-user updates. */
gint32 qof_instance_get_version (gconstpointer inst);
/** Compare the version numbers of two instances. */
gint qof_instance_compare_version (gconstpointer inst1, gconstpointer inst2);
/** Set the version number on this instance. The version number is
* used to manage multi-user updates. */
void qof_instance_set_version (gpointer inst, gint32 value);
/** Copy the version number on this instance. The version number is
* used to manage multi-user updates. */
void qof_instance_copy_version (gpointer to, gconstpointer from);
/** Increment the instance version number */
void qof_instance_increment_version (gpointer inst, guint32 new_check);
/** Get the instance version_check number */
guint32 qof_instance_get_version_check (gconstpointer inst);
/** Set the instance version_check number */

View File

@ -115,8 +115,8 @@ test_instance_new_destroy( void )
QofInstance *inst;
QofInstanceClass *klass;
/* test var */
Timespec timespec_priv;
Timespec *timespec_priv;
g_test_message( "Testing qofinstance object initialization" );
inst = g_object_new(QOF_TYPE_INSTANCE, NULL);
g_assert( QOF_IS_INSTANCE( inst ) );
@ -131,9 +131,9 @@ test_instance_new_destroy( void )
g_assert( !qof_instance_get_collection( inst ) );
g_assert( qof_instance_get_book( inst ) == NULL );
g_assert( inst->kvp_data );
timespec_priv = qof_instance_get_last_update( inst );
g_assert_cmpint( timespec_priv.tv_sec, ==, 0 );
g_assert_cmpint( timespec_priv.tv_nsec, ==, -1 );
g_object_get( inst, "last-update", &timespec_priv, NULL);
g_assert_cmpint( timespec_priv->tv_sec, ==, 0 );
g_assert_cmpint( timespec_priv->tv_nsec, ==, -1 );
g_assert_cmpint( qof_instance_get_editlevel( inst ), ==, 0 );
g_assert( !qof_instance_get_destroying( inst ) );
g_assert( !qof_instance_get_dirty_flag( inst ) );