mirror of
https://github.com/Gnucash/gnucash.git
synced 2025-02-25 18:55:30 -06:00
Fix bug in next-occur formatting for instances that do not have a next-occur date.
git-svn-id: svn+ssh://svn.gnucash.org/repo/gnucash/trunk@15498 57a11ea4-9604-0410-9ed3-97b8803252fd
This commit is contained in:
@@ -453,6 +453,19 @@ gnc_sx_list_tree_model_adapter_init(GTypeInstance *instance, gpointer klass)
|
||||
g_signal_connect(adapter->real, "sort-column-changed", G_CALLBACK(gsltma_proxy_sort_column_changed), adapter);
|
||||
}
|
||||
|
||||
static void
|
||||
_format_conditional_date(GDate *date, char *date_buf, int buf_max_length)
|
||||
{
|
||||
if (date == NULL || !g_date_valid(date))
|
||||
{
|
||||
g_stpcpy(date_buf, "never");
|
||||
}
|
||||
else
|
||||
{
|
||||
qof_print_gdate(date_buf, buf_max_length, date);
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
gsltma_populate_tree_store(GncSxListTreeModelAdapter *model)
|
||||
{
|
||||
@@ -471,21 +484,10 @@ gsltma_populate_tree_store(GncSxListTreeModelAdapter *model)
|
||||
fs = xaccSchedXactionGetFreqSpec(instances->sx);
|
||||
xaccFreqSpecGetFreqStr(fs, frequency_str);
|
||||
|
||||
{
|
||||
GDate *last_occur = xaccSchedXactionGetLastOccurDate(instances->sx);
|
||||
if (last_occur == NULL || !g_date_valid(last_occur))
|
||||
{
|
||||
g_stpcpy(last_occur_date_buf, "never");
|
||||
}
|
||||
else
|
||||
{
|
||||
qof_print_gdate(last_occur_date_buf,
|
||||
MAX_DATE_LENGTH,
|
||||
last_occur);
|
||||
}
|
||||
}
|
||||
|
||||
qof_print_gdate(next_occur_date_buf, MAX_DATE_LENGTH, &instances->next_instance_date);
|
||||
_format_conditional_date(xaccSchedXactionGetLastOccurDate(instances->sx),
|
||||
last_occur_date_buf, MAX_DATE_LENGTH);
|
||||
_format_conditional_date(&instances->next_instance_date,
|
||||
next_occur_date_buf, MAX_DATE_LENGTH);
|
||||
|
||||
gtk_tree_store_append(model->orig, &iter, NULL);
|
||||
gtk_tree_store_set(model->orig, &iter,
|
||||
|
||||
Reference in New Issue
Block a user