If there are no marked days on Windows the dense calendar crashes

If there are no marked days in the dense calendar add a blank one. Also
make sure all pending events are processed be fore returning as the
treeview did not always populate correctly.
This commit is contained in:
Robert Fewell 2017-11-09 10:12:52 +00:00
parent 4f9716362c
commit 9253b50210

View File

@ -1234,6 +1234,17 @@ populate_hover_window(GncDenseCal *dcal, gint doc)
gtk_list_store_set(model, &iter, 0, (gdcmd->name ? gdcmd->name : _("(unnamed)")), 1, gdcmd->info, -1);
}
// if there are no rows, add one
if (gtk_tree_model_iter_n_children (GTK_TREE_MODEL(model), NULL) == 0)
{
GtkTreeIter iter;
gtk_list_store_insert(model, &iter, -1);
}
// make sure all pending events are processed
while(gtk_events_pending())
gtk_main_iteration();
g_date_free(date);
}
}