r21192 - gnucash/trunk/src/libqof/qof - Delete unused functions from qofinstance.c
John Ralls
jralls at code.gnucash.org
Fri Aug 19 23:44:59 EDT 2011
Author: jralls
Date: 2011-08-19 23:44:59 -0400 (Fri, 19 Aug 2011)
New Revision: 21192
Trac: http://svn.gnucash.org/trac/changeset/21192
Modified:
gnucash/trunk/src/libqof/qof/qofinstance.c
gnucash/trunk/src/libqof/qof/qofinstance.h
gnucash/trunk/src/libqof/qof/test/test-qofinstance.c
Log:
Delete unused functions from qofinstance.c
Modified: gnucash/trunk/src/libqof/qof/qofinstance.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofinstance.c 2011-08-20 03:44:50 UTC (rev 21191)
+++ gnucash/trunk/src/libqof/qof/qofinstance.c 2011-08-20 03:44:59 UTC (rev 21192)
@@ -602,17 +602,6 @@
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 @@
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 @@
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 @@
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)
{
Modified: gnucash/trunk/src/libqof/qof/qofinstance.h
===================================================================
--- gnucash/trunk/src/libqof/qof/qofinstance.h 2011-08-20 03:44:50 UTC (rev 21191)
+++ gnucash/trunk/src/libqof/qof/qofinstance.h 2011-08-20 03:44:59 UTC (rev 21192)
@@ -140,15 +140,6 @@
/** 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 @@
/* 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 */
Modified: gnucash/trunk/src/libqof/qof/test/test-qofinstance.c
===================================================================
--- gnucash/trunk/src/libqof/qof/test/test-qofinstance.c 2011-08-20 03:44:50 UTC (rev 21191)
+++ gnucash/trunk/src/libqof/qof/test/test-qofinstance.c 2011-08-20 03:44:59 UTC (rev 21192)
@@ -115,8 +115,8 @@
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 @@
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", ×pec_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 ) );
More information about the gnucash-changes
mailing list