Bug#431771: remove from SX deferred-instance list by value. Remove inexplicably-commented line from SX Instance Model.

git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15944 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
Joshua Sled
2007-04-20 21:24:08 +00:00
parent 428497a0fe
commit 3e403f491f
2 changed files with 17 additions and 6 deletions

View File

@@ -370,7 +370,6 @@ _gnc_sx_gen_instances(gpointer *data, gpointer user_data)
inst_date = xaccSchedXactionGetNextInstance(sx, postponed->data);
seq_num = gnc_sx_get_instance_count(sx, postponed->data);
inst = gnc_sx_instance_new(instances, SX_INSTANCE_STATE_POSTPONED, &inst_date, postponed->data, seq_num);
//inst->temporal_state = postponed->data;
instances->instance_list = g_list_append(instances->instance_list, inst);
}
}

View File

@@ -802,12 +802,14 @@ _temporal_state_data_cmp( gconstpointer a, gconstpointer b )
if ( !tsd_a && !tsd_b )
return 0;
if (tsd_a == tsd_b)
return 0;
if ( !tsd_a )
return 1;
if ( !tsd_b )
return -1;
return g_date_compare( &tsd_a->last_date,
&tsd_b->last_date );
&tsd_b->last_date );
}
/**
@@ -817,9 +819,9 @@ _temporal_state_data_cmp( gconstpointer a, gconstpointer b )
void
gnc_sx_add_defer_instance( SchedXaction *sx, void *deferStateData )
{
sx->deferredList = g_list_insert_sorted( sx->deferredList,
deferStateData,
_temporal_state_data_cmp );
sx->deferredList = g_list_insert_sorted( sx->deferredList,
deferStateData,
_temporal_state_data_cmp );
}
/**
@@ -829,7 +831,17 @@ gnc_sx_add_defer_instance( SchedXaction *sx, void *deferStateData )
void
gnc_sx_remove_defer_instance( SchedXaction *sx, void *deferStateData )
{
sx->deferredList = g_list_remove( sx->deferredList, deferStateData );
GList *found_by_value;
found_by_value = g_list_find_custom(
sx->deferredList, deferStateData, _temporal_state_data_cmp);
if (found_by_value == NULL) {
g_warning("unable to find deferred instance");
return;
}
gnc_sx_destroy_temporal_state(found_by_value->data);
sx->deferredList = g_list_delete_link(sx->deferredList, found_by_value);
}
/**